From e800d950df07cbee92b246db8544e288e4958627 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 7 Oct 2025 19:09:52 +0000 Subject: [PATCH] Regenerate client from commit 74d5094 of spec repo --- .generator/schemas/v2/openapi.yaml | 1297 +++++++++++++++++ .../CreateReferenceTable.java | 72 + .../CreateReferenceTableUpload.java | 41 + .../CreateReferenceTable_3196130987.java | 67 + examples/v2/reference-tables/DeleteTable.java | 22 + examples/v2/reference-tables/GetRowsByID.java | 26 + examples/v2/reference-tables/GetTable.java | 24 + examples/v2/reference-tables/ListTables.java | 24 + .../UpdateReferenceTable.java | 69 + .../api/client/v2/api/ReferenceTablesApi.java | 1156 +++++++++++++++ .../client/v2/model/CreateTableRequest.java | 136 ++ .../v2/model/CreateTableRequestData.java | 205 +++ .../CreateTableRequestDataAttributes.java | 307 ++++ ...ableRequestDataAttributesFileMetadata.java | 340 +++++ ...ataAttributesFileMetadataCloudStorage.java | 136 ++ ...stDataAttributesFileMetadataLocalFile.java | 94 ++ ...ributesFileMetadataOneOfAccessDetails.java | 221 +++ ...leMetadataOneOfAccessDetailsAwsDetail.java | 224 +++ ...MetadataOneOfAccessDetailsAzureDetail.java | 302 ++++ ...leMetadataOneOfAccessDetailsGcpDetail.java | 261 ++++ ...reateTableRequestDataAttributesSchema.java | 195 +++ ...equestDataAttributesSchemaFieldsItems.java | 185 +++ .../v2/model/CreateTableRequestDataType.java | 57 + .../client/v2/model/CreateUploadRequest.java | 136 ++ .../v2/model/CreateUploadRequestData.java | 205 +++ .../CreateUploadRequestDataAttributes.java | 240 +++ .../v2/model/CreateUploadRequestDataType.java | 56 + .../client/v2/model/CreateUploadResponse.java | 136 ++ .../v2/model/CreateUploadResponseData.java | 206 +++ .../CreateUploadResponseDataAttributes.java | 147 ++ .../model/CreateUploadResponseDataType.java | 56 + .../client/v2/model/PatchTableRequest.java | 136 ++ .../v2/model/PatchTableRequestData.java | 205 +++ .../PatchTableRequestDataAttributes.java | 260 ++++ ...ableRequestDataAttributesFileMetadata.java | 338 +++++ ...ataAttributesFileMetadataCloudStorage.java | 125 ++ ...stDataAttributesFileMetadataLocalFile.java | 94 ++ ...ributesFileMetadataOneOfAccessDetails.java | 218 +++ ...leMetadataOneOfAccessDetailsAwsDetail.java | 214 +++ ...MetadataOneOfAccessDetailsAzureDetail.java | 287 ++++ ...leMetadataOneOfAccessDetailsGcpDetail.java | 249 ++++ ...PatchTableRequestDataAttributesSchema.java | 195 +++ ...equestDataAttributesSchemaFieldsItems.java | 184 +++ .../v2/model/PatchTableRequestDataType.java | 57 + .../model/ReferenceTableCreateSourceType.java | 66 + .../model/ReferenceTableSchemaFieldType.java | 59 + .../v2/model/ReferenceTableSortType.java | 68 + .../v2/model/ReferenceTableSourceType.java | 80 + .../api/client/v2/model/TableResultV2.java | 136 ++ .../client/v2/model/TableResultV2Array.java | 154 ++ .../client/v2/model/TableResultV2Data.java | 205 +++ .../v2/model/TableResultV2DataAttributes.java | 438 ++++++ ...bleResultV2DataAttributesFileMetadata.java | 334 +++++ ...ataAttributesFileMetadataCloudStorage.java | 268 ++++ ...utesFileMetadataCloudStorageErrorType.java | 98 ++ ...V2DataAttributesFileMetadataLocalFile.java | 198 +++ ...ributesFileMetadataOneOfAccessDetails.java | 216 +++ ...leMetadataOneOfAccessDetailsAwsDetail.java | 212 +++ ...MetadataOneOfAccessDetailsAzureDetail.java | 286 ++++ ...leMetadataOneOfAccessDetailsGcpDetail.java | 247 ++++ .../TableResultV2DataAttributesSchema.java | 195 +++ ...sultV2DataAttributesSchemaFieldsItems.java | 183 +++ .../v2/model/TableResultV2DataType.java | 56 + .../v2/model/TableRowResourceArray.java | 154 ++ .../client/v2/model/TableRowResourceData.java | 205 +++ .../model/TableRowResourceDataAttributes.java | 145 ++ .../v2/model/TableRowResourceDataType.java | 55 + ...etails_returns_Bad_Request_response.freeze | 1 + ..._details_returns_Bad_Request_response.json | 32 + .../client/v2/api/reference_tables.feature | 121 ++ .../com/datadog/api/client/v2/api/undo.json | 49 + 71 files changed, 13466 insertions(+) create mode 100644 examples/v2/reference-tables/CreateReferenceTable.java create mode 100644 examples/v2/reference-tables/CreateReferenceTableUpload.java create mode 100644 examples/v2/reference-tables/CreateReferenceTable_3196130987.java create mode 100644 examples/v2/reference-tables/DeleteTable.java create mode 100644 examples/v2/reference-tables/GetRowsByID.java create mode 100644 examples/v2/reference-tables/GetTable.java create mode 100644 examples/v2/reference-tables/ListTables.java create mode 100644 examples/v2/reference-tables/UpdateReferenceTable.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/ReferenceTablesApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadata.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataCloudStorage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataLocalFile.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesSchema.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesSchemaFieldsItems.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateUploadRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateUploadResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadata.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataCloudStorage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataLocalFile.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesSchema.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesSchemaFieldsItems.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReferenceTableCreateSourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReferenceTableSchemaFieldType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReferenceTableSortType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReferenceTableSourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2Array.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2Data.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadata.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataCloudStorage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataCloudStorageErrorType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataLocalFile.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetails.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesSchema.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesSchemaFieldsItems.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableResultV2DataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableRowResourceArray.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableRowResourceData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableRowResourceDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TableRowResourceDataType.java create mode 100644 src/test/resources/cassettes/features/v2/Create_reference_table_without_upload_or_access_details_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_reference_table_without_upload_or_access_details_returns_Bad_Request_response.json create mode 100644 src/test/resources/com/datadog/api/client/v2/api/reference_tables.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 79c3e338ffb..0a5310b41d4 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 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 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 + 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. + Currently only 1 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 multi-part + 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/or 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. + Currently only 1 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 via 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 via 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 via 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. + Currently only 1 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 (AWS S3, Azure Blob, 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 of type `source: + 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/examples/v2/reference-tables/CreateReferenceTable.java b/examples/v2/reference-tables/CreateReferenceTable.java new file mode 100644 index 00000000000..63288105cbc --- /dev/null +++ b/examples/v2/reference-tables/CreateReferenceTable.java @@ -0,0 +1,72 @@ +// Create reference table returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReferenceTablesApi; +import com.datadog.api.client.v2.model.CreateTableRequest; +import com.datadog.api.client.v2.model.CreateTableRequestData; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesFileMetadata; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesFileMetadataCloudStorage; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesSchema; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesSchemaFieldsItems; +import com.datadog.api.client.v2.model.CreateTableRequestDataType; +import com.datadog.api.client.v2.model.ReferenceTableCreateSourceType; +import com.datadog.api.client.v2.model.ReferenceTableSchemaFieldType; +import com.datadog.api.client.v2.model.TableResultV2; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient); + + CreateTableRequest body = + new CreateTableRequest() + .data( + new CreateTableRequestData() + .attributes( + new CreateTableRequestDataAttributes() + .description("this is a cloud table generated via a cloud bucket sync") + .fileMetadata( + new CreateTableRequestDataAttributesFileMetadata( + new CreateTableRequestDataAttributesFileMetadataCloudStorage() + .accessDetails( + new CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails() + .awsDetail( + new CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail() + .awsAccountId("test-account-id") + .awsBucketName("test-bucket") + .filePath("test_rt.csv"))) + .syncEnabled(true))) + .schema( + new CreateTableRequestDataAttributesSchema() + .fields( + Arrays.asList( + new CreateTableRequestDataAttributesSchemaFieldsItems() + .name("name") + .type(ReferenceTableSchemaFieldType.STRING), + new CreateTableRequestDataAttributesSchemaFieldsItems() + .name("account_id") + .type(ReferenceTableSchemaFieldType.STRING))) + .primaryKeys(Collections.singletonList("account_id"))) + .source(ReferenceTableCreateSourceType.S3) + .tableName("test_reference_table") + .tags(Collections.singletonList("test_tag"))) + .type(CreateTableRequestDataType.REFERENCE_TABLE)); + + try { + TableResultV2 result = apiInstance.createReferenceTable(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReferenceTablesApi#createReferenceTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/reference-tables/CreateReferenceTableUpload.java b/examples/v2/reference-tables/CreateReferenceTableUpload.java new file mode 100644 index 00000000000..e487bad8994 --- /dev/null +++ b/examples/v2/reference-tables/CreateReferenceTableUpload.java @@ -0,0 +1,41 @@ +// Create reference table upload returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReferenceTablesApi; +import com.datadog.api.client.v2.model.CreateUploadRequest; +import com.datadog.api.client.v2.model.CreateUploadRequestData; +import com.datadog.api.client.v2.model.CreateUploadRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateUploadRequestDataType; +import com.datadog.api.client.v2.model.CreateUploadResponse; +import java.util.Arrays; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient); + + CreateUploadRequest body = + new CreateUploadRequest() + .data( + new CreateUploadRequestData() + .attributes( + new CreateUploadRequestDataAttributes() + .headers(Arrays.asList("id", "name", "value")) + .tableName("test_upload_table_Example-Reference-Table") + .partCount(1) + .partSize(1024L)) + .type(CreateUploadRequestDataType.UPLOAD)); + + try { + CreateUploadResponse result = apiInstance.createReferenceTableUpload(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReferenceTablesApi#createReferenceTableUpload"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/reference-tables/CreateReferenceTable_3196130987.java b/examples/v2/reference-tables/CreateReferenceTable_3196130987.java new file mode 100644 index 00000000000..9aca3fabaf2 --- /dev/null +++ b/examples/v2/reference-tables/CreateReferenceTable_3196130987.java @@ -0,0 +1,67 @@ +// Create reference table with upload returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReferenceTablesApi; +import com.datadog.api.client.v2.model.CreateTableRequest; +import com.datadog.api.client.v2.model.CreateTableRequestData; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesFileMetadata; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesFileMetadataLocalFile; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesSchema; +import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesSchemaFieldsItems; +import com.datadog.api.client.v2.model.CreateTableRequestDataType; +import com.datadog.api.client.v2.model.ReferenceTableCreateSourceType; +import com.datadog.api.client.v2.model.ReferenceTableSchemaFieldType; +import com.datadog.api.client.v2.model.TableResultV2; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient); + + CreateTableRequest body = + new CreateTableRequest() + .data( + new CreateTableRequestData() + .attributes( + new CreateTableRequestDataAttributes() + .description( + "Test reference table created via BDD test Example-Reference-Table") + .source(ReferenceTableCreateSourceType.LOCAL_FILE) + .fileMetadata( + new CreateTableRequestDataAttributesFileMetadata( + new CreateTableRequestDataAttributesFileMetadataLocalFile() + .uploadId("test-upload-id-Example-Reference-Table"))) + .schema( + new CreateTableRequestDataAttributesSchema() + .fields( + Arrays.asList( + new CreateTableRequestDataAttributesSchemaFieldsItems() + .name("id") + .type(ReferenceTableSchemaFieldType.STRING), + new CreateTableRequestDataAttributesSchemaFieldsItems() + .name("name") + .type(ReferenceTableSchemaFieldType.STRING), + new CreateTableRequestDataAttributesSchemaFieldsItems() + .name("value") + .type(ReferenceTableSchemaFieldType.INT32))) + .primaryKeys(Collections.singletonList("id"))) + .tableName("test_reference_table_Example-Reference-Table") + .tags(Collections.singletonList("test_tag"))) + .type(CreateTableRequestDataType.REFERENCE_TABLE)); + + try { + TableResultV2 result = apiInstance.createReferenceTable(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReferenceTablesApi#createReferenceTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/reference-tables/DeleteTable.java b/examples/v2/reference-tables/DeleteTable.java new file mode 100644 index 00000000000..12e85b0ef6c --- /dev/null +++ b/examples/v2/reference-tables/DeleteTable.java @@ -0,0 +1,22 @@ +// Delete table returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReferenceTablesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient); + + try { + apiInstance.deleteTable("id"); + } catch (ApiException e) { + System.err.println("Exception when calling ReferenceTablesApi#deleteTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/reference-tables/GetRowsByID.java b/examples/v2/reference-tables/GetRowsByID.java new file mode 100644 index 00000000000..c84ae7b7fcd --- /dev/null +++ b/examples/v2/reference-tables/GetRowsByID.java @@ -0,0 +1,26 @@ +// Get rows by id returns "Some or all requested rows were found." response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReferenceTablesApi; +import com.datadog.api.client.v2.model.TableRowResourceArray; +import java.util.Arrays; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient); + + try { + TableRowResourceArray result = + apiInstance.getRowsByID("table-123", Arrays.asList("row1", "row2")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReferenceTablesApi#getRowsByID"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/reference-tables/GetTable.java b/examples/v2/reference-tables/GetTable.java new file mode 100644 index 00000000000..346c88834ab --- /dev/null +++ b/examples/v2/reference-tables/GetTable.java @@ -0,0 +1,24 @@ +// Get table returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReferenceTablesApi; +import com.datadog.api.client.v2.model.TableResultV2; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient); + + try { + TableResultV2 result = apiInstance.getTable("id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReferenceTablesApi#getTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/reference-tables/ListTables.java b/examples/v2/reference-tables/ListTables.java new file mode 100644 index 00000000000..b8cc324e4bb --- /dev/null +++ b/examples/v2/reference-tables/ListTables.java @@ -0,0 +1,24 @@ +// List tables returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReferenceTablesApi; +import com.datadog.api.client.v2.model.TableResultV2Array; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient); + + try { + TableResultV2Array result = apiInstance.listTables(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReferenceTablesApi#listTables"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/reference-tables/UpdateReferenceTable.java b/examples/v2/reference-tables/UpdateReferenceTable.java new file mode 100644 index 00000000000..ee79aef32de --- /dev/null +++ b/examples/v2/reference-tables/UpdateReferenceTable.java @@ -0,0 +1,69 @@ +// Update reference table returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReferenceTablesApi; +import com.datadog.api.client.v2.model.PatchTableRequest; +import com.datadog.api.client.v2.model.PatchTableRequestData; +import com.datadog.api.client.v2.model.PatchTableRequestDataAttributes; +import com.datadog.api.client.v2.model.PatchTableRequestDataAttributesFileMetadata; +import com.datadog.api.client.v2.model.PatchTableRequestDataAttributesFileMetadataCloudStorage; +import com.datadog.api.client.v2.model.PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails; +import com.datadog.api.client.v2.model.PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail; +import com.datadog.api.client.v2.model.PatchTableRequestDataAttributesSchema; +import com.datadog.api.client.v2.model.PatchTableRequestDataAttributesSchemaFieldsItems; +import com.datadog.api.client.v2.model.PatchTableRequestDataType; +import com.datadog.api.client.v2.model.ReferenceTableSchemaFieldType; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient); + + PatchTableRequest body = + new PatchTableRequest() + .data( + new PatchTableRequestData() + .attributes( + new PatchTableRequestDataAttributes() + .description("this is a cloud table generated via a cloud bucket sync") + .fileMetadata( + new PatchTableRequestDataAttributesFileMetadata( + new PatchTableRequestDataAttributesFileMetadataCloudStorage() + .accessDetails( + new PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails() + .awsDetail( + new PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail() + .awsAccountId("test-account-id") + .awsBucketName("test-bucket") + .filePath("test_rt.csv"))) + .syncEnabled(true))) + .schema( + new PatchTableRequestDataAttributesSchema() + .fields( + Arrays.asList( + new PatchTableRequestDataAttributesSchemaFieldsItems() + .name("id") + .type(ReferenceTableSchemaFieldType.INT32), + new PatchTableRequestDataAttributesSchemaFieldsItems() + .name("name") + .type(ReferenceTableSchemaFieldType.STRING))) + .primaryKeys(Collections.singletonList("id"))) + .syncEnabled(false) + .tags(Collections.singletonList("test_tag"))) + .id("00000000-0000-0000-0000-000000000000") + .type(PatchTableRequestDataType.REFERENCE_TABLE)); + + try { + apiInstance.updateReferenceTable("id", body); + } catch (ApiException e) { + System.err.println("Exception when calling ReferenceTablesApi#updateReferenceTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/ReferenceTablesApi.java b/src/main/java/com/datadog/api/client/v2/api/ReferenceTablesApi.java new file mode 100644 index 00000000000..e2bdfb7ad05 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/ReferenceTablesApi.java @@ -0,0 +1,1156 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.CreateTableRequest; +import com.datadog.api.client.v2.model.CreateUploadRequest; +import com.datadog.api.client.v2.model.CreateUploadResponse; +import com.datadog.api.client.v2.model.PatchTableRequest; +import com.datadog.api.client.v2.model.ReferenceTableSortType; +import com.datadog.api.client.v2.model.TableResultV2; +import com.datadog.api.client.v2.model.TableResultV2Array; +import com.datadog.api.client.v2.model.TableRowResourceArray; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReferenceTablesApi { + private ApiClient apiClient; + + public ReferenceTablesApi() { + this(ApiClient.getDefaultApiClient()); + } + + public ReferenceTablesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create reference table. + * + *

See {@link #createReferenceTableWithHttpInfo}. + * + * @param body (required) + * @return TableResultV2 + * @throws ApiException if fails to make API call + */ + public TableResultV2 createReferenceTable(CreateTableRequest body) throws ApiException { + return createReferenceTableWithHttpInfo(body).getData(); + } + + /** + * Create reference table. + * + *

See {@link #createReferenceTableWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<TableResultV2> + */ + public CompletableFuture createReferenceTableAsync(CreateTableRequest body) { + return createReferenceTableWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 (AWS S3, Azure + * Blob, or GCP Cloud Storage). + * + * @param body (required) + * @return ApiResponse<TableResultV2> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse createReferenceTableWithHttpInfo(CreateTableRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createReferenceTable"); + } + // create path and map variables + String localVarPath = "/api/v2/reference-tables/tables"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.createReferenceTable", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create reference table. + * + *

See {@link #createReferenceTableWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<TableResultV2>> + */ + public CompletableFuture> createReferenceTableWithHttpInfoAsync( + CreateTableRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createReferenceTable")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/reference-tables/tables"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.createReferenceTable", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create reference table upload. + * + *

See {@link #createReferenceTableUploadWithHttpInfo}. + * + * @param body (required) + * @return CreateUploadResponse + * @throws ApiException if fails to make API call + */ + public CreateUploadResponse createReferenceTableUpload(CreateUploadRequest body) + throws ApiException { + return createReferenceTableUploadWithHttpInfo(body).getData(); + } + + /** + * Create reference table upload. + * + *

See {@link #createReferenceTableUploadWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<CreateUploadResponse> + */ + public CompletableFuture createReferenceTableUploadAsync( + CreateUploadRequest body) { + return createReferenceTableUploadWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a reference table upload for bulk data ingestion + * + * @param body (required) + * @return ApiResponse<CreateUploadResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse createReferenceTableUploadWithHttpInfo( + CreateUploadRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createReferenceTableUpload"); + } + // create path and map variables + String localVarPath = "/api/v2/reference-tables/uploads"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.createReferenceTableUpload", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create reference table upload. + * + *

See {@link #createReferenceTableUploadWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<CreateUploadResponse>> + */ + public CompletableFuture> + createReferenceTableUploadWithHttpInfoAsync(CreateUploadRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling createReferenceTableUpload")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/reference-tables/uploads"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.createReferenceTableUpload", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete table. + * + *

See {@link #deleteTableWithHttpInfo}. + * + * @param id The ID of the reference table to delete (required) + * @throws ApiException if fails to make API call + */ + public void deleteTable(String id) throws ApiException { + deleteTableWithHttpInfo(id); + } + + /** + * Delete table. + * + *

See {@link #deleteTableWithHttpInfoAsync}. + * + * @param id The ID of the reference table to delete (required) + * @return CompletableFuture + */ + public CompletableFuture deleteTableAsync(String id) { + return deleteTableWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a reference table by ID + * + * @param id The ID of the reference table to delete (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteTableWithHttpInfo(String id) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling deleteTable"); + } + // create path and map variables + String localVarPath = + "/api/v2/reference-tables/tables/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.deleteTable", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete table. + * + *

See {@link #deleteTableWithHttpInfo}. + * + * @param id The ID of the reference table to delete (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteTableWithHttpInfoAsync(String id) { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'id' when calling deleteTable")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/reference-tables/tables/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.deleteTable", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get rows by id. + * + *

See {@link #getRowsByIDWithHttpInfo}. + * + * @param id The ID of the reference table (required) + * @param rowId List of row IDs (primary key values) to retrieve from the reference table + * (required) + * @return TableRowResourceArray + * @throws ApiException if fails to make API call + */ + public TableRowResourceArray getRowsByID(String id, List rowId) throws ApiException { + return getRowsByIDWithHttpInfo(id, rowId).getData(); + } + + /** + * Get rows by id. + * + *

See {@link #getRowsByIDWithHttpInfoAsync}. + * + * @param id The ID of the reference table (required) + * @param rowId List of row IDs (primary key values) to retrieve from the reference table + * (required) + * @return CompletableFuture<TableRowResourceArray> + */ + public CompletableFuture getRowsByIDAsync(String id, List rowId) { + return getRowsByIDWithHttpInfoAsync(id, rowId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get reference table rows by their primary key values. + * + * @param id The ID of the reference table (required) + * @param rowId List of row IDs (primary key values) to retrieve from the reference table + * (required) + * @return ApiResponse<TableRowResourceArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Some or all requested rows were found. -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getRowsByIDWithHttpInfo(String id, List rowId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getRowsByID"); + } + + // verify the required parameter 'rowId' is set + if (rowId == null) { + throw new ApiException( + 400, "Missing the required parameter 'rowId' when calling getRowsByID"); + } + // create path and map variables + String localVarPath = + "/api/v2/reference-tables/tables/{id}/rows" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "row_id", rowId)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.getRowsByID", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get rows by id. + * + *

See {@link #getRowsByIDWithHttpInfo}. + * + * @param id The ID of the reference table (required) + * @param rowId List of row IDs (primary key values) to retrieve from the reference table + * (required) + * @return CompletableFuture<ApiResponse<TableRowResourceArray>> + */ + public CompletableFuture> getRowsByIDWithHttpInfoAsync( + String id, List rowId) { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'id' when calling getRowsByID")); + return result; + } + + // verify the required parameter 'rowId' is set + if (rowId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'rowId' when calling getRowsByID")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/reference-tables/tables/{id}/rows" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "row_id", rowId)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.getRowsByID", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get table. + * + *

See {@link #getTableWithHttpInfo}. + * + * @param id The ID of the reference table to retrieve (required) + * @return TableResultV2 + * @throws ApiException if fails to make API call + */ + public TableResultV2 getTable(String id) throws ApiException { + return getTableWithHttpInfo(id).getData(); + } + + /** + * Get table. + * + *

See {@link #getTableWithHttpInfoAsync}. + * + * @param id The ID of the reference table to retrieve (required) + * @return CompletableFuture<TableResultV2> + */ + public CompletableFuture getTableAsync(String id) { + return getTableWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a reference table by ID + * + * @param id The ID of the reference table to retrieve (required) + * @return ApiResponse<TableResultV2> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getTableWithHttpInfo(String id) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getTable"); + } + // create path and map variables + String localVarPath = + "/api/v2/reference-tables/tables/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.getTable", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get table. + * + *

See {@link #getTableWithHttpInfo}. + * + * @param id The ID of the reference table to retrieve (required) + * @return CompletableFuture<ApiResponse<TableResultV2>> + */ + public CompletableFuture> getTableWithHttpInfoAsync(String id) { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'id' when calling getTable")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/reference-tables/tables/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.getTable", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listTables. */ + public static class ListTablesOptionalParameters { + private Long limit; + private Long offset; + private ReferenceTableSortType sort; + private String filterStatus; + private String filterTableNameExact; + private String filterTableNameContains; + + /** + * Set limit. + * + * @param limit Number of tables to return (optional, default to 15) + * @return ListTablesOptionalParameters + */ + public ListTablesOptionalParameters limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Set offset. + * + * @param offset Number of tables to skip for pagination (optional, default to 0) + * @return ListTablesOptionalParameters + */ + public ListTablesOptionalParameters offset(Long offset) { + this.offset = offset; + return this; + } + + /** + * Set sort. + * + * @param sort Sort field and direction. Use field name for ascending, prefix with "-" for + * descending (optional, default to "-updated_at") + * @return ListTablesOptionalParameters + */ + public ListTablesOptionalParameters sort(ReferenceTableSortType sort) { + this.sort = sort; + return this; + } + + /** + * Set filterStatus. + * + * @param filterStatus Filter by table status (optional) + * @return ListTablesOptionalParameters + */ + public ListTablesOptionalParameters filterStatus(String filterStatus) { + this.filterStatus = filterStatus; + return this; + } + + /** + * Set filterTableNameExact. + * + * @param filterTableNameExact Filter by exact table name match (optional) + * @return ListTablesOptionalParameters + */ + public ListTablesOptionalParameters filterTableNameExact(String filterTableNameExact) { + this.filterTableNameExact = filterTableNameExact; + return this; + } + + /** + * Set filterTableNameContains. + * + * @param filterTableNameContains Filter by table name containing substring (optional) + * @return ListTablesOptionalParameters + */ + public ListTablesOptionalParameters filterTableNameContains(String filterTableNameContains) { + this.filterTableNameContains = filterTableNameContains; + return this; + } + } + + /** + * List tables. + * + *

See {@link #listTablesWithHttpInfo}. + * + * @return TableResultV2Array + * @throws ApiException if fails to make API call + */ + public TableResultV2Array listTables() throws ApiException { + return listTablesWithHttpInfo(new ListTablesOptionalParameters()).getData(); + } + + /** + * List tables. + * + *

See {@link #listTablesWithHttpInfoAsync}. + * + * @return CompletableFuture<TableResultV2Array> + */ + public CompletableFuture listTablesAsync() { + return listTablesWithHttpInfoAsync(new ListTablesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List tables. + * + *

See {@link #listTablesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return TableResultV2Array + * @throws ApiException if fails to make API call + */ + public TableResultV2Array listTables(ListTablesOptionalParameters parameters) + throws ApiException { + return listTablesWithHttpInfo(parameters).getData(); + } + + /** + * List tables. + * + *

See {@link #listTablesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<TableResultV2Array> + */ + public CompletableFuture listTablesAsync( + ListTablesOptionalParameters parameters) { + return listTablesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List all reference tables in this organization + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<TableResultV2Array> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listTablesWithHttpInfo( + ListTablesOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Long limit = parameters.limit; + Long offset = parameters.offset; + ReferenceTableSortType sort = parameters.sort; + String filterStatus = parameters.filterStatus; + String filterTableNameExact = parameters.filterTableNameExact; + String filterTableNameContains = parameters.filterTableNameContains; + // create path and map variables + String localVarPath = "/api/v2/reference-tables/tables"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[table_name][exact]", filterTableNameExact)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[table_name][contains]", filterTableNameContains)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.listTables", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List tables. + * + *

See {@link #listTablesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<TableResultV2Array>> + */ + public CompletableFuture> listTablesWithHttpInfoAsync( + ListTablesOptionalParameters parameters) { + Object localVarPostBody = null; + Long limit = parameters.limit; + Long offset = parameters.offset; + ReferenceTableSortType sort = parameters.sort; + String filterStatus = parameters.filterStatus; + String filterTableNameExact = parameters.filterTableNameExact; + String filterTableNameContains = parameters.filterTableNameContains; + // create path and map variables + String localVarPath = "/api/v2/reference-tables/tables"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[table_name][exact]", filterTableNameExact)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[table_name][contains]", filterTableNameContains)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.listTables", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update reference table. + * + *

See {@link #updateReferenceTableWithHttpInfo}. + * + * @param id The ID of the reference table to update (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void updateReferenceTable(String id, PatchTableRequest body) throws ApiException { + updateReferenceTableWithHttpInfo(id, body); + } + + /** + * Update reference table. + * + *

See {@link #updateReferenceTableWithHttpInfoAsync}. + * + * @param id The ID of the reference table to update (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture updateReferenceTableAsync(String id, PatchTableRequest body) { + return updateReferenceTableWithHttpInfoAsync(id, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 of type + * source: 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 The ID of the reference table to update (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse updateReferenceTableWithHttpInfo(String id, PatchTableRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling updateReferenceTable"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateReferenceTable"); + } + // create path and map variables + String localVarPath = + "/api/v2/reference-tables/tables/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.updateReferenceTable", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update reference table. + * + *

See {@link #updateReferenceTableWithHttpInfo}. + * + * @param id The ID of the reference table to update (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> updateReferenceTableWithHttpInfoAsync( + String id, PatchTableRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling updateReferenceTable")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateReferenceTable")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/reference-tables/tables/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReferenceTablesApi.updateReferenceTable", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequest.java new file mode 100644 index 00000000000..7bab2eaa4ed --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequest.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of CreateTableRequest object. */ +@JsonPropertyOrder({CreateTableRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateTableRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateTableRequestData data; + + public CreateTableRequest data(CreateTableRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of CreateTableRequestData object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateTableRequestData getData() { + return data; + } + + public void setData(CreateTableRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateTableRequest + */ + @JsonAnySetter + public CreateTableRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequest createTableRequest = (CreateTableRequest) o; + return Objects.equals(this.data, createTableRequest.data) + && Objects.equals(this.additionalProperties, createTableRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestData.java new file mode 100644 index 00000000000..f92254d450a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestData.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of CreateTableRequestData object. */ +@JsonPropertyOrder({ + CreateTableRequestData.JSON_PROPERTY_ATTRIBUTES, + CreateTableRequestData.JSON_PROPERTY_ID, + CreateTableRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateTableRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateTableRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CreateTableRequestDataType type = CreateTableRequestDataType.REFERENCE_TABLE; + + public CreateTableRequestData() {} + + @JsonCreator + public CreateTableRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CreateTableRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateTableRequestData attributes(CreateTableRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of CreateTableRequestDataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateTableRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateTableRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateTableRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the reference table. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CreateTableRequestData type(CreateTableRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Reference table resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateTableRequestDataType getType() { + return type; + } + + public void setType(CreateTableRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateTableRequestData + */ + @JsonAnySetter + public CreateTableRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateTableRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequestData createTableRequestData = (CreateTableRequestData) o; + return Objects.equals(this.attributes, createTableRequestData.attributes) + && Objects.equals(this.id, createTableRequestData.id) + && Objects.equals(this.type, createTableRequestData.type) + && Objects.equals(this.additionalProperties, createTableRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributes.java new file mode 100644 index 00000000000..63c3c33b040 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributes.java @@ -0,0 +1,307 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of CreateTableRequestDataAttributes object. */ +@JsonPropertyOrder({ + CreateTableRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, + CreateTableRequestDataAttributes.JSON_PROPERTY_FILE_METADATA, + CreateTableRequestDataAttributes.JSON_PROPERTY_SCHEMA, + CreateTableRequestDataAttributes.JSON_PROPERTY_SOURCE, + CreateTableRequestDataAttributes.JSON_PROPERTY_TABLE_NAME, + CreateTableRequestDataAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateTableRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_FILE_METADATA = "file_metadata"; + private CreateTableRequestDataAttributesFileMetadata fileMetadata; + + public static final String JSON_PROPERTY_SCHEMA = "schema"; + private CreateTableRequestDataAttributesSchema schema; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private ReferenceTableCreateSourceType source; + + public static final String JSON_PROPERTY_TABLE_NAME = "table_name"; + private String tableName; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public CreateTableRequestDataAttributes() {} + + @JsonCreator + public CreateTableRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_SCHEMA) + CreateTableRequestDataAttributesSchema schema, + @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE) + ReferenceTableCreateSourceType source, + @JsonProperty(required = true, value = JSON_PROPERTY_TABLE_NAME) String tableName) { + this.schema = schema; + this.unparsed |= schema.unparsed; + this.source = source; + this.unparsed |= !source.isValid(); + this.tableName = tableName; + } + + public CreateTableRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the reference table. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateTableRequestDataAttributes fileMetadata( + CreateTableRequestDataAttributesFileMetadata fileMetadata) { + this.fileMetadata = fileMetadata; + this.unparsed |= fileMetadata.unparsed; + return this; + } + + /** + * The definition of CreateTableRequestDataAttributesFileMetadata object. + * + * @return fileMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateTableRequestDataAttributesFileMetadata getFileMetadata() { + return fileMetadata; + } + + public void setFileMetadata(CreateTableRequestDataAttributesFileMetadata fileMetadata) { + this.fileMetadata = fileMetadata; + } + + public CreateTableRequestDataAttributes schema(CreateTableRequestDataAttributesSchema schema) { + this.schema = schema; + this.unparsed |= schema.unparsed; + return this; + } + + /** + * The definition of CreateTableRequestDataAttributesSchema object. + * + * @return schema + */ + @JsonProperty(JSON_PROPERTY_SCHEMA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateTableRequestDataAttributesSchema getSchema() { + return schema; + } + + public void setSchema(CreateTableRequestDataAttributesSchema schema) { + this.schema = schema; + } + + public CreateTableRequestDataAttributes source(ReferenceTableCreateSourceType source) { + this.source = source; + this.unparsed |= !source.isValid(); + return this; + } + + /** + * The source type for creating reference table data. Only these source types can be created via + * this API. + * + * @return source + */ + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReferenceTableCreateSourceType getSource() { + return source; + } + + public void setSource(ReferenceTableCreateSourceType source) { + if (!source.isValid()) { + this.unparsed = true; + } + this.source = source; + } + + public CreateTableRequestDataAttributes tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * The name of the reference table. + * + * @return tableName + */ + @JsonProperty(JSON_PROPERTY_TABLE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public CreateTableRequestDataAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public CreateTableRequestDataAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * The tags of the reference table. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateTableRequestDataAttributes + */ + @JsonAnySetter + public CreateTableRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateTableRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequestDataAttributes createTableRequestDataAttributes = + (CreateTableRequestDataAttributes) o; + return Objects.equals(this.description, createTableRequestDataAttributes.description) + && Objects.equals(this.fileMetadata, createTableRequestDataAttributes.fileMetadata) + && Objects.equals(this.schema, createTableRequestDataAttributes.schema) + && Objects.equals(this.source, createTableRequestDataAttributes.source) + && Objects.equals(this.tableName, createTableRequestDataAttributes.tableName) + && Objects.equals(this.tags, createTableRequestDataAttributes.tags) + && Objects.equals( + this.additionalProperties, createTableRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + description, fileMetadata, schema, source, tableName, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableRequestDataAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" fileMetadata: ").append(toIndentedString(fileMetadata)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" tableName: ").append(toIndentedString(tableName)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadata.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadata.java new file mode 100644 index 00000000000..fc56f6237bb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadata.java @@ -0,0 +1,340 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = + CreateTableRequestDataAttributesFileMetadata + .CreateTableRequestDataAttributesFileMetadataDeserializer.class) +@JsonSerialize( + using = + CreateTableRequestDataAttributesFileMetadata + .CreateTableRequestDataAttributesFileMetadataSerializer.class) +public class CreateTableRequestDataAttributesFileMetadata extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(CreateTableRequestDataAttributesFileMetadata.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class CreateTableRequestDataAttributesFileMetadataSerializer + extends StdSerializer { + public CreateTableRequestDataAttributesFileMetadataSerializer( + Class t) { + super(t); + } + + public CreateTableRequestDataAttributesFileMetadataSerializer() { + this(null); + } + + @Override + public void serialize( + CreateTableRequestDataAttributesFileMetadata value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class CreateTableRequestDataAttributesFileMetadataDeserializer + extends StdDeserializer { + public CreateTableRequestDataAttributesFileMetadataDeserializer() { + this(CreateTableRequestDataAttributesFileMetadata.class); + } + + public CreateTableRequestDataAttributesFileMetadataDeserializer(Class vc) { + super(vc); + } + + @Override + public CreateTableRequestDataAttributesFileMetadata deserialize( + JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize CreateTableRequestDataAttributesFileMetadataCloudStorage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Integer.class) + || CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Long.class) + || CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Float.class) + || CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Double.class) + || CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Boolean.class) + || CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals( + String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals( + Integer.class) + || CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Float.class) + || CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals( + Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CreateTableRequestDataAttributesFileMetadataCloudStorage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(CreateTableRequestDataAttributesFileMetadataCloudStorage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CreateTableRequestDataAttributesFileMetadataCloudStorage) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema" + + " 'CreateTableRequestDataAttributesFileMetadataCloudStorage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'CreateTableRequestDataAttributesFileMetadataCloudStorage'", + e); + } + + // deserialize CreateTableRequestDataAttributesFileMetadataLocalFile + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals(Integer.class) + || CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals(Long.class) + || CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals(Float.class) + || CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals(Double.class) + || CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals(Boolean.class) + || CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals(Integer.class) + || CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals(Float.class) + || CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CreateTableRequestDataAttributesFileMetadataLocalFile.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(CreateTableRequestDataAttributesFileMetadataLocalFile.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CreateTableRequestDataAttributesFileMetadataLocalFile) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'CreateTableRequestDataAttributesFileMetadataLocalFile'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'CreateTableRequestDataAttributesFileMetadataLocalFile'", + e); + } + + CreateTableRequestDataAttributesFileMetadata ret = + new CreateTableRequestDataAttributesFileMetadata(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public CreateTableRequestDataAttributesFileMetadata getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "CreateTableRequestDataAttributesFileMetadata cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public CreateTableRequestDataAttributesFileMetadata() { + super("oneOf", Boolean.FALSE); + } + + public CreateTableRequestDataAttributesFileMetadata( + CreateTableRequestDataAttributesFileMetadataCloudStorage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public CreateTableRequestDataAttributesFileMetadata( + CreateTableRequestDataAttributesFileMetadataLocalFile o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "CreateTableRequestDataAttributesFileMetadataCloudStorage", + new GenericType() {}); + schemas.put( + "CreateTableRequestDataAttributesFileMetadataLocalFile", + new GenericType() {}); + JSON.registerDescendants( + CreateTableRequestDataAttributesFileMetadata.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return CreateTableRequestDataAttributesFileMetadata.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: CreateTableRequestDataAttributesFileMetadataCloudStorage, + * CreateTableRequestDataAttributesFileMetadataLocalFile + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + CreateTableRequestDataAttributesFileMetadataCloudStorage.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + CreateTableRequestDataAttributesFileMetadataLocalFile.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be CreateTableRequestDataAttributesFileMetadataCloudStorage," + + " CreateTableRequestDataAttributesFileMetadataLocalFile"); + } + + /** + * Get the actual instance, which can be the following: + * CreateTableRequestDataAttributesFileMetadataCloudStorage, + * CreateTableRequestDataAttributesFileMetadataLocalFile + * + * @return The actual instance (CreateTableRequestDataAttributesFileMetadataCloudStorage, + * CreateTableRequestDataAttributesFileMetadataLocalFile) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateTableRequestDataAttributesFileMetadataCloudStorage`. If the + * actual instance is not `CreateTableRequestDataAttributesFileMetadataCloudStorage`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `CreateTableRequestDataAttributesFileMetadataCloudStorage` + * @throws ClassCastException if the instance is not + * `CreateTableRequestDataAttributesFileMetadataCloudStorage` + */ + public CreateTableRequestDataAttributesFileMetadataCloudStorage + getCreateTableRequestDataAttributesFileMetadataCloudStorage() throws ClassCastException { + return (CreateTableRequestDataAttributesFileMetadataCloudStorage) super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateTableRequestDataAttributesFileMetadataLocalFile`. If the + * actual instance is not `CreateTableRequestDataAttributesFileMetadataLocalFile`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `CreateTableRequestDataAttributesFileMetadataLocalFile` + * @throws ClassCastException if the instance is not + * `CreateTableRequestDataAttributesFileMetadataLocalFile` + */ + public CreateTableRequestDataAttributesFileMetadataLocalFile + getCreateTableRequestDataAttributesFileMetadataLocalFile() throws ClassCastException { + return (CreateTableRequestDataAttributesFileMetadataLocalFile) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataCloudStorage.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataCloudStorage.java new file mode 100644 index 00000000000..ac0113371e8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataCloudStorage.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Cloud storage file metadata for create requests. Both access_details and sync_enabled are + * required. + */ +@JsonPropertyOrder({ + CreateTableRequestDataAttributesFileMetadataCloudStorage.JSON_PROPERTY_ACCESS_DETAILS, + CreateTableRequestDataAttributesFileMetadataCloudStorage.JSON_PROPERTY_SYNC_ENABLED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateTableRequestDataAttributesFileMetadataCloudStorage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCESS_DETAILS = "access_details"; + private CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails accessDetails; + + public static final String JSON_PROPERTY_SYNC_ENABLED = "sync_enabled"; + private Boolean syncEnabled; + + public CreateTableRequestDataAttributesFileMetadataCloudStorage() {} + + @JsonCreator + public CreateTableRequestDataAttributesFileMetadataCloudStorage( + @JsonProperty(required = true, value = JSON_PROPERTY_ACCESS_DETAILS) + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails accessDetails, + @JsonProperty(required = true, value = JSON_PROPERTY_SYNC_ENABLED) Boolean syncEnabled) { + this.accessDetails = accessDetails; + this.unparsed |= accessDetails.unparsed; + this.syncEnabled = syncEnabled; + } + + public CreateTableRequestDataAttributesFileMetadataCloudStorage accessDetails( + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails accessDetails) { + this.accessDetails = accessDetails; + this.unparsed |= accessDetails.unparsed; + return this; + } + + /** + * The definition of CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails + * object. + * + * @return accessDetails + */ + @JsonProperty(JSON_PROPERTY_ACCESS_DETAILS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails getAccessDetails() { + return accessDetails; + } + + public void setAccessDetails( + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails accessDetails) { + this.accessDetails = accessDetails; + } + + public CreateTableRequestDataAttributesFileMetadataCloudStorage syncEnabled(Boolean syncEnabled) { + this.syncEnabled = syncEnabled; + return this; + } + + /** + * Whether this table is synced automatically. + * + * @return syncEnabled + */ + @JsonProperty(JSON_PROPERTY_SYNC_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getSyncEnabled() { + return syncEnabled; + } + + public void setSyncEnabled(Boolean syncEnabled) { + this.syncEnabled = syncEnabled; + } + + /** + * Return true if this CreateTableRequestDataAttributesFileMetadataCloudStorage object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequestDataAttributesFileMetadataCloudStorage + createTableRequestDataAttributesFileMetadataCloudStorage = + (CreateTableRequestDataAttributesFileMetadataCloudStorage) o; + return Objects.equals( + this.accessDetails, + createTableRequestDataAttributesFileMetadataCloudStorage.accessDetails) + && Objects.equals( + this.syncEnabled, createTableRequestDataAttributesFileMetadataCloudStorage.syncEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(accessDetails, syncEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableRequestDataAttributesFileMetadataCloudStorage {\n"); + sb.append(" accessDetails: ").append(toIndentedString(accessDetails)).append("\n"); + sb.append(" syncEnabled: ").append(toIndentedString(syncEnabled)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataLocalFile.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataLocalFile.java new file mode 100644 index 00000000000..5b98835923a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataLocalFile.java @@ -0,0 +1,94 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Local file metadata for create requests using upload ID. */ +@JsonPropertyOrder({CreateTableRequestDataAttributesFileMetadataLocalFile.JSON_PROPERTY_UPLOAD_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateTableRequestDataAttributesFileMetadataLocalFile { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_UPLOAD_ID = "upload_id"; + private String uploadId; + + public CreateTableRequestDataAttributesFileMetadataLocalFile() {} + + @JsonCreator + public CreateTableRequestDataAttributesFileMetadataLocalFile( + @JsonProperty(required = true, value = JSON_PROPERTY_UPLOAD_ID) String uploadId) { + this.uploadId = uploadId; + } + + public CreateTableRequestDataAttributesFileMetadataLocalFile uploadId(String uploadId) { + this.uploadId = uploadId; + return this; + } + + /** + * The upload ID. + * + * @return uploadId + */ + @JsonProperty(JSON_PROPERTY_UPLOAD_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUploadId() { + return uploadId; + } + + public void setUploadId(String uploadId) { + this.uploadId = uploadId; + } + + /** + * Return true if this CreateTableRequestDataAttributesFileMetadataLocalFile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequestDataAttributesFileMetadataLocalFile + createTableRequestDataAttributesFileMetadataLocalFile = + (CreateTableRequestDataAttributesFileMetadataLocalFile) o; + return Objects.equals( + this.uploadId, createTableRequestDataAttributesFileMetadataLocalFile.uploadId); + } + + @Override + public int hashCode() { + return Objects.hash(uploadId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableRequestDataAttributesFileMetadataLocalFile {\n"); + sb.append(" uploadId: ").append(toIndentedString(uploadId)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails.java new file mode 100644 index 00000000000..b6b82eb4f7d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails.java @@ -0,0 +1,221 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails + * object. + */ +@JsonPropertyOrder({ + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails.JSON_PROPERTY_AWS_DETAIL, + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails.JSON_PROPERTY_AZURE_DETAIL, + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails.JSON_PROPERTY_GCP_DETAIL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AWS_DETAIL = "aws_detail"; + private CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsDetail; + + public static final String JSON_PROPERTY_AZURE_DETAIL = "azure_detail"; + private CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureDetail; + + public static final String JSON_PROPERTY_GCP_DETAIL = "gcp_detail"; + private CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpDetail; + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails awsDetail( + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsDetail) { + this.awsDetail = awsDetail; + this.unparsed |= awsDetail.unparsed; + return this; + } + + /** + * The definition of CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + * object. + * + * @return awsDetail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail getAwsDetail() { + return awsDetail; + } + + public void setAwsDetail( + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsDetail) { + this.awsDetail = awsDetail; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails azureDetail( + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureDetail) { + this.azureDetail = azureDetail; + this.unparsed |= azureDetail.unparsed; + return this; + } + + /** + * The definition of + * CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail object. + * + * @return azureDetail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + getAzureDetail() { + return azureDetail; + } + + public void setAzureDetail( + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureDetail) { + this.azureDetail = azureDetail; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails gcpDetail( + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpDetail) { + this.gcpDetail = gcpDetail; + this.unparsed |= gcpDetail.unparsed; + return this; + } + + /** + * The definition of CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + * object. + * + * @return gcpDetail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCP_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail getGcpDetail() { + return gcpDetail; + } + + public void setGcpDetail( + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpDetail) { + this.gcpDetail = gcpDetail; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails + */ + @JsonAnySetter + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails object is + * equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails + createTableRequestDataAttributesFileMetadataOneOfAccessDetails = + (CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails) o; + return Objects.equals( + this.awsDetail, + createTableRequestDataAttributesFileMetadataOneOfAccessDetails.awsDetail) + && Objects.equals( + this.azureDetail, + createTableRequestDataAttributesFileMetadataOneOfAccessDetails.azureDetail) + && Objects.equals( + this.gcpDetail, + createTableRequestDataAttributesFileMetadataOneOfAccessDetails.gcpDetail) + && Objects.equals( + this.additionalProperties, + createTableRequestDataAttributesFileMetadataOneOfAccessDetails.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(awsDetail, azureDetail, gcpDetail, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails {\n"); + sb.append(" awsDetail: ").append(toIndentedString(awsDetail)).append("\n"); + sb.append(" azureDetail: ").append(toIndentedString(azureDetail)).append("\n"); + sb.append(" gcpDetail: ").append(toIndentedString(gcpDetail)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java new file mode 100644 index 00000000000..95f438d7533 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java @@ -0,0 +1,224 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + * object. + */ +@JsonPropertyOrder({ + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + .JSON_PROPERTY_AWS_ACCOUNT_ID, + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + .JSON_PROPERTY_AWS_BUCKET_NAME, + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.JSON_PROPERTY_FILE_PATH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AWS_ACCOUNT_ID = "aws_account_id"; + private String awsAccountId; + + public static final String JSON_PROPERTY_AWS_BUCKET_NAME = "aws_bucket_name"; + private String awsBucketName; + + public static final String JSON_PROPERTY_FILE_PATH = "file_path"; + private String filePath; + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail() {} + + @JsonCreator + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail( + @JsonProperty(required = true, value = JSON_PROPERTY_AWS_ACCOUNT_ID) String awsAccountId, + @JsonProperty(required = true, value = JSON_PROPERTY_AWS_BUCKET_NAME) String awsBucketName, + @JsonProperty(required = true, value = JSON_PROPERTY_FILE_PATH) String filePath) { + this.awsAccountId = awsAccountId; + this.awsBucketName = awsBucketName; + this.filePath = filePath; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsAccountId( + String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * The ID of the AWS account. + * + * @return awsAccountId + */ + @JsonProperty(JSON_PROPERTY_AWS_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAwsAccountId() { + return awsAccountId; + } + + public void setAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsBucketName( + String awsBucketName) { + this.awsBucketName = awsBucketName; + return this; + } + + /** + * The name of the AWS bucket. + * + * @return awsBucketName + */ + @JsonProperty(JSON_PROPERTY_AWS_BUCKET_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAwsBucketName() { + return awsBucketName; + } + + public void setAwsBucketName(String awsBucketName) { + this.awsBucketName = awsBucketName; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail filePath( + String filePath) { + this.filePath = filePath; + return this; + } + + /** + * The relative file path from the S3 bucket root to the CSV file. + * + * @return filePath + */ + @JsonProperty(JSON_PROPERTY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + */ + @JsonAnySetter + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + * object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail = + (CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail) o; + return Objects.equals( + this.awsAccountId, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.awsAccountId) + && Objects.equals( + this.awsBucketName, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.awsBucketName) + && Objects.equals( + this.filePath, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.filePath) + && Objects.equals( + this.additionalProperties, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(awsAccountId, awsBucketName, filePath, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail {\n"); + sb.append(" awsAccountId: ").append(toIndentedString(awsAccountId)).append("\n"); + sb.append(" awsBucketName: ").append(toIndentedString(awsBucketName)).append("\n"); + sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java new file mode 100644 index 00000000000..75b7d9fad5a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java @@ -0,0 +1,302 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + * object. + */ +@JsonPropertyOrder({ + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_CLIENT_ID, + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_CONTAINER_NAME, + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_STORAGE_ACCOUNT_NAME, + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_TENANT_ID, + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.JSON_PROPERTY_FILE_PATH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AZURE_CLIENT_ID = "azure_client_id"; + private String azureClientId; + + public static final String JSON_PROPERTY_AZURE_CONTAINER_NAME = "azure_container_name"; + private String azureContainerName; + + public static final String JSON_PROPERTY_AZURE_STORAGE_ACCOUNT_NAME = + "azure_storage_account_name"; + private String azureStorageAccountName; + + public static final String JSON_PROPERTY_AZURE_TENANT_ID = "azure_tenant_id"; + private String azureTenantId; + + public static final String JSON_PROPERTY_FILE_PATH = "file_path"; + private String filePath; + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail() {} + + @JsonCreator + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail( + @JsonProperty(required = true, value = JSON_PROPERTY_AZURE_CLIENT_ID) String azureClientId, + @JsonProperty(required = true, value = JSON_PROPERTY_AZURE_CONTAINER_NAME) + String azureContainerName, + @JsonProperty(required = true, value = JSON_PROPERTY_AZURE_STORAGE_ACCOUNT_NAME) + String azureStorageAccountName, + @JsonProperty(required = true, value = JSON_PROPERTY_AZURE_TENANT_ID) String azureTenantId, + @JsonProperty(required = true, value = JSON_PROPERTY_FILE_PATH) String filePath) { + this.azureClientId = azureClientId; + this.azureContainerName = azureContainerName; + this.azureStorageAccountName = azureStorageAccountName; + this.azureTenantId = azureTenantId; + this.filePath = filePath; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureClientId( + String azureClientId) { + this.azureClientId = azureClientId; + return this; + } + + /** + * The Azure client ID. + * + * @return azureClientId + */ + @JsonProperty(JSON_PROPERTY_AZURE_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAzureClientId() { + return azureClientId; + } + + public void setAzureClientId(String azureClientId) { + this.azureClientId = azureClientId; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + azureContainerName(String azureContainerName) { + this.azureContainerName = azureContainerName; + return this; + } + + /** + * The name of the Azure container. + * + * @return azureContainerName + */ + @JsonProperty(JSON_PROPERTY_AZURE_CONTAINER_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAzureContainerName() { + return azureContainerName; + } + + public void setAzureContainerName(String azureContainerName) { + this.azureContainerName = azureContainerName; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + azureStorageAccountName(String azureStorageAccountName) { + this.azureStorageAccountName = azureStorageAccountName; + return this; + } + + /** + * The name of the Azure storage account. + * + * @return azureStorageAccountName + */ + @JsonProperty(JSON_PROPERTY_AZURE_STORAGE_ACCOUNT_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAzureStorageAccountName() { + return azureStorageAccountName; + } + + public void setAzureStorageAccountName(String azureStorageAccountName) { + this.azureStorageAccountName = azureStorageAccountName; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureTenantId( + String azureTenantId) { + this.azureTenantId = azureTenantId; + return this; + } + + /** + * The ID of the Azure tenant. + * + * @return azureTenantId + */ + @JsonProperty(JSON_PROPERTY_AZURE_TENANT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAzureTenantId() { + return azureTenantId; + } + + public void setAzureTenantId(String azureTenantId) { + this.azureTenantId = azureTenantId; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail filePath( + String filePath) { + this.filePath = filePath; + return this; + } + + /** + * The relative file path from the Azure container root to the CSV file. + * + * @return filePath + */ + @JsonProperty(JSON_PROPERTY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + */ + @JsonAnySetter + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + * object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail = + (CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail) o; + return Objects.equals( + this.azureClientId, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.azureClientId) + && Objects.equals( + this.azureContainerName, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .azureContainerName) + && Objects.equals( + this.azureStorageAccountName, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .azureStorageAccountName) + && Objects.equals( + this.azureTenantId, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.azureTenantId) + && Objects.equals( + this.filePath, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.filePath) + && Objects.equals( + this.additionalProperties, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + azureClientId, + azureContainerName, + azureStorageAccountName, + azureTenantId, + filePath, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail {\n"); + sb.append(" azureClientId: ").append(toIndentedString(azureClientId)).append("\n"); + sb.append(" azureContainerName: ").append(toIndentedString(azureContainerName)).append("\n"); + sb.append(" azureStorageAccountName: ") + .append(toIndentedString(azureStorageAccountName)) + .append("\n"); + sb.append(" azureTenantId: ").append(toIndentedString(azureTenantId)).append("\n"); + sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java new file mode 100644 index 00000000000..a6086260def --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java @@ -0,0 +1,261 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + * object. + */ +@JsonPropertyOrder({ + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.JSON_PROPERTY_FILE_PATH, + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .JSON_PROPERTY_GCP_BUCKET_NAME, + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .JSON_PROPERTY_GCP_PROJECT_ID, + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .JSON_PROPERTY_GCP_SERVICE_ACCOUNT_EMAIL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FILE_PATH = "file_path"; + private String filePath; + + public static final String JSON_PROPERTY_GCP_BUCKET_NAME = "gcp_bucket_name"; + private String gcpBucketName; + + public static final String JSON_PROPERTY_GCP_PROJECT_ID = "gcp_project_id"; + private String gcpProjectId; + + public static final String JSON_PROPERTY_GCP_SERVICE_ACCOUNT_EMAIL = "gcp_service_account_email"; + private String gcpServiceAccountEmail; + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail() {} + + @JsonCreator + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail( + @JsonProperty(required = true, value = JSON_PROPERTY_FILE_PATH) String filePath, + @JsonProperty(required = true, value = JSON_PROPERTY_GCP_BUCKET_NAME) String gcpBucketName, + @JsonProperty(required = true, value = JSON_PROPERTY_GCP_PROJECT_ID) String gcpProjectId, + @JsonProperty(required = true, value = JSON_PROPERTY_GCP_SERVICE_ACCOUNT_EMAIL) + String gcpServiceAccountEmail) { + this.filePath = filePath; + this.gcpBucketName = gcpBucketName; + this.gcpProjectId = gcpProjectId; + this.gcpServiceAccountEmail = gcpServiceAccountEmail; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail filePath( + String filePath) { + this.filePath = filePath; + return this; + } + + /** + * The relative file path from the GCS bucket root to the CSV file. + * + * @return filePath + */ + @JsonProperty(JSON_PROPERTY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpBucketName( + String gcpBucketName) { + this.gcpBucketName = gcpBucketName; + return this; + } + + /** + * The name of the GCP bucket. + * + * @return gcpBucketName + */ + @JsonProperty(JSON_PROPERTY_GCP_BUCKET_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGcpBucketName() { + return gcpBucketName; + } + + public void setGcpBucketName(String gcpBucketName) { + this.gcpBucketName = gcpBucketName; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpProjectId( + String gcpProjectId) { + this.gcpProjectId = gcpProjectId; + return this; + } + + /** + * The ID of the GCP project. + * + * @return gcpProjectId + */ + @JsonProperty(JSON_PROPERTY_GCP_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGcpProjectId() { + return gcpProjectId; + } + + public void setGcpProjectId(String gcpProjectId) { + this.gcpProjectId = gcpProjectId; + } + + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + gcpServiceAccountEmail(String gcpServiceAccountEmail) { + this.gcpServiceAccountEmail = gcpServiceAccountEmail; + return this; + } + + /** + * The email of the GCP service account. + * + * @return gcpServiceAccountEmail + */ + @JsonProperty(JSON_PROPERTY_GCP_SERVICE_ACCOUNT_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGcpServiceAccountEmail() { + return gcpServiceAccountEmail; + } + + public void setGcpServiceAccountEmail(String gcpServiceAccountEmail) { + this.gcpServiceAccountEmail = gcpServiceAccountEmail; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + */ + @JsonAnySetter + public CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + * object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail = + (CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail) o; + return Objects.equals( + this.filePath, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.filePath) + && Objects.equals( + this.gcpBucketName, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.gcpBucketName) + && Objects.equals( + this.gcpProjectId, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.gcpProjectId) + && Objects.equals( + this.gcpServiceAccountEmail, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .gcpServiceAccountEmail) + && Objects.equals( + this.additionalProperties, + createTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + filePath, gcpBucketName, gcpProjectId, gcpServiceAccountEmail, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail {\n"); + sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); + sb.append(" gcpBucketName: ").append(toIndentedString(gcpBucketName)).append("\n"); + sb.append(" gcpProjectId: ").append(toIndentedString(gcpProjectId)).append("\n"); + sb.append(" gcpServiceAccountEmail: ") + .append(toIndentedString(gcpServiceAccountEmail)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesSchema.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesSchema.java new file mode 100644 index 00000000000..38d0e49dad5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesSchema.java @@ -0,0 +1,195 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of CreateTableRequestDataAttributesSchema object. */ +@JsonPropertyOrder({ + CreateTableRequestDataAttributesSchema.JSON_PROPERTY_FIELDS, + CreateTableRequestDataAttributesSchema.JSON_PROPERTY_PRIMARY_KEYS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateTableRequestDataAttributesSchema { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIELDS = "fields"; + private List fields = new ArrayList<>(); + + public static final String JSON_PROPERTY_PRIMARY_KEYS = "primary_keys"; + private List primaryKeys = new ArrayList<>(); + + public CreateTableRequestDataAttributesSchema() {} + + @JsonCreator + public CreateTableRequestDataAttributesSchema( + @JsonProperty(required = true, value = JSON_PROPERTY_FIELDS) + List fields, + @JsonProperty(required = true, value = JSON_PROPERTY_PRIMARY_KEYS) List primaryKeys) { + this.fields = fields; + this.primaryKeys = primaryKeys; + } + + public CreateTableRequestDataAttributesSchema fields( + List fields) { + this.fields = fields; + for (CreateTableRequestDataAttributesSchemaFieldsItems item : fields) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateTableRequestDataAttributesSchema addFieldsItem( + CreateTableRequestDataAttributesSchemaFieldsItems fieldsItem) { + this.fields.add(fieldsItem); + this.unparsed |= fieldsItem.unparsed; + return this; + } + + /** + * The schema fields. + * + * @return fields + */ + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFields() { + return fields; + } + + public void setFields(List fields) { + this.fields = fields; + } + + public CreateTableRequestDataAttributesSchema primaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + return this; + } + + public CreateTableRequestDataAttributesSchema addPrimaryKeysItem(String primaryKeysItem) { + this.primaryKeys.add(primaryKeysItem); + return this; + } + + /** + * List of field names that serve as primary keys for the table. Currently only 1 primary key is + * supported, and it is used as an ID to retrieve rows. + * + * @return primaryKeys + */ + @JsonProperty(JSON_PROPERTY_PRIMARY_KEYS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPrimaryKeys() { + return primaryKeys; + } + + public void setPrimaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateTableRequestDataAttributesSchema + */ + @JsonAnySetter + public CreateTableRequestDataAttributesSchema putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateTableRequestDataAttributesSchema object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequestDataAttributesSchema createTableRequestDataAttributesSchema = + (CreateTableRequestDataAttributesSchema) o; + return Objects.equals(this.fields, createTableRequestDataAttributesSchema.fields) + && Objects.equals(this.primaryKeys, createTableRequestDataAttributesSchema.primaryKeys) + && Objects.equals( + this.additionalProperties, createTableRequestDataAttributesSchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, primaryKeys, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableRequestDataAttributesSchema {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" primaryKeys: ").append(toIndentedString(primaryKeys)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesSchemaFieldsItems.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesSchemaFieldsItems.java new file mode 100644 index 00000000000..f732e859bd3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataAttributesSchemaFieldsItems.java @@ -0,0 +1,185 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of CreateTableRequestDataAttributesSchemaFieldsItems object. */ +@JsonPropertyOrder({ + CreateTableRequestDataAttributesSchemaFieldsItems.JSON_PROPERTY_NAME, + CreateTableRequestDataAttributesSchemaFieldsItems.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateTableRequestDataAttributesSchemaFieldsItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ReferenceTableSchemaFieldType type; + + public CreateTableRequestDataAttributesSchemaFieldsItems() {} + + @JsonCreator + public CreateTableRequestDataAttributesSchemaFieldsItems( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ReferenceTableSchemaFieldType type) { + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateTableRequestDataAttributesSchemaFieldsItems name(String name) { + this.name = name; + return this; + } + + /** + * The field name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateTableRequestDataAttributesSchemaFieldsItems type( + ReferenceTableSchemaFieldType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The field type for reference table schema fields. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReferenceTableSchemaFieldType getType() { + return type; + } + + public void setType(ReferenceTableSchemaFieldType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateTableRequestDataAttributesSchemaFieldsItems + */ + @JsonAnySetter + public CreateTableRequestDataAttributesSchemaFieldsItems putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateTableRequestDataAttributesSchemaFieldsItems object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequestDataAttributesSchemaFieldsItems + createTableRequestDataAttributesSchemaFieldsItems = + (CreateTableRequestDataAttributesSchemaFieldsItems) o; + return Objects.equals(this.name, createTableRequestDataAttributesSchemaFieldsItems.name) + && Objects.equals(this.type, createTableRequestDataAttributesSchemaFieldsItems.type) + && Objects.equals( + this.additionalProperties, + createTableRequestDataAttributesSchemaFieldsItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableRequestDataAttributesSchemaFieldsItems {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataType.java new file mode 100644 index 00000000000..95c91bf8d46 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateTableRequestDataType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Reference table resource type. */ +@JsonSerialize(using = CreateTableRequestDataType.CreateTableRequestDataTypeSerializer.class) +public class CreateTableRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("reference_table")); + + public static final CreateTableRequestDataType REFERENCE_TABLE = + new CreateTableRequestDataType("reference_table"); + + CreateTableRequestDataType(String value) { + super(value, allowedValues); + } + + public static class CreateTableRequestDataTypeSerializer + extends StdSerializer { + public CreateTableRequestDataTypeSerializer(Class t) { + super(t); + } + + public CreateTableRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CreateTableRequestDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CreateTableRequestDataType fromValue(String value) { + return new CreateTableRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequest.java new file mode 100644 index 00000000000..1a3302327d0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequest.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of CreateUploadRequest object. */ +@JsonPropertyOrder({CreateUploadRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateUploadRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateUploadRequestData data; + + public CreateUploadRequest data(CreateUploadRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of CreateUploadRequestData object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateUploadRequestData getData() { + return data; + } + + public void setData(CreateUploadRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateUploadRequest + */ + @JsonAnySetter + public CreateUploadRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateUploadRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUploadRequest createUploadRequest = (CreateUploadRequest) o; + return Objects.equals(this.data, createUploadRequest.data) + && Objects.equals(this.additionalProperties, createUploadRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUploadRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestData.java new file mode 100644 index 00000000000..e1db3592469 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestData.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of CreateUploadRequestData object. */ +@JsonPropertyOrder({ + CreateUploadRequestData.JSON_PROPERTY_ATTRIBUTES, + CreateUploadRequestData.JSON_PROPERTY_ID, + CreateUploadRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateUploadRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateUploadRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CreateUploadRequestDataType type = CreateUploadRequestDataType.UPLOAD; + + public CreateUploadRequestData() {} + + @JsonCreator + public CreateUploadRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CreateUploadRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateUploadRequestData attributes(CreateUploadRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of CreateUploadRequestDataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateUploadRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateUploadRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateUploadRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the upload. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CreateUploadRequestData type(CreateUploadRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Upload resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateUploadRequestDataType getType() { + return type; + } + + public void setType(CreateUploadRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateUploadRequestData + */ + @JsonAnySetter + public CreateUploadRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateUploadRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUploadRequestData createUploadRequestData = (CreateUploadRequestData) o; + return Objects.equals(this.attributes, createUploadRequestData.attributes) + && Objects.equals(this.id, createUploadRequestData.id) + && Objects.equals(this.type, createUploadRequestData.type) + && Objects.equals(this.additionalProperties, createUploadRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUploadRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestDataAttributes.java new file mode 100644 index 00000000000..b757c7ebc4d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestDataAttributes.java @@ -0,0 +1,240 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of CreateUploadRequestDataAttributes object. */ +@JsonPropertyOrder({ + CreateUploadRequestDataAttributes.JSON_PROPERTY_HEADERS, + CreateUploadRequestDataAttributes.JSON_PROPERTY_PART_COUNT, + CreateUploadRequestDataAttributes.JSON_PROPERTY_PART_SIZE, + CreateUploadRequestDataAttributes.JSON_PROPERTY_TABLE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateUploadRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HEADERS = "headers"; + private List headers = new ArrayList<>(); + + public static final String JSON_PROPERTY_PART_COUNT = "part_count"; + private Integer partCount; + + public static final String JSON_PROPERTY_PART_SIZE = "part_size"; + private Long partSize; + + public static final String JSON_PROPERTY_TABLE_NAME = "table_name"; + private String tableName; + + public CreateUploadRequestDataAttributes() {} + + @JsonCreator + public CreateUploadRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_HEADERS) List headers, + @JsonProperty(required = true, value = JSON_PROPERTY_PART_COUNT) Integer partCount, + @JsonProperty(required = true, value = JSON_PROPERTY_PART_SIZE) Long partSize, + @JsonProperty(required = true, value = JSON_PROPERTY_TABLE_NAME) String tableName) { + this.headers = headers; + this.partCount = partCount; + this.partSize = partSize; + this.tableName = tableName; + } + + public CreateUploadRequestDataAttributes headers(List headers) { + this.headers = headers; + return this; + } + + public CreateUploadRequestDataAttributes addHeadersItem(String headersItem) { + this.headers.add(headersItem); + return this; + } + + /** + * The headers of the file to upload. + * + * @return headers + */ + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getHeaders() { + return headers; + } + + public void setHeaders(List headers) { + this.headers = headers; + } + + public CreateUploadRequestDataAttributes partCount(Integer partCount) { + this.partCount = partCount; + return this; + } + + /** + * The number of parts in the upload. maximum: 20 + * + * @return partCount + */ + @JsonProperty(JSON_PROPERTY_PART_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getPartCount() { + return partCount; + } + + public void setPartCount(Integer partCount) { + this.partCount = partCount; + } + + public CreateUploadRequestDataAttributes partSize(Long partSize) { + this.partSize = partSize; + return this; + } + + /** + * The size of each part in the upload in bytes. For multi-part 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. + * + * @return partSize + */ + @JsonProperty(JSON_PROPERTY_PART_SIZE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getPartSize() { + return partSize; + } + + public void setPartSize(Long partSize) { + this.partSize = partSize; + } + + public CreateUploadRequestDataAttributes tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * The name of the reference table. + * + * @return tableName + */ + @JsonProperty(JSON_PROPERTY_TABLE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateUploadRequestDataAttributes + */ + @JsonAnySetter + public CreateUploadRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateUploadRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUploadRequestDataAttributes createUploadRequestDataAttributes = + (CreateUploadRequestDataAttributes) o; + return Objects.equals(this.headers, createUploadRequestDataAttributes.headers) + && Objects.equals(this.partCount, createUploadRequestDataAttributes.partCount) + && Objects.equals(this.partSize, createUploadRequestDataAttributes.partSize) + && Objects.equals(this.tableName, createUploadRequestDataAttributes.tableName) + && Objects.equals( + this.additionalProperties, createUploadRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(headers, partCount, partSize, tableName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUploadRequestDataAttributes {\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" partCount: ").append(toIndentedString(partCount)).append("\n"); + sb.append(" partSize: ").append(toIndentedString(partSize)).append("\n"); + sb.append(" tableName: ").append(toIndentedString(tableName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestDataType.java new file mode 100644 index 00000000000..6c54ee0c514 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateUploadRequestDataType.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Upload resource type. */ +@JsonSerialize(using = CreateUploadRequestDataType.CreateUploadRequestDataTypeSerializer.class) +public class CreateUploadRequestDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("upload")); + + public static final CreateUploadRequestDataType UPLOAD = + new CreateUploadRequestDataType("upload"); + + CreateUploadRequestDataType(String value) { + super(value, allowedValues); + } + + public static class CreateUploadRequestDataTypeSerializer + extends StdSerializer { + public CreateUploadRequestDataTypeSerializer(Class t) { + super(t); + } + + public CreateUploadRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CreateUploadRequestDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CreateUploadRequestDataType fromValue(String value) { + return new CreateUploadRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponse.java b/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponse.java new file mode 100644 index 00000000000..9aed5c52ec0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponse.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of CreateUploadResponse object. */ +@JsonPropertyOrder({CreateUploadResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateUploadResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateUploadResponseData data; + + public CreateUploadResponse data(CreateUploadResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of CreateUploadResponseData object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateUploadResponseData getData() { + return data; + } + + public void setData(CreateUploadResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateUploadResponse + */ + @JsonAnySetter + public CreateUploadResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateUploadResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUploadResponse createUploadResponse = (CreateUploadResponse) o; + return Objects.equals(this.data, createUploadResponse.data) + && Objects.equals(this.additionalProperties, createUploadResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUploadResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseData.java b/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseData.java new file mode 100644 index 00000000000..57970320ce3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseData.java @@ -0,0 +1,206 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of CreateUploadResponseData object. */ +@JsonPropertyOrder({ + CreateUploadResponseData.JSON_PROPERTY_ATTRIBUTES, + CreateUploadResponseData.JSON_PROPERTY_ID, + CreateUploadResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateUploadResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateUploadResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CreateUploadResponseDataType type = CreateUploadResponseDataType.UPLOAD; + + public CreateUploadResponseData() {} + + @JsonCreator + public CreateUploadResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CreateUploadResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateUploadResponseData attributes(CreateUploadResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of CreateUploadResponseDataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateUploadResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateUploadResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateUploadResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the upload. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CreateUploadResponseData type(CreateUploadResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Upload resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateUploadResponseDataType getType() { + return type; + } + + public void setType(CreateUploadResponseDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateUploadResponseData + */ + @JsonAnySetter + public CreateUploadResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateUploadResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUploadResponseData createUploadResponseData = (CreateUploadResponseData) o; + return Objects.equals(this.attributes, createUploadResponseData.attributes) + && Objects.equals(this.id, createUploadResponseData.id) + && Objects.equals(this.type, createUploadResponseData.type) + && Objects.equals(this.additionalProperties, createUploadResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUploadResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseDataAttributes.java new file mode 100644 index 00000000000..c1ee36512f4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseDataAttributes.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of CreateUploadResponseDataAttributes object. */ +@JsonPropertyOrder({CreateUploadResponseDataAttributes.JSON_PROPERTY_PART_URLS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateUploadResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PART_URLS = "part_urls"; + private List partUrls = null; + + public CreateUploadResponseDataAttributes partUrls(List partUrls) { + this.partUrls = partUrls; + return this; + } + + public CreateUploadResponseDataAttributes addPartUrlsItem(String partUrlsItem) { + if (this.partUrls == null) { + this.partUrls = new ArrayList<>(); + } + this.partUrls.add(partUrlsItem); + return this; + } + + /** + * The URLs of the parts in the upload. + * + * @return partUrls + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PART_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPartUrls() { + return partUrls; + } + + public void setPartUrls(List partUrls) { + this.partUrls = partUrls; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateUploadResponseDataAttributes + */ + @JsonAnySetter + public CreateUploadResponseDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateUploadResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUploadResponseDataAttributes createUploadResponseDataAttributes = + (CreateUploadResponseDataAttributes) o; + return Objects.equals(this.partUrls, createUploadResponseDataAttributes.partUrls) + && Objects.equals( + this.additionalProperties, createUploadResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(partUrls, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUploadResponseDataAttributes {\n"); + sb.append(" partUrls: ").append(toIndentedString(partUrls)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseDataType.java b/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseDataType.java new file mode 100644 index 00000000000..499903a9610 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateUploadResponseDataType.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Upload resource type. */ +@JsonSerialize(using = CreateUploadResponseDataType.CreateUploadResponseDataTypeSerializer.class) +public class CreateUploadResponseDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("upload")); + + public static final CreateUploadResponseDataType UPLOAD = + new CreateUploadResponseDataType("upload"); + + CreateUploadResponseDataType(String value) { + super(value, allowedValues); + } + + public static class CreateUploadResponseDataTypeSerializer + extends StdSerializer { + public CreateUploadResponseDataTypeSerializer(Class t) { + super(t); + } + + public CreateUploadResponseDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CreateUploadResponseDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CreateUploadResponseDataType fromValue(String value) { + return new CreateUploadResponseDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequest.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequest.java new file mode 100644 index 00000000000..dda2b1338ad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequest.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of PatchTableRequest object. */ +@JsonPropertyOrder({PatchTableRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchTableRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private PatchTableRequestData data; + + public PatchTableRequest data(PatchTableRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of PatchTableRequestData object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchTableRequestData getData() { + return data; + } + + public void setData(PatchTableRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchTableRequest + */ + @JsonAnySetter + public PatchTableRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PatchTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchTableRequest patchTableRequest = (PatchTableRequest) o; + return Objects.equals(this.data, patchTableRequest.data) + && Objects.equals(this.additionalProperties, patchTableRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchTableRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestData.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestData.java new file mode 100644 index 00000000000..8dd35a5c0f0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestData.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of PatchTableRequestData object. */ +@JsonPropertyOrder({ + PatchTableRequestData.JSON_PROPERTY_ATTRIBUTES, + PatchTableRequestData.JSON_PROPERTY_ID, + PatchTableRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchTableRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private PatchTableRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private PatchTableRequestDataType type = PatchTableRequestDataType.REFERENCE_TABLE; + + public PatchTableRequestData() {} + + @JsonCreator + public PatchTableRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) PatchTableRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public PatchTableRequestData attributes(PatchTableRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of PatchTableRequestDataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchTableRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(PatchTableRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public PatchTableRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the reference table. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public PatchTableRequestData type(PatchTableRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Reference table resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PatchTableRequestDataType getType() { + return type; + } + + public void setType(PatchTableRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchTableRequestData + */ + @JsonAnySetter + public PatchTableRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PatchTableRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchTableRequestData patchTableRequestData = (PatchTableRequestData) o; + return Objects.equals(this.attributes, patchTableRequestData.attributes) + && Objects.equals(this.id, patchTableRequestData.id) + && Objects.equals(this.type, patchTableRequestData.type) + && Objects.equals(this.additionalProperties, patchTableRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchTableRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributes.java new file mode 100644 index 00000000000..a47b71f5c79 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributes.java @@ -0,0 +1,260 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of PatchTableRequestDataAttributes object. */ +@JsonPropertyOrder({ + PatchTableRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, + PatchTableRequestDataAttributes.JSON_PROPERTY_FILE_METADATA, + PatchTableRequestDataAttributes.JSON_PROPERTY_SCHEMA, + PatchTableRequestDataAttributes.JSON_PROPERTY_SYNC_ENABLED, + PatchTableRequestDataAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchTableRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_FILE_METADATA = "file_metadata"; + private PatchTableRequestDataAttributesFileMetadata fileMetadata; + + public static final String JSON_PROPERTY_SCHEMA = "schema"; + private PatchTableRequestDataAttributesSchema schema; + + public static final String JSON_PROPERTY_SYNC_ENABLED = "sync_enabled"; + private Boolean syncEnabled; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public PatchTableRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the reference table. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public PatchTableRequestDataAttributes fileMetadata( + PatchTableRequestDataAttributesFileMetadata fileMetadata) { + this.fileMetadata = fileMetadata; + this.unparsed |= fileMetadata.unparsed; + return this; + } + + /** + * The definition of PatchTableRequestDataAttributesFileMetadata object. + * + * @return fileMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchTableRequestDataAttributesFileMetadata getFileMetadata() { + return fileMetadata; + } + + public void setFileMetadata(PatchTableRequestDataAttributesFileMetadata fileMetadata) { + this.fileMetadata = fileMetadata; + } + + public PatchTableRequestDataAttributes schema(PatchTableRequestDataAttributesSchema schema) { + this.schema = schema; + this.unparsed |= schema.unparsed; + return this; + } + + /** + * The definition of PatchTableRequestDataAttributesSchema object. + * + * @return schema + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchTableRequestDataAttributesSchema getSchema() { + return schema; + } + + public void setSchema(PatchTableRequestDataAttributesSchema schema) { + this.schema = schema; + } + + public PatchTableRequestDataAttributes syncEnabled(Boolean syncEnabled) { + this.syncEnabled = syncEnabled; + return this; + } + + /** + * Whether this table is synced automatically. + * + * @return syncEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYNC_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSyncEnabled() { + return syncEnabled; + } + + public void setSyncEnabled(Boolean syncEnabled) { + this.syncEnabled = syncEnabled; + } + + public PatchTableRequestDataAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public PatchTableRequestDataAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * The tags of the reference table. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchTableRequestDataAttributes + */ + @JsonAnySetter + public PatchTableRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PatchTableRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchTableRequestDataAttributes patchTableRequestDataAttributes = + (PatchTableRequestDataAttributes) o; + return Objects.equals(this.description, patchTableRequestDataAttributes.description) + && Objects.equals(this.fileMetadata, patchTableRequestDataAttributes.fileMetadata) + && Objects.equals(this.schema, patchTableRequestDataAttributes.schema) + && Objects.equals(this.syncEnabled, patchTableRequestDataAttributes.syncEnabled) + && Objects.equals(this.tags, patchTableRequestDataAttributes.tags) + && Objects.equals( + this.additionalProperties, patchTableRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, fileMetadata, schema, syncEnabled, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchTableRequestDataAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" fileMetadata: ").append(toIndentedString(fileMetadata)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" syncEnabled: ").append(toIndentedString(syncEnabled)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadata.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadata.java new file mode 100644 index 00000000000..4af5a8dac66 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadata.java @@ -0,0 +1,338 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = + PatchTableRequestDataAttributesFileMetadata + .PatchTableRequestDataAttributesFileMetadataDeserializer.class) +@JsonSerialize( + using = + PatchTableRequestDataAttributesFileMetadata + .PatchTableRequestDataAttributesFileMetadataSerializer.class) +public class PatchTableRequestDataAttributesFileMetadata extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(PatchTableRequestDataAttributesFileMetadata.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class PatchTableRequestDataAttributesFileMetadataSerializer + extends StdSerializer { + public PatchTableRequestDataAttributesFileMetadataSerializer( + Class t) { + super(t); + } + + public PatchTableRequestDataAttributesFileMetadataSerializer() { + this(null); + } + + @Override + public void serialize( + PatchTableRequestDataAttributesFileMetadata value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class PatchTableRequestDataAttributesFileMetadataDeserializer + extends StdDeserializer { + public PatchTableRequestDataAttributesFileMetadataDeserializer() { + this(PatchTableRequestDataAttributesFileMetadata.class); + } + + public PatchTableRequestDataAttributesFileMetadataDeserializer(Class vc) { + super(vc); + } + + @Override + public PatchTableRequestDataAttributesFileMetadata deserialize( + JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize PatchTableRequestDataAttributesFileMetadataCloudStorage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Integer.class) + || PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Long.class) + || PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Float.class) + || PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Double.class) + || PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Boolean.class) + || PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals( + Integer.class) + || PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Float.class) + || PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (PatchTableRequestDataAttributesFileMetadataCloudStorage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(PatchTableRequestDataAttributesFileMetadataCloudStorage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((PatchTableRequestDataAttributesFileMetadataCloudStorage) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema" + + " 'PatchTableRequestDataAttributesFileMetadataCloudStorage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'PatchTableRequestDataAttributesFileMetadataCloudStorage'", + e); + } + + // deserialize PatchTableRequestDataAttributesFileMetadataLocalFile + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals(Integer.class) + || PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals(Long.class) + || PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals(Float.class) + || PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals(Double.class) + || PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals(Boolean.class) + || PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals(Integer.class) + || PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals(Float.class) + || PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (PatchTableRequestDataAttributesFileMetadataLocalFile.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(PatchTableRequestDataAttributesFileMetadataLocalFile.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((PatchTableRequestDataAttributesFileMetadataLocalFile) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'PatchTableRequestDataAttributesFileMetadataLocalFile'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'PatchTableRequestDataAttributesFileMetadataLocalFile'", + e); + } + + PatchTableRequestDataAttributesFileMetadata ret = + new PatchTableRequestDataAttributesFileMetadata(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public PatchTableRequestDataAttributesFileMetadata getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "PatchTableRequestDataAttributesFileMetadata cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public PatchTableRequestDataAttributesFileMetadata() { + super("oneOf", Boolean.FALSE); + } + + public PatchTableRequestDataAttributesFileMetadata( + PatchTableRequestDataAttributesFileMetadataCloudStorage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public PatchTableRequestDataAttributesFileMetadata( + PatchTableRequestDataAttributesFileMetadataLocalFile o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "PatchTableRequestDataAttributesFileMetadataCloudStorage", + new GenericType() {}); + schemas.put( + "PatchTableRequestDataAttributesFileMetadataLocalFile", + new GenericType() {}); + JSON.registerDescendants( + PatchTableRequestDataAttributesFileMetadata.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return PatchTableRequestDataAttributesFileMetadata.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: PatchTableRequestDataAttributesFileMetadataCloudStorage, + * PatchTableRequestDataAttributesFileMetadataLocalFile + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + PatchTableRequestDataAttributesFileMetadataCloudStorage.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + PatchTableRequestDataAttributesFileMetadataLocalFile.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be PatchTableRequestDataAttributesFileMetadataCloudStorage," + + " PatchTableRequestDataAttributesFileMetadataLocalFile"); + } + + /** + * Get the actual instance, which can be the following: + * PatchTableRequestDataAttributesFileMetadataCloudStorage, + * PatchTableRequestDataAttributesFileMetadataLocalFile + * + * @return The actual instance (PatchTableRequestDataAttributesFileMetadataCloudStorage, + * PatchTableRequestDataAttributesFileMetadataLocalFile) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `PatchTableRequestDataAttributesFileMetadataCloudStorage`. If the + * actual instance is not `PatchTableRequestDataAttributesFileMetadataCloudStorage`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `PatchTableRequestDataAttributesFileMetadataCloudStorage` + * @throws ClassCastException if the instance is not + * `PatchTableRequestDataAttributesFileMetadataCloudStorage` + */ + public PatchTableRequestDataAttributesFileMetadataCloudStorage + getPatchTableRequestDataAttributesFileMetadataCloudStorage() throws ClassCastException { + return (PatchTableRequestDataAttributesFileMetadataCloudStorage) super.getActualInstance(); + } + + /** + * Get the actual instance of `PatchTableRequestDataAttributesFileMetadataLocalFile`. If the + * actual instance is not `PatchTableRequestDataAttributesFileMetadataLocalFile`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `PatchTableRequestDataAttributesFileMetadataLocalFile` + * @throws ClassCastException if the instance is not + * `PatchTableRequestDataAttributesFileMetadataLocalFile` + */ + public PatchTableRequestDataAttributesFileMetadataLocalFile + getPatchTableRequestDataAttributesFileMetadataLocalFile() throws ClassCastException { + return (PatchTableRequestDataAttributesFileMetadataLocalFile) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataCloudStorage.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataCloudStorage.java new file mode 100644 index 00000000000..92d3eb18baf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataCloudStorage.java @@ -0,0 +1,125 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Cloud storage file metadata for patch requests. Allows partial updates of access_details and/or + * sync_enabled. + */ +@JsonPropertyOrder({ + PatchTableRequestDataAttributesFileMetadataCloudStorage.JSON_PROPERTY_ACCESS_DETAILS, + PatchTableRequestDataAttributesFileMetadataCloudStorage.JSON_PROPERTY_SYNC_ENABLED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchTableRequestDataAttributesFileMetadataCloudStorage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCESS_DETAILS = "access_details"; + private PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails accessDetails; + + public static final String JSON_PROPERTY_SYNC_ENABLED = "sync_enabled"; + private Boolean syncEnabled; + + public PatchTableRequestDataAttributesFileMetadataCloudStorage accessDetails( + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails accessDetails) { + this.accessDetails = accessDetails; + this.unparsed |= accessDetails.unparsed; + return this; + } + + /** + * The definition of PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails + * object. + * + * @return accessDetails + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCESS_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails getAccessDetails() { + return accessDetails; + } + + public void setAccessDetails( + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails accessDetails) { + this.accessDetails = accessDetails; + } + + public PatchTableRequestDataAttributesFileMetadataCloudStorage syncEnabled(Boolean syncEnabled) { + this.syncEnabled = syncEnabled; + return this; + } + + /** + * Whether this table is synced automatically. + * + * @return syncEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYNC_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSyncEnabled() { + return syncEnabled; + } + + public void setSyncEnabled(Boolean syncEnabled) { + this.syncEnabled = syncEnabled; + } + + /** + * Return true if this PatchTableRequestDataAttributesFileMetadataCloudStorage object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchTableRequestDataAttributesFileMetadataCloudStorage + patchTableRequestDataAttributesFileMetadataCloudStorage = + (PatchTableRequestDataAttributesFileMetadataCloudStorage) o; + return Objects.equals( + this.accessDetails, + patchTableRequestDataAttributesFileMetadataCloudStorage.accessDetails) + && Objects.equals( + this.syncEnabled, patchTableRequestDataAttributesFileMetadataCloudStorage.syncEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(accessDetails, syncEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchTableRequestDataAttributesFileMetadataCloudStorage {\n"); + sb.append(" accessDetails: ").append(toIndentedString(accessDetails)).append("\n"); + sb.append(" syncEnabled: ").append(toIndentedString(syncEnabled)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataLocalFile.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataLocalFile.java new file mode 100644 index 00000000000..76672139e3f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataLocalFile.java @@ -0,0 +1,94 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Local file metadata for patch requests using upload ID. */ +@JsonPropertyOrder({PatchTableRequestDataAttributesFileMetadataLocalFile.JSON_PROPERTY_UPLOAD_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchTableRequestDataAttributesFileMetadataLocalFile { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_UPLOAD_ID = "upload_id"; + private String uploadId; + + public PatchTableRequestDataAttributesFileMetadataLocalFile() {} + + @JsonCreator + public PatchTableRequestDataAttributesFileMetadataLocalFile( + @JsonProperty(required = true, value = JSON_PROPERTY_UPLOAD_ID) String uploadId) { + this.uploadId = uploadId; + } + + public PatchTableRequestDataAttributesFileMetadataLocalFile uploadId(String uploadId) { + this.uploadId = uploadId; + return this; + } + + /** + * The upload ID. + * + * @return uploadId + */ + @JsonProperty(JSON_PROPERTY_UPLOAD_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUploadId() { + return uploadId; + } + + public void setUploadId(String uploadId) { + this.uploadId = uploadId; + } + + /** + * Return true if this PatchTableRequestDataAttributesFileMetadataLocalFile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchTableRequestDataAttributesFileMetadataLocalFile + patchTableRequestDataAttributesFileMetadataLocalFile = + (PatchTableRequestDataAttributesFileMetadataLocalFile) o; + return Objects.equals( + this.uploadId, patchTableRequestDataAttributesFileMetadataLocalFile.uploadId); + } + + @Override + public int hashCode() { + return Objects.hash(uploadId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchTableRequestDataAttributesFileMetadataLocalFile {\n"); + sb.append(" uploadId: ").append(toIndentedString(uploadId)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails.java new file mode 100644 index 00000000000..44cdc27ff2d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails.java @@ -0,0 +1,218 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails + * object. + */ +@JsonPropertyOrder({ + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails.JSON_PROPERTY_AWS_DETAIL, + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails.JSON_PROPERTY_AZURE_DETAIL, + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails.JSON_PROPERTY_GCP_DETAIL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AWS_DETAIL = "aws_detail"; + private PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsDetail; + + public static final String JSON_PROPERTY_AZURE_DETAIL = "azure_detail"; + private PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureDetail; + + public static final String JSON_PROPERTY_GCP_DETAIL = "gcp_detail"; + private PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpDetail; + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails awsDetail( + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsDetail) { + this.awsDetail = awsDetail; + this.unparsed |= awsDetail.unparsed; + return this; + } + + /** + * The definition of PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + * object. + * + * @return awsDetail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail getAwsDetail() { + return awsDetail; + } + + public void setAwsDetail( + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsDetail) { + this.awsDetail = awsDetail; + } + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails azureDetail( + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureDetail) { + this.azureDetail = azureDetail; + this.unparsed |= azureDetail.unparsed; + return this; + } + + /** + * The definition of + * PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail object. + * + * @return azureDetail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail getAzureDetail() { + return azureDetail; + } + + public void setAzureDetail( + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureDetail) { + this.azureDetail = azureDetail; + } + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails gcpDetail( + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpDetail) { + this.gcpDetail = gcpDetail; + this.unparsed |= gcpDetail.unparsed; + return this; + } + + /** + * The definition of PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + * object. + * + * @return gcpDetail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCP_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail getGcpDetail() { + return gcpDetail; + } + + public void setGcpDetail( + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpDetail) { + this.gcpDetail = gcpDetail; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails + */ + @JsonAnySetter + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails object is + * equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails + patchTableRequestDataAttributesFileMetadataOneOfAccessDetails = + (PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails) o; + return Objects.equals( + this.awsDetail, patchTableRequestDataAttributesFileMetadataOneOfAccessDetails.awsDetail) + && Objects.equals( + this.azureDetail, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetails.azureDetail) + && Objects.equals( + this.gcpDetail, patchTableRequestDataAttributesFileMetadataOneOfAccessDetails.gcpDetail) + && Objects.equals( + this.additionalProperties, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetails.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(awsDetail, azureDetail, gcpDetail, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails {\n"); + sb.append(" awsDetail: ").append(toIndentedString(awsDetail)).append("\n"); + sb.append(" azureDetail: ").append(toIndentedString(azureDetail)).append("\n"); + sb.append(" gcpDetail: ").append(toIndentedString(gcpDetail)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java new file mode 100644 index 00000000000..1d754f6d385 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java @@ -0,0 +1,214 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + * object. + */ +@JsonPropertyOrder({ + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + .JSON_PROPERTY_AWS_ACCOUNT_ID, + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + .JSON_PROPERTY_AWS_BUCKET_NAME, + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.JSON_PROPERTY_FILE_PATH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AWS_ACCOUNT_ID = "aws_account_id"; + private String awsAccountId; + + public static final String JSON_PROPERTY_AWS_BUCKET_NAME = "aws_bucket_name"; + private String awsBucketName; + + public static final String JSON_PROPERTY_FILE_PATH = "file_path"; + private String filePath; + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsAccountId( + String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * The ID of the AWS account. + * + * @return awsAccountId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAwsAccountId() { + return awsAccountId; + } + + public void setAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + } + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsBucketName( + String awsBucketName) { + this.awsBucketName = awsBucketName; + return this; + } + + /** + * The name of the AWS bucket. + * + * @return awsBucketName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_BUCKET_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAwsBucketName() { + return awsBucketName; + } + + public void setAwsBucketName(String awsBucketName) { + this.awsBucketName = awsBucketName; + } + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail filePath( + String filePath) { + this.filePath = filePath; + return this; + } + + /** + * The relative file path from the S3 bucket root to the CSV file. + * + * @return filePath + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + */ + @JsonAnySetter + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + * object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail = + (PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail) o; + return Objects.equals( + this.awsAccountId, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.awsAccountId) + && Objects.equals( + this.awsBucketName, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.awsBucketName) + && Objects.equals( + this.filePath, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.filePath) + && Objects.equals( + this.additionalProperties, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(awsAccountId, awsBucketName, filePath, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail {\n"); + sb.append(" awsAccountId: ").append(toIndentedString(awsAccountId)).append("\n"); + sb.append(" awsBucketName: ").append(toIndentedString(awsBucketName)).append("\n"); + sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java new file mode 100644 index 00000000000..3565e2f8dd1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java @@ -0,0 +1,287 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + * object. + */ +@JsonPropertyOrder({ + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_CLIENT_ID, + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_CONTAINER_NAME, + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_STORAGE_ACCOUNT_NAME, + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_TENANT_ID, + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.JSON_PROPERTY_FILE_PATH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AZURE_CLIENT_ID = "azure_client_id"; + private String azureClientId; + + public static final String JSON_PROPERTY_AZURE_CONTAINER_NAME = "azure_container_name"; + private String azureContainerName; + + public static final String JSON_PROPERTY_AZURE_STORAGE_ACCOUNT_NAME = + "azure_storage_account_name"; + private String azureStorageAccountName; + + public static final String JSON_PROPERTY_AZURE_TENANT_ID = "azure_tenant_id"; + private String azureTenantId; + + public static final String JSON_PROPERTY_FILE_PATH = "file_path"; + private String filePath; + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureClientId( + String azureClientId) { + this.azureClientId = azureClientId; + return this; + } + + /** + * The Azure client ID. + * + * @return azureClientId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAzureClientId() { + return azureClientId; + } + + public void setAzureClientId(String azureClientId) { + this.azureClientId = azureClientId; + } + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + azureContainerName(String azureContainerName) { + this.azureContainerName = azureContainerName; + return this; + } + + /** + * The name of the Azure container. + * + * @return azureContainerName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_CONTAINER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAzureContainerName() { + return azureContainerName; + } + + public void setAzureContainerName(String azureContainerName) { + this.azureContainerName = azureContainerName; + } + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + azureStorageAccountName(String azureStorageAccountName) { + this.azureStorageAccountName = azureStorageAccountName; + return this; + } + + /** + * The name of the Azure storage account. + * + * @return azureStorageAccountName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_STORAGE_ACCOUNT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAzureStorageAccountName() { + return azureStorageAccountName; + } + + public void setAzureStorageAccountName(String azureStorageAccountName) { + this.azureStorageAccountName = azureStorageAccountName; + } + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureTenantId( + String azureTenantId) { + this.azureTenantId = azureTenantId; + return this; + } + + /** + * The ID of the Azure tenant. + * + * @return azureTenantId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_TENANT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAzureTenantId() { + return azureTenantId; + } + + public void setAzureTenantId(String azureTenantId) { + this.azureTenantId = azureTenantId; + } + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail filePath( + String filePath) { + this.filePath = filePath; + return this; + } + + /** + * The relative file path from the Azure container root to the CSV file. + * + * @return filePath + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + */ + @JsonAnySetter + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + * object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail = + (PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail) o; + return Objects.equals( + this.azureClientId, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.azureClientId) + && Objects.equals( + this.azureContainerName, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .azureContainerName) + && Objects.equals( + this.azureStorageAccountName, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .azureStorageAccountName) + && Objects.equals( + this.azureTenantId, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.azureTenantId) + && Objects.equals( + this.filePath, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.filePath) + && Objects.equals( + this.additionalProperties, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + azureClientId, + azureContainerName, + azureStorageAccountName, + azureTenantId, + filePath, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail {\n"); + sb.append(" azureClientId: ").append(toIndentedString(azureClientId)).append("\n"); + sb.append(" azureContainerName: ").append(toIndentedString(azureContainerName)).append("\n"); + sb.append(" azureStorageAccountName: ") + .append(toIndentedString(azureStorageAccountName)) + .append("\n"); + sb.append(" azureTenantId: ").append(toIndentedString(azureTenantId)).append("\n"); + sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java new file mode 100644 index 00000000000..282ddbbaff5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java @@ -0,0 +1,249 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + * object. + */ +@JsonPropertyOrder({ + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.JSON_PROPERTY_FILE_PATH, + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .JSON_PROPERTY_GCP_BUCKET_NAME, + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .JSON_PROPERTY_GCP_PROJECT_ID, + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .JSON_PROPERTY_GCP_SERVICE_ACCOUNT_EMAIL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FILE_PATH = "file_path"; + private String filePath; + + public static final String JSON_PROPERTY_GCP_BUCKET_NAME = "gcp_bucket_name"; + private String gcpBucketName; + + public static final String JSON_PROPERTY_GCP_PROJECT_ID = "gcp_project_id"; + private String gcpProjectId; + + public static final String JSON_PROPERTY_GCP_SERVICE_ACCOUNT_EMAIL = "gcp_service_account_email"; + private String gcpServiceAccountEmail; + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail filePath( + String filePath) { + this.filePath = filePath; + return this; + } + + /** + * The relative file path from the GCS bucket root to the CSV file. + * + * @return filePath + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpBucketName( + String gcpBucketName) { + this.gcpBucketName = gcpBucketName; + return this; + } + + /** + * The name of the GCP bucket. + * + * @return gcpBucketName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCP_BUCKET_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGcpBucketName() { + return gcpBucketName; + } + + public void setGcpBucketName(String gcpBucketName) { + this.gcpBucketName = gcpBucketName; + } + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpProjectId( + String gcpProjectId) { + this.gcpProjectId = gcpProjectId; + return this; + } + + /** + * The ID of the GCP project. + * + * @return gcpProjectId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCP_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGcpProjectId() { + return gcpProjectId; + } + + public void setGcpProjectId(String gcpProjectId) { + this.gcpProjectId = gcpProjectId; + } + + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + gcpServiceAccountEmail(String gcpServiceAccountEmail) { + this.gcpServiceAccountEmail = gcpServiceAccountEmail; + return this; + } + + /** + * The email of the GCP service account. + * + * @return gcpServiceAccountEmail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCP_SERVICE_ACCOUNT_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGcpServiceAccountEmail() { + return gcpServiceAccountEmail; + } + + public void setGcpServiceAccountEmail(String gcpServiceAccountEmail) { + this.gcpServiceAccountEmail = gcpServiceAccountEmail; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + */ + @JsonAnySetter + public PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + * object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail = + (PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail) o; + return Objects.equals( + this.filePath, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.filePath) + && Objects.equals( + this.gcpBucketName, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.gcpBucketName) + && Objects.equals( + this.gcpProjectId, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.gcpProjectId) + && Objects.equals( + this.gcpServiceAccountEmail, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .gcpServiceAccountEmail) + && Objects.equals( + this.additionalProperties, + patchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + filePath, gcpBucketName, gcpProjectId, gcpServiceAccountEmail, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail {\n"); + sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); + sb.append(" gcpBucketName: ").append(toIndentedString(gcpBucketName)).append("\n"); + sb.append(" gcpProjectId: ").append(toIndentedString(gcpProjectId)).append("\n"); + sb.append(" gcpServiceAccountEmail: ") + .append(toIndentedString(gcpServiceAccountEmail)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesSchema.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesSchema.java new file mode 100644 index 00000000000..9f735c6b48c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesSchema.java @@ -0,0 +1,195 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of PatchTableRequestDataAttributesSchema object. */ +@JsonPropertyOrder({ + PatchTableRequestDataAttributesSchema.JSON_PROPERTY_FIELDS, + PatchTableRequestDataAttributesSchema.JSON_PROPERTY_PRIMARY_KEYS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchTableRequestDataAttributesSchema { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIELDS = "fields"; + private List fields = new ArrayList<>(); + + public static final String JSON_PROPERTY_PRIMARY_KEYS = "primary_keys"; + private List primaryKeys = new ArrayList<>(); + + public PatchTableRequestDataAttributesSchema() {} + + @JsonCreator + public PatchTableRequestDataAttributesSchema( + @JsonProperty(required = true, value = JSON_PROPERTY_FIELDS) + List fields, + @JsonProperty(required = true, value = JSON_PROPERTY_PRIMARY_KEYS) List primaryKeys) { + this.fields = fields; + this.primaryKeys = primaryKeys; + } + + public PatchTableRequestDataAttributesSchema fields( + List fields) { + this.fields = fields; + for (PatchTableRequestDataAttributesSchemaFieldsItems item : fields) { + this.unparsed |= item.unparsed; + } + return this; + } + + public PatchTableRequestDataAttributesSchema addFieldsItem( + PatchTableRequestDataAttributesSchemaFieldsItems fieldsItem) { + this.fields.add(fieldsItem); + this.unparsed |= fieldsItem.unparsed; + return this; + } + + /** + * The schema fields. + * + * @return fields + */ + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFields() { + return fields; + } + + public void setFields(List fields) { + this.fields = fields; + } + + public PatchTableRequestDataAttributesSchema primaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + return this; + } + + public PatchTableRequestDataAttributesSchema addPrimaryKeysItem(String primaryKeysItem) { + this.primaryKeys.add(primaryKeysItem); + return this; + } + + /** + * List of field names that serve as primary keys for the table. Currently only 1 primary key is + * supported, and it is used as an ID to retrieve rows. + * + * @return primaryKeys + */ + @JsonProperty(JSON_PROPERTY_PRIMARY_KEYS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPrimaryKeys() { + return primaryKeys; + } + + public void setPrimaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchTableRequestDataAttributesSchema + */ + @JsonAnySetter + public PatchTableRequestDataAttributesSchema putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PatchTableRequestDataAttributesSchema object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchTableRequestDataAttributesSchema patchTableRequestDataAttributesSchema = + (PatchTableRequestDataAttributesSchema) o; + return Objects.equals(this.fields, patchTableRequestDataAttributesSchema.fields) + && Objects.equals(this.primaryKeys, patchTableRequestDataAttributesSchema.primaryKeys) + && Objects.equals( + this.additionalProperties, patchTableRequestDataAttributesSchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, primaryKeys, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchTableRequestDataAttributesSchema {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" primaryKeys: ").append(toIndentedString(primaryKeys)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesSchemaFieldsItems.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesSchemaFieldsItems.java new file mode 100644 index 00000000000..03b0fc5eb3d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataAttributesSchemaFieldsItems.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of PatchTableRequestDataAttributesSchemaFieldsItems object. */ +@JsonPropertyOrder({ + PatchTableRequestDataAttributesSchemaFieldsItems.JSON_PROPERTY_NAME, + PatchTableRequestDataAttributesSchemaFieldsItems.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchTableRequestDataAttributesSchemaFieldsItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ReferenceTableSchemaFieldType type; + + public PatchTableRequestDataAttributesSchemaFieldsItems() {} + + @JsonCreator + public PatchTableRequestDataAttributesSchemaFieldsItems( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ReferenceTableSchemaFieldType type) { + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public PatchTableRequestDataAttributesSchemaFieldsItems name(String name) { + this.name = name; + return this; + } + + /** + * The field name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public PatchTableRequestDataAttributesSchemaFieldsItems type(ReferenceTableSchemaFieldType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The field type for reference table schema fields. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReferenceTableSchemaFieldType getType() { + return type; + } + + public void setType(ReferenceTableSchemaFieldType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchTableRequestDataAttributesSchemaFieldsItems + */ + @JsonAnySetter + public PatchTableRequestDataAttributesSchemaFieldsItems putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PatchTableRequestDataAttributesSchemaFieldsItems object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchTableRequestDataAttributesSchemaFieldsItems + patchTableRequestDataAttributesSchemaFieldsItems = + (PatchTableRequestDataAttributesSchemaFieldsItems) o; + return Objects.equals(this.name, patchTableRequestDataAttributesSchemaFieldsItems.name) + && Objects.equals(this.type, patchTableRequestDataAttributesSchemaFieldsItems.type) + && Objects.equals( + this.additionalProperties, + patchTableRequestDataAttributesSchemaFieldsItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchTableRequestDataAttributesSchemaFieldsItems {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataType.java new file mode 100644 index 00000000000..77af354c018 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchTableRequestDataType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Reference table resource type. */ +@JsonSerialize(using = PatchTableRequestDataType.PatchTableRequestDataTypeSerializer.class) +public class PatchTableRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("reference_table")); + + public static final PatchTableRequestDataType REFERENCE_TABLE = + new PatchTableRequestDataType("reference_table"); + + PatchTableRequestDataType(String value) { + super(value, allowedValues); + } + + public static class PatchTableRequestDataTypeSerializer + extends StdSerializer { + public PatchTableRequestDataTypeSerializer(Class t) { + super(t); + } + + public PatchTableRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + PatchTableRequestDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static PatchTableRequestDataType fromValue(String value) { + return new PatchTableRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReferenceTableCreateSourceType.java b/src/main/java/com/datadog/api/client/v2/model/ReferenceTableCreateSourceType.java new file mode 100644 index 00000000000..1070ed74dd1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReferenceTableCreateSourceType.java @@ -0,0 +1,66 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * The source type for creating reference table data. Only these source types can be created via + * this API. + */ +@JsonSerialize( + using = ReferenceTableCreateSourceType.ReferenceTableCreateSourceTypeSerializer.class) +public class ReferenceTableCreateSourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("LOCAL_FILE", "S3", "GCS", "AZURE")); + + public static final ReferenceTableCreateSourceType LOCAL_FILE = + new ReferenceTableCreateSourceType("LOCAL_FILE"); + public static final ReferenceTableCreateSourceType S3 = new ReferenceTableCreateSourceType("S3"); + public static final ReferenceTableCreateSourceType GCS = + new ReferenceTableCreateSourceType("GCS"); + public static final ReferenceTableCreateSourceType AZURE = + new ReferenceTableCreateSourceType("AZURE"); + + ReferenceTableCreateSourceType(String value) { + super(value, allowedValues); + } + + public static class ReferenceTableCreateSourceTypeSerializer + extends StdSerializer { + public ReferenceTableCreateSourceTypeSerializer(Class t) { + super(t); + } + + public ReferenceTableCreateSourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ReferenceTableCreateSourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ReferenceTableCreateSourceType fromValue(String value) { + return new ReferenceTableCreateSourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReferenceTableSchemaFieldType.java b/src/main/java/com/datadog/api/client/v2/model/ReferenceTableSchemaFieldType.java new file mode 100644 index 00000000000..087284ebafa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReferenceTableSchemaFieldType.java @@ -0,0 +1,59 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The field type for reference table schema fields. */ +@JsonSerialize(using = ReferenceTableSchemaFieldType.ReferenceTableSchemaFieldTypeSerializer.class) +public class ReferenceTableSchemaFieldType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("STRING", "INT32")); + + public static final ReferenceTableSchemaFieldType STRING = + new ReferenceTableSchemaFieldType("STRING"); + public static final ReferenceTableSchemaFieldType INT32 = + new ReferenceTableSchemaFieldType("INT32"); + + ReferenceTableSchemaFieldType(String value) { + super(value, allowedValues); + } + + public static class ReferenceTableSchemaFieldTypeSerializer + extends StdSerializer { + public ReferenceTableSchemaFieldTypeSerializer(Class t) { + super(t); + } + + public ReferenceTableSchemaFieldTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ReferenceTableSchemaFieldType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ReferenceTableSchemaFieldType fromValue(String value) { + return new ReferenceTableSchemaFieldType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReferenceTableSortType.java b/src/main/java/com/datadog/api/client/v2/model/ReferenceTableSortType.java new file mode 100644 index 00000000000..86f1f6f116a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReferenceTableSortType.java @@ -0,0 +1,68 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Sort field and direction for reference tables. Use field name for ascending, prefix with "-" for + * descending. + */ +@JsonSerialize(using = ReferenceTableSortType.ReferenceTableSortTypeSerializer.class) +public class ReferenceTableSortType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "updated_at", "table_name", "status", "-updated_at", "-table_name", "-status")); + + public static final ReferenceTableSortType UPDATED_AT = new ReferenceTableSortType("updated_at"); + public static final ReferenceTableSortType TABLE_NAME = new ReferenceTableSortType("table_name"); + public static final ReferenceTableSortType STATUS = new ReferenceTableSortType("status"); + public static final ReferenceTableSortType MINUS_UPDATED_AT = + new ReferenceTableSortType("-updated_at"); + public static final ReferenceTableSortType MINUS_TABLE_NAME = + new ReferenceTableSortType("-table_name"); + public static final ReferenceTableSortType MINUS_STATUS = new ReferenceTableSortType("-status"); + + ReferenceTableSortType(String value) { + super(value, allowedValues); + } + + public static class ReferenceTableSortTypeSerializer + extends StdSerializer { + public ReferenceTableSortTypeSerializer(Class t) { + super(t); + } + + public ReferenceTableSortTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ReferenceTableSortType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ReferenceTableSortType fromValue(String value) { + return new ReferenceTableSortType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReferenceTableSourceType.java b/src/main/java/com/datadog/api/client/v2/model/ReferenceTableSourceType.java new file mode 100644 index 00000000000..cc3aa30865e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReferenceTableSourceType.java @@ -0,0 +1,80 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * The source type for reference table data. Includes all possible source types that can appear in + * responses. + */ +@JsonSerialize(using = ReferenceTableSourceType.ReferenceTableSourceTypeSerializer.class) +public class ReferenceTableSourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "LOCAL_FILE", + "S3", + "GCS", + "AZURE", + "SERVICENOW", + "SALESFORCE", + "DATABRICKS", + "SNOWFLAKE")); + + public static final ReferenceTableSourceType LOCAL_FILE = + new ReferenceTableSourceType("LOCAL_FILE"); + public static final ReferenceTableSourceType S3 = new ReferenceTableSourceType("S3"); + public static final ReferenceTableSourceType GCS = new ReferenceTableSourceType("GCS"); + public static final ReferenceTableSourceType AZURE = new ReferenceTableSourceType("AZURE"); + public static final ReferenceTableSourceType SERVICENOW = + new ReferenceTableSourceType("SERVICENOW"); + public static final ReferenceTableSourceType SALESFORCE = + new ReferenceTableSourceType("SALESFORCE"); + public static final ReferenceTableSourceType DATABRICKS = + new ReferenceTableSourceType("DATABRICKS"); + public static final ReferenceTableSourceType SNOWFLAKE = + new ReferenceTableSourceType("SNOWFLAKE"); + + ReferenceTableSourceType(String value) { + super(value, allowedValues); + } + + public static class ReferenceTableSourceTypeSerializer + extends StdSerializer { + public ReferenceTableSourceTypeSerializer(Class t) { + super(t); + } + + public ReferenceTableSourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ReferenceTableSourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ReferenceTableSourceType fromValue(String value) { + return new ReferenceTableSourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2.java new file mode 100644 index 00000000000..e0541f2f2f4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of TableResultV2 object. */ +@JsonPropertyOrder({TableResultV2.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2 { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TableResultV2Data data; + + public TableResultV2 data(TableResultV2Data data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of TableResultV2Data object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableResultV2Data getData() { + return data; + } + + public void setData(TableResultV2Data data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2 + */ + @JsonAnySetter + public TableResultV2 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TableResultV2 object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2 tableResultV2 = (TableResultV2) o; + return Objects.equals(this.data, tableResultV2.data) + && Objects.equals(this.additionalProperties, tableResultV2.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2 {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2Array.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2Array.java new file mode 100644 index 00000000000..8aa810d5713 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2Array.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of TableResultV2Array object. */ +@JsonPropertyOrder({TableResultV2Array.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2Array { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public TableResultV2Array() {} + + @JsonCreator + public TableResultV2Array( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public TableResultV2Array data(List data) { + this.data = data; + for (TableResultV2Data item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TableResultV2Array addDataItem(TableResultV2Data dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The reference tables. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2Array + */ + @JsonAnySetter + public TableResultV2Array putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TableResultV2Array object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2Array tableResultV2Array = (TableResultV2Array) o; + return Objects.equals(this.data, tableResultV2Array.data) + && Objects.equals(this.additionalProperties, tableResultV2Array.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2Array {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2Data.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2Data.java new file mode 100644 index 00000000000..189f8b06885 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2Data.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of TableResultV2Data object. */ +@JsonPropertyOrder({ + TableResultV2Data.JSON_PROPERTY_ATTRIBUTES, + TableResultV2Data.JSON_PROPERTY_ID, + TableResultV2Data.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2Data { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TableResultV2DataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TableResultV2DataType type = TableResultV2DataType.REFERENCE_TABLE; + + public TableResultV2Data() {} + + @JsonCreator + public TableResultV2Data( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TableResultV2DataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TableResultV2Data attributes(TableResultV2DataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of TableResultV2DataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableResultV2DataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TableResultV2DataAttributes attributes) { + this.attributes = attributes; + } + + public TableResultV2Data id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the reference table. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TableResultV2Data type(TableResultV2DataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Reference table resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TableResultV2DataType getType() { + return type; + } + + public void setType(TableResultV2DataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2Data + */ + @JsonAnySetter + public TableResultV2Data putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TableResultV2Data object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2Data tableResultV2Data = (TableResultV2Data) o; + return Objects.equals(this.attributes, tableResultV2Data.attributes) + && Objects.equals(this.id, tableResultV2Data.id) + && Objects.equals(this.type, tableResultV2Data.type) + && Objects.equals(this.additionalProperties, tableResultV2Data.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2Data {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributes.java new file mode 100644 index 00000000000..0e3955df844 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributes.java @@ -0,0 +1,438 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of TableResultV2DataAttributes object. */ +@JsonPropertyOrder({ + TableResultV2DataAttributes.JSON_PROPERTY_CREATED_BY, + TableResultV2DataAttributes.JSON_PROPERTY_DESCRIPTION, + TableResultV2DataAttributes.JSON_PROPERTY_FILE_METADATA, + TableResultV2DataAttributes.JSON_PROPERTY_LAST_UPDATED_BY, + TableResultV2DataAttributes.JSON_PROPERTY_ROW_COUNT, + TableResultV2DataAttributes.JSON_PROPERTY_SCHEMA, + TableResultV2DataAttributes.JSON_PROPERTY_SOURCE, + TableResultV2DataAttributes.JSON_PROPERTY_STATUS, + TableResultV2DataAttributes.JSON_PROPERTY_TABLE_NAME, + TableResultV2DataAttributes.JSON_PROPERTY_TAGS, + TableResultV2DataAttributes.JSON_PROPERTY_UPDATED_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2DataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private String createdBy; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_FILE_METADATA = "file_metadata"; + private TableResultV2DataAttributesFileMetadata fileMetadata; + + public static final String JSON_PROPERTY_LAST_UPDATED_BY = "last_updated_by"; + private String lastUpdatedBy; + + public static final String JSON_PROPERTY_ROW_COUNT = "row_count"; + private Long rowCount; + + public static final String JSON_PROPERTY_SCHEMA = "schema"; + private TableResultV2DataAttributesSchema schema; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private ReferenceTableSourceType source; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TABLE_NAME = "table_name"; + private String tableName; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private String updatedAt; + + public TableResultV2DataAttributes createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * UUID of the user who created the reference table. + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public TableResultV2DataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the reference table. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public TableResultV2DataAttributes fileMetadata( + TableResultV2DataAttributesFileMetadata fileMetadata) { + this.fileMetadata = fileMetadata; + this.unparsed |= fileMetadata.unparsed; + return this; + } + + /** + * The definition of TableResultV2DataAttributesFileMetadata object. + * + * @return fileMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableResultV2DataAttributesFileMetadata getFileMetadata() { + return fileMetadata; + } + + public void setFileMetadata(TableResultV2DataAttributesFileMetadata fileMetadata) { + this.fileMetadata = fileMetadata; + } + + public TableResultV2DataAttributes lastUpdatedBy(String lastUpdatedBy) { + this.lastUpdatedBy = lastUpdatedBy; + return this; + } + + /** + * UUID of the user who last updated the reference table. + * + * @return lastUpdatedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_UPDATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastUpdatedBy() { + return lastUpdatedBy; + } + + public void setLastUpdatedBy(String lastUpdatedBy) { + this.lastUpdatedBy = lastUpdatedBy; + } + + public TableResultV2DataAttributes rowCount(Long rowCount) { + this.rowCount = rowCount; + return this; + } + + /** + * The number of successfully processed rows in the reference table. + * + * @return rowCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROW_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRowCount() { + return rowCount; + } + + public void setRowCount(Long rowCount) { + this.rowCount = rowCount; + } + + public TableResultV2DataAttributes schema(TableResultV2DataAttributesSchema schema) { + this.schema = schema; + this.unparsed |= schema.unparsed; + return this; + } + + /** + * The definition of TableResultV2DataAttributesSchema object. + * + * @return schema + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableResultV2DataAttributesSchema getSchema() { + return schema; + } + + public void setSchema(TableResultV2DataAttributesSchema schema) { + this.schema = schema; + } + + public TableResultV2DataAttributes source(ReferenceTableSourceType source) { + this.source = source; + this.unparsed |= !source.isValid(); + return this; + } + + /** + * The source type for reference table data. Includes all possible source types that can appear in + * responses. + * + * @return source + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReferenceTableSourceType getSource() { + return source; + } + + public void setSource(ReferenceTableSourceType source) { + if (!source.isValid()) { + this.unparsed = true; + } + this.source = source; + } + + public TableResultV2DataAttributes status(String status) { + this.status = status; + return this; + } + + /** + * The status of the reference table. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public TableResultV2DataAttributes tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * The name of the reference table. + * + * @return tableName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TABLE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public TableResultV2DataAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public TableResultV2DataAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * The tags of the reference table. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public TableResultV2DataAttributes updatedAt(String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of the last update to the reference table in ISO 8601 format. + * + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2DataAttributes + */ + @JsonAnySetter + public TableResultV2DataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TableResultV2DataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2DataAttributes tableResultV2DataAttributes = (TableResultV2DataAttributes) o; + return Objects.equals(this.createdBy, tableResultV2DataAttributes.createdBy) + && Objects.equals(this.description, tableResultV2DataAttributes.description) + && Objects.equals(this.fileMetadata, tableResultV2DataAttributes.fileMetadata) + && Objects.equals(this.lastUpdatedBy, tableResultV2DataAttributes.lastUpdatedBy) + && Objects.equals(this.rowCount, tableResultV2DataAttributes.rowCount) + && Objects.equals(this.schema, tableResultV2DataAttributes.schema) + && Objects.equals(this.source, tableResultV2DataAttributes.source) + && Objects.equals(this.status, tableResultV2DataAttributes.status) + && Objects.equals(this.tableName, tableResultV2DataAttributes.tableName) + && Objects.equals(this.tags, tableResultV2DataAttributes.tags) + && Objects.equals(this.updatedAt, tableResultV2DataAttributes.updatedAt) + && Objects.equals( + this.additionalProperties, tableResultV2DataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdBy, + description, + fileMetadata, + lastUpdatedBy, + rowCount, + schema, + source, + status, + tableName, + tags, + updatedAt, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2DataAttributes {\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" fileMetadata: ").append(toIndentedString(fileMetadata)).append("\n"); + sb.append(" lastUpdatedBy: ").append(toIndentedString(lastUpdatedBy)).append("\n"); + sb.append(" rowCount: ").append(toIndentedString(rowCount)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" tableName: ").append(toIndentedString(tableName)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadata.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadata.java new file mode 100644 index 00000000000..ed168a41763 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadata.java @@ -0,0 +1,334 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = + TableResultV2DataAttributesFileMetadata.TableResultV2DataAttributesFileMetadataDeserializer + .class) +@JsonSerialize( + using = + TableResultV2DataAttributesFileMetadata.TableResultV2DataAttributesFileMetadataSerializer + .class) +public class TableResultV2DataAttributesFileMetadata extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(TableResultV2DataAttributesFileMetadata.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class TableResultV2DataAttributesFileMetadataSerializer + extends StdSerializer { + public TableResultV2DataAttributesFileMetadataSerializer( + Class t) { + super(t); + } + + public TableResultV2DataAttributesFileMetadataSerializer() { + this(null); + } + + @Override + public void serialize( + TableResultV2DataAttributesFileMetadata value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class TableResultV2DataAttributesFileMetadataDeserializer + extends StdDeserializer { + public TableResultV2DataAttributesFileMetadataDeserializer() { + this(TableResultV2DataAttributesFileMetadata.class); + } + + public TableResultV2DataAttributesFileMetadataDeserializer(Class vc) { + super(vc); + } + + @Override + public TableResultV2DataAttributesFileMetadata deserialize( + JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize TableResultV2DataAttributesFileMetadataCloudStorage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (TableResultV2DataAttributesFileMetadataCloudStorage.class.equals(Integer.class) + || TableResultV2DataAttributesFileMetadataCloudStorage.class.equals(Long.class) + || TableResultV2DataAttributesFileMetadataCloudStorage.class.equals(Float.class) + || TableResultV2DataAttributesFileMetadataCloudStorage.class.equals(Double.class) + || TableResultV2DataAttributesFileMetadataCloudStorage.class.equals(Boolean.class) + || TableResultV2DataAttributesFileMetadataCloudStorage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((TableResultV2DataAttributesFileMetadataCloudStorage.class.equals(Integer.class) + || TableResultV2DataAttributesFileMetadataCloudStorage.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((TableResultV2DataAttributesFileMetadataCloudStorage.class.equals(Float.class) + || TableResultV2DataAttributesFileMetadataCloudStorage.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (TableResultV2DataAttributesFileMetadataCloudStorage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (TableResultV2DataAttributesFileMetadataCloudStorage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(TableResultV2DataAttributesFileMetadataCloudStorage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((TableResultV2DataAttributesFileMetadataCloudStorage) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'TableResultV2DataAttributesFileMetadataCloudStorage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'TableResultV2DataAttributesFileMetadataCloudStorage'", + e); + } + + // deserialize TableResultV2DataAttributesFileMetadataLocalFile + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (TableResultV2DataAttributesFileMetadataLocalFile.class.equals(Integer.class) + || TableResultV2DataAttributesFileMetadataLocalFile.class.equals(Long.class) + || TableResultV2DataAttributesFileMetadataLocalFile.class.equals(Float.class) + || TableResultV2DataAttributesFileMetadataLocalFile.class.equals(Double.class) + || TableResultV2DataAttributesFileMetadataLocalFile.class.equals(Boolean.class) + || TableResultV2DataAttributesFileMetadataLocalFile.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((TableResultV2DataAttributesFileMetadataLocalFile.class.equals(Integer.class) + || TableResultV2DataAttributesFileMetadataLocalFile.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((TableResultV2DataAttributesFileMetadataLocalFile.class.equals(Float.class) + || TableResultV2DataAttributesFileMetadataLocalFile.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (TableResultV2DataAttributesFileMetadataLocalFile.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (TableResultV2DataAttributesFileMetadataLocalFile.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(TableResultV2DataAttributesFileMetadataLocalFile.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((TableResultV2DataAttributesFileMetadataLocalFile) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'TableResultV2DataAttributesFileMetadataLocalFile'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'TableResultV2DataAttributesFileMetadataLocalFile'", + e); + } + + TableResultV2DataAttributesFileMetadata ret = new TableResultV2DataAttributesFileMetadata(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public TableResultV2DataAttributesFileMetadata getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "TableResultV2DataAttributesFileMetadata cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public TableResultV2DataAttributesFileMetadata() { + super("oneOf", Boolean.FALSE); + } + + public TableResultV2DataAttributesFileMetadata( + TableResultV2DataAttributesFileMetadataCloudStorage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TableResultV2DataAttributesFileMetadata( + TableResultV2DataAttributesFileMetadataLocalFile o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "TableResultV2DataAttributesFileMetadataCloudStorage", + new GenericType() {}); + schemas.put( + "TableResultV2DataAttributesFileMetadataLocalFile", + new GenericType() {}); + JSON.registerDescendants( + TableResultV2DataAttributesFileMetadata.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return TableResultV2DataAttributesFileMetadata.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: TableResultV2DataAttributesFileMetadataCloudStorage, + * TableResultV2DataAttributesFileMetadataLocalFile + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + TableResultV2DataAttributesFileMetadataCloudStorage.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + TableResultV2DataAttributesFileMetadataLocalFile.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be TableResultV2DataAttributesFileMetadataCloudStorage," + + " TableResultV2DataAttributesFileMetadataLocalFile"); + } + + /** + * Get the actual instance, which can be the following: + * TableResultV2DataAttributesFileMetadataCloudStorage, + * TableResultV2DataAttributesFileMetadataLocalFile + * + * @return The actual instance (TableResultV2DataAttributesFileMetadataCloudStorage, + * TableResultV2DataAttributesFileMetadataLocalFile) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `TableResultV2DataAttributesFileMetadataCloudStorage`. If the actual + * instance is not `TableResultV2DataAttributesFileMetadataCloudStorage`, the ClassCastException + * will be thrown. + * + * @return The actual instance of `TableResultV2DataAttributesFileMetadataCloudStorage` + * @throws ClassCastException if the instance is not + * `TableResultV2DataAttributesFileMetadataCloudStorage` + */ + public TableResultV2DataAttributesFileMetadataCloudStorage + getTableResultV2DataAttributesFileMetadataCloudStorage() throws ClassCastException { + return (TableResultV2DataAttributesFileMetadataCloudStorage) super.getActualInstance(); + } + + /** + * Get the actual instance of `TableResultV2DataAttributesFileMetadataLocalFile`. If the actual + * instance is not `TableResultV2DataAttributesFileMetadataLocalFile`, the ClassCastException will + * be thrown. + * + * @return The actual instance of `TableResultV2DataAttributesFileMetadataLocalFile` + * @throws ClassCastException if the instance is not + * `TableResultV2DataAttributesFileMetadataLocalFile` + */ + public TableResultV2DataAttributesFileMetadataLocalFile + getTableResultV2DataAttributesFileMetadataLocalFile() throws ClassCastException { + return (TableResultV2DataAttributesFileMetadataLocalFile) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataCloudStorage.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataCloudStorage.java new file mode 100644 index 00000000000..ff841a59727 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataCloudStorage.java @@ -0,0 +1,268 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** File metadata for reference tables created via cloud storage. */ +@JsonPropertyOrder({ + TableResultV2DataAttributesFileMetadataCloudStorage.JSON_PROPERTY_ACCESS_DETAILS, + TableResultV2DataAttributesFileMetadataCloudStorage.JSON_PROPERTY_ERROR_MESSAGE, + TableResultV2DataAttributesFileMetadataCloudStorage.JSON_PROPERTY_ERROR_ROW_COUNT, + TableResultV2DataAttributesFileMetadataCloudStorage.JSON_PROPERTY_ERROR_TYPE, + TableResultV2DataAttributesFileMetadataCloudStorage.JSON_PROPERTY_SYNC_ENABLED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2DataAttributesFileMetadataCloudStorage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCESS_DETAILS = "access_details"; + private TableResultV2DataAttributesFileMetadataOneOfAccessDetails accessDetails; + + public static final String JSON_PROPERTY_ERROR_MESSAGE = "error_message"; + private String errorMessage; + + public static final String JSON_PROPERTY_ERROR_ROW_COUNT = "error_row_count"; + private Long errorRowCount; + + public static final String JSON_PROPERTY_ERROR_TYPE = "error_type"; + private TableResultV2DataAttributesFileMetadataCloudStorageErrorType errorType; + + public static final String JSON_PROPERTY_SYNC_ENABLED = "sync_enabled"; + private Boolean syncEnabled; + + public TableResultV2DataAttributesFileMetadataCloudStorage accessDetails( + TableResultV2DataAttributesFileMetadataOneOfAccessDetails accessDetails) { + this.accessDetails = accessDetails; + this.unparsed |= accessDetails.unparsed; + return this; + } + + /** + * The definition of TableResultV2DataAttributesFileMetadataOneOfAccessDetails + * object. + * + * @return accessDetails + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCESS_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableResultV2DataAttributesFileMetadataOneOfAccessDetails getAccessDetails() { + return accessDetails; + } + + public void setAccessDetails( + TableResultV2DataAttributesFileMetadataOneOfAccessDetails accessDetails) { + this.accessDetails = accessDetails; + } + + public TableResultV2DataAttributesFileMetadataCloudStorage errorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * The error message returned from the sync. + * + * @return errorMessage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public TableResultV2DataAttributesFileMetadataCloudStorage errorRowCount(Long errorRowCount) { + this.errorRowCount = errorRowCount; + return this; + } + + /** + * The number of rows that failed to sync. + * + * @return errorRowCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_ROW_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getErrorRowCount() { + return errorRowCount; + } + + public void setErrorRowCount(Long errorRowCount) { + this.errorRowCount = errorRowCount; + } + + public TableResultV2DataAttributesFileMetadataCloudStorage errorType( + TableResultV2DataAttributesFileMetadataCloudStorageErrorType errorType) { + this.errorType = errorType; + this.unparsed |= !errorType.isValid(); + return this; + } + + /** + * 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. + * + * @return errorType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableResultV2DataAttributesFileMetadataCloudStorageErrorType getErrorType() { + return errorType; + } + + public void setErrorType(TableResultV2DataAttributesFileMetadataCloudStorageErrorType errorType) { + if (!errorType.isValid()) { + this.unparsed = true; + } + this.errorType = errorType; + } + + public TableResultV2DataAttributesFileMetadataCloudStorage syncEnabled(Boolean syncEnabled) { + this.syncEnabled = syncEnabled; + return this; + } + + /** + * Whether this table is synced automatically. + * + * @return syncEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYNC_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSyncEnabled() { + return syncEnabled; + } + + public void setSyncEnabled(Boolean syncEnabled) { + this.syncEnabled = syncEnabled; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2DataAttributesFileMetadataCloudStorage + */ + @JsonAnySetter + public TableResultV2DataAttributesFileMetadataCloudStorage putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this TableResultV2DataAttributesFileMetadataCloudStorage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2DataAttributesFileMetadataCloudStorage + tableResultV2DataAttributesFileMetadataCloudStorage = + (TableResultV2DataAttributesFileMetadataCloudStorage) o; + return Objects.equals( + this.accessDetails, tableResultV2DataAttributesFileMetadataCloudStorage.accessDetails) + && Objects.equals( + this.errorMessage, tableResultV2DataAttributesFileMetadataCloudStorage.errorMessage) + && Objects.equals( + this.errorRowCount, tableResultV2DataAttributesFileMetadataCloudStorage.errorRowCount) + && Objects.equals( + this.errorType, tableResultV2DataAttributesFileMetadataCloudStorage.errorType) + && Objects.equals( + this.syncEnabled, tableResultV2DataAttributesFileMetadataCloudStorage.syncEnabled) + && Objects.equals( + this.additionalProperties, + tableResultV2DataAttributesFileMetadataCloudStorage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + accessDetails, errorMessage, errorRowCount, errorType, syncEnabled, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2DataAttributesFileMetadataCloudStorage {\n"); + sb.append(" accessDetails: ").append(toIndentedString(accessDetails)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" errorRowCount: ").append(toIndentedString(errorRowCount)).append("\n"); + sb.append(" errorType: ").append(toIndentedString(errorType)).append("\n"); + sb.append(" syncEnabled: ").append(toIndentedString(syncEnabled)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataCloudStorageErrorType.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataCloudStorageErrorType.java new file mode 100644 index 00000000000..5f73a86243e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataCloudStorageErrorType.java @@ -0,0 +1,98 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * 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. + */ +@JsonSerialize( + using = + TableResultV2DataAttributesFileMetadataCloudStorageErrorType + .TableResultV2DataAttributesFileMetadataCloudStorageErrorTypeSerializer.class) +public class TableResultV2DataAttributesFileMetadataCloudStorageErrorType + extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "TABLE_SCHEMA_ERROR", + "FILE_FORMAT_ERROR", + "CONFIGURATION_ERROR", + "QUOTA_EXCEEDED", + "CONFLICT_ERROR", + "VALIDATION_ERROR", + "STATE_ERROR", + "OPERATION_ERROR", + "SYSTEM_ERROR")); + + public static final TableResultV2DataAttributesFileMetadataCloudStorageErrorType + TABLE_SCHEMA_ERROR = + new TableResultV2DataAttributesFileMetadataCloudStorageErrorType("TABLE_SCHEMA_ERROR"); + public static final TableResultV2DataAttributesFileMetadataCloudStorageErrorType + FILE_FORMAT_ERROR = + new TableResultV2DataAttributesFileMetadataCloudStorageErrorType("FILE_FORMAT_ERROR"); + public static final TableResultV2DataAttributesFileMetadataCloudStorageErrorType + CONFIGURATION_ERROR = + new TableResultV2DataAttributesFileMetadataCloudStorageErrorType("CONFIGURATION_ERROR"); + public static final TableResultV2DataAttributesFileMetadataCloudStorageErrorType QUOTA_EXCEEDED = + new TableResultV2DataAttributesFileMetadataCloudStorageErrorType("QUOTA_EXCEEDED"); + public static final TableResultV2DataAttributesFileMetadataCloudStorageErrorType CONFLICT_ERROR = + new TableResultV2DataAttributesFileMetadataCloudStorageErrorType("CONFLICT_ERROR"); + public static final TableResultV2DataAttributesFileMetadataCloudStorageErrorType + VALIDATION_ERROR = + new TableResultV2DataAttributesFileMetadataCloudStorageErrorType("VALIDATION_ERROR"); + public static final TableResultV2DataAttributesFileMetadataCloudStorageErrorType STATE_ERROR = + new TableResultV2DataAttributesFileMetadataCloudStorageErrorType("STATE_ERROR"); + public static final TableResultV2DataAttributesFileMetadataCloudStorageErrorType OPERATION_ERROR = + new TableResultV2DataAttributesFileMetadataCloudStorageErrorType("OPERATION_ERROR"); + public static final TableResultV2DataAttributesFileMetadataCloudStorageErrorType SYSTEM_ERROR = + new TableResultV2DataAttributesFileMetadataCloudStorageErrorType("SYSTEM_ERROR"); + + TableResultV2DataAttributesFileMetadataCloudStorageErrorType(String value) { + super(value, allowedValues); + } + + public static class TableResultV2DataAttributesFileMetadataCloudStorageErrorTypeSerializer + extends StdSerializer { + public TableResultV2DataAttributesFileMetadataCloudStorageErrorTypeSerializer( + Class t) { + super(t); + } + + public TableResultV2DataAttributesFileMetadataCloudStorageErrorTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TableResultV2DataAttributesFileMetadataCloudStorageErrorType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TableResultV2DataAttributesFileMetadataCloudStorageErrorType fromValue( + String value) { + return new TableResultV2DataAttributesFileMetadataCloudStorageErrorType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataLocalFile.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataLocalFile.java new file mode 100644 index 00000000000..546750ba1f7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataLocalFile.java @@ -0,0 +1,198 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** File metadata for reference tables created via upload. */ +@JsonPropertyOrder({ + TableResultV2DataAttributesFileMetadataLocalFile.JSON_PROPERTY_ERROR_MESSAGE, + TableResultV2DataAttributesFileMetadataLocalFile.JSON_PROPERTY_ERROR_ROW_COUNT, + TableResultV2DataAttributesFileMetadataLocalFile.JSON_PROPERTY_UPLOAD_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2DataAttributesFileMetadataLocalFile { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERROR_MESSAGE = "error_message"; + private String errorMessage; + + public static final String JSON_PROPERTY_ERROR_ROW_COUNT = "error_row_count"; + private Long errorRowCount; + + public static final String JSON_PROPERTY_UPLOAD_ID = "upload_id"; + private String uploadId; + + public TableResultV2DataAttributesFileMetadataLocalFile errorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * The error message returned from the creation/update. + * + * @return errorMessage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public TableResultV2DataAttributesFileMetadataLocalFile errorRowCount(Long errorRowCount) { + this.errorRowCount = errorRowCount; + return this; + } + + /** + * The number of rows that failed to create/update. + * + * @return errorRowCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_ROW_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getErrorRowCount() { + return errorRowCount; + } + + public void setErrorRowCount(Long errorRowCount) { + this.errorRowCount = errorRowCount; + } + + public TableResultV2DataAttributesFileMetadataLocalFile uploadId(String uploadId) { + this.uploadId = uploadId; + return this; + } + + /** + * The upload ID that was used to create/update the table. + * + * @return uploadId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUploadId() { + return uploadId; + } + + public void setUploadId(String uploadId) { + this.uploadId = uploadId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2DataAttributesFileMetadataLocalFile + */ + @JsonAnySetter + public TableResultV2DataAttributesFileMetadataLocalFile putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TableResultV2DataAttributesFileMetadataLocalFile object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2DataAttributesFileMetadataLocalFile + tableResultV2DataAttributesFileMetadataLocalFile = + (TableResultV2DataAttributesFileMetadataLocalFile) o; + return Objects.equals( + this.errorMessage, tableResultV2DataAttributesFileMetadataLocalFile.errorMessage) + && Objects.equals( + this.errorRowCount, tableResultV2DataAttributesFileMetadataLocalFile.errorRowCount) + && Objects.equals(this.uploadId, tableResultV2DataAttributesFileMetadataLocalFile.uploadId) + && Objects.equals( + this.additionalProperties, + tableResultV2DataAttributesFileMetadataLocalFile.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(errorMessage, errorRowCount, uploadId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2DataAttributesFileMetadataLocalFile {\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" errorRowCount: ").append(toIndentedString(errorRowCount)).append("\n"); + sb.append(" uploadId: ").append(toIndentedString(uploadId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetails.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetails.java new file mode 100644 index 00000000000..96b0ddb2d4c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetails.java @@ -0,0 +1,216 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of TableResultV2DataAttributesFileMetadataOneOfAccessDetails object. + */ +@JsonPropertyOrder({ + TableResultV2DataAttributesFileMetadataOneOfAccessDetails.JSON_PROPERTY_AWS_DETAIL, + TableResultV2DataAttributesFileMetadataOneOfAccessDetails.JSON_PROPERTY_AZURE_DETAIL, + TableResultV2DataAttributesFileMetadataOneOfAccessDetails.JSON_PROPERTY_GCP_DETAIL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2DataAttributesFileMetadataOneOfAccessDetails { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AWS_DETAIL = "aws_detail"; + private TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsDetail; + + public static final String JSON_PROPERTY_AZURE_DETAIL = "azure_detail"; + private TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureDetail; + + public static final String JSON_PROPERTY_GCP_DETAIL = "gcp_detail"; + private TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpDetail; + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetails awsDetail( + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsDetail) { + this.awsDetail = awsDetail; + this.unparsed |= awsDetail.unparsed; + return this; + } + + /** + * The definition of TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail + * object. + * + * @return awsDetail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail getAwsDetail() { + return awsDetail; + } + + public void setAwsDetail( + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsDetail) { + this.awsDetail = awsDetail; + } + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetails azureDetail( + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureDetail) { + this.azureDetail = azureDetail; + this.unparsed |= azureDetail.unparsed; + return this; + } + + /** + * The definition of TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + * object. + * + * @return azureDetail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail getAzureDetail() { + return azureDetail; + } + + public void setAzureDetail( + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureDetail) { + this.azureDetail = azureDetail; + } + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetails gcpDetail( + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpDetail) { + this.gcpDetail = gcpDetail; + this.unparsed |= gcpDetail.unparsed; + return this; + } + + /** + * The definition of TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail + * object. + * + * @return gcpDetail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCP_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail getGcpDetail() { + return gcpDetail; + } + + public void setGcpDetail( + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpDetail) { + this.gcpDetail = gcpDetail; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2DataAttributesFileMetadataOneOfAccessDetails + */ + @JsonAnySetter + public TableResultV2DataAttributesFileMetadataOneOfAccessDetails putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this TableResultV2DataAttributesFileMetadataOneOfAccessDetails object is equal + * to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2DataAttributesFileMetadataOneOfAccessDetails + tableResultV2DataAttributesFileMetadataOneOfAccessDetails = + (TableResultV2DataAttributesFileMetadataOneOfAccessDetails) o; + return Objects.equals( + this.awsDetail, tableResultV2DataAttributesFileMetadataOneOfAccessDetails.awsDetail) + && Objects.equals( + this.azureDetail, tableResultV2DataAttributesFileMetadataOneOfAccessDetails.azureDetail) + && Objects.equals( + this.gcpDetail, tableResultV2DataAttributesFileMetadataOneOfAccessDetails.gcpDetail) + && Objects.equals( + this.additionalProperties, + tableResultV2DataAttributesFileMetadataOneOfAccessDetails.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(awsDetail, azureDetail, gcpDetail, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2DataAttributesFileMetadataOneOfAccessDetails {\n"); + sb.append(" awsDetail: ").append(toIndentedString(awsDetail)).append("\n"); + sb.append(" azureDetail: ").append(toIndentedString(azureDetail)).append("\n"); + sb.append(" gcpDetail: ").append(toIndentedString(gcpDetail)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java new file mode 100644 index 00000000000..f594a29b6f6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail.java @@ -0,0 +1,212 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail + * object. + */ +@JsonPropertyOrder({ + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail.JSON_PROPERTY_AWS_ACCOUNT_ID, + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail.JSON_PROPERTY_AWS_BUCKET_NAME, + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail.JSON_PROPERTY_FILE_PATH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AWS_ACCOUNT_ID = "aws_account_id"; + private String awsAccountId; + + public static final String JSON_PROPERTY_AWS_BUCKET_NAME = "aws_bucket_name"; + private String awsBucketName; + + public static final String JSON_PROPERTY_FILE_PATH = "file_path"; + private String filePath; + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsAccountId( + String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * The ID of the AWS account. + * + * @return awsAccountId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAwsAccountId() { + return awsAccountId; + } + + public void setAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + } + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail awsBucketName( + String awsBucketName) { + this.awsBucketName = awsBucketName; + return this; + } + + /** + * The name of the AWS bucket. + * + * @return awsBucketName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_BUCKET_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAwsBucketName() { + return awsBucketName; + } + + public void setAwsBucketName(String awsBucketName) { + this.awsBucketName = awsBucketName; + } + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail filePath( + String filePath) { + this.filePath = filePath; + return this; + } + + /** + * The relative file path from the S3 bucket root to the CSV file. + * + * @return filePath + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail + */ + @JsonAnySetter + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail object + * is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail = + (TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail) o; + return Objects.equals( + this.awsAccountId, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail.awsAccountId) + && Objects.equals( + this.awsBucketName, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail.awsBucketName) + && Objects.equals( + this.filePath, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail.filePath) + && Objects.equals( + this.additionalProperties, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(awsAccountId, awsBucketName, filePath, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail {\n"); + sb.append(" awsAccountId: ").append(toIndentedString(awsAccountId)).append("\n"); + sb.append(" awsBucketName: ").append(toIndentedString(awsBucketName)).append("\n"); + sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java new file mode 100644 index 00000000000..62cad79f50d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail.java @@ -0,0 +1,286 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + * object. + */ +@JsonPropertyOrder({ + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_CLIENT_ID, + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_CONTAINER_NAME, + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_STORAGE_ACCOUNT_NAME, + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .JSON_PROPERTY_AZURE_TENANT_ID, + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail.JSON_PROPERTY_FILE_PATH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AZURE_CLIENT_ID = "azure_client_id"; + private String azureClientId; + + public static final String JSON_PROPERTY_AZURE_CONTAINER_NAME = "azure_container_name"; + private String azureContainerName; + + public static final String JSON_PROPERTY_AZURE_STORAGE_ACCOUNT_NAME = + "azure_storage_account_name"; + private String azureStorageAccountName; + + public static final String JSON_PROPERTY_AZURE_TENANT_ID = "azure_tenant_id"; + private String azureTenantId; + + public static final String JSON_PROPERTY_FILE_PATH = "file_path"; + private String filePath; + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureClientId( + String azureClientId) { + this.azureClientId = azureClientId; + return this; + } + + /** + * The Azure client ID. + * + * @return azureClientId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAzureClientId() { + return azureClientId; + } + + public void setAzureClientId(String azureClientId) { + this.azureClientId = azureClientId; + } + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureContainerName( + String azureContainerName) { + this.azureContainerName = azureContainerName; + return this; + } + + /** + * The name of the Azure container. + * + * @return azureContainerName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_CONTAINER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAzureContainerName() { + return azureContainerName; + } + + public void setAzureContainerName(String azureContainerName) { + this.azureContainerName = azureContainerName; + } + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + azureStorageAccountName(String azureStorageAccountName) { + this.azureStorageAccountName = azureStorageAccountName; + return this; + } + + /** + * The name of the Azure storage account. + * + * @return azureStorageAccountName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_STORAGE_ACCOUNT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAzureStorageAccountName() { + return azureStorageAccountName; + } + + public void setAzureStorageAccountName(String azureStorageAccountName) { + this.azureStorageAccountName = azureStorageAccountName; + } + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail azureTenantId( + String azureTenantId) { + this.azureTenantId = azureTenantId; + return this; + } + + /** + * The ID of the Azure tenant. + * + * @return azureTenantId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_TENANT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAzureTenantId() { + return azureTenantId; + } + + public void setAzureTenantId(String azureTenantId) { + this.azureTenantId = azureTenantId; + } + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail filePath( + String filePath) { + this.filePath = filePath; + return this; + } + + /** + * The relative file path from the Azure container root to the CSV file. + * + * @return filePath + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + */ + @JsonAnySetter + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail object + * is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail = + (TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail) o; + return Objects.equals( + this.azureClientId, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail.azureClientId) + && Objects.equals( + this.azureContainerName, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail.azureContainerName) + && Objects.equals( + this.azureStorageAccountName, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .azureStorageAccountName) + && Objects.equals( + this.azureTenantId, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail.azureTenantId) + && Objects.equals( + this.filePath, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail.filePath) + && Objects.equals( + this.additionalProperties, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + azureClientId, + azureContainerName, + azureStorageAccountName, + azureTenantId, + filePath, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail {\n"); + sb.append(" azureClientId: ").append(toIndentedString(azureClientId)).append("\n"); + sb.append(" azureContainerName: ").append(toIndentedString(azureContainerName)).append("\n"); + sb.append(" azureStorageAccountName: ") + .append(toIndentedString(azureStorageAccountName)) + .append("\n"); + sb.append(" azureTenantId: ").append(toIndentedString(azureTenantId)).append("\n"); + sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java new file mode 100644 index 00000000000..20ebf029082 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail.java @@ -0,0 +1,247 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail + * object. + */ +@JsonPropertyOrder({ + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail.JSON_PROPERTY_FILE_PATH, + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail.JSON_PROPERTY_GCP_BUCKET_NAME, + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail.JSON_PROPERTY_GCP_PROJECT_ID, + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .JSON_PROPERTY_GCP_SERVICE_ACCOUNT_EMAIL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FILE_PATH = "file_path"; + private String filePath; + + public static final String JSON_PROPERTY_GCP_BUCKET_NAME = "gcp_bucket_name"; + private String gcpBucketName; + + public static final String JSON_PROPERTY_GCP_PROJECT_ID = "gcp_project_id"; + private String gcpProjectId; + + public static final String JSON_PROPERTY_GCP_SERVICE_ACCOUNT_EMAIL = "gcp_service_account_email"; + private String gcpServiceAccountEmail; + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail filePath( + String filePath) { + this.filePath = filePath; + return this; + } + + /** + * The relative file path from the GCS bucket root to the CSV file. + * + * @return filePath + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpBucketName( + String gcpBucketName) { + this.gcpBucketName = gcpBucketName; + return this; + } + + /** + * The name of the GCP bucket. + * + * @return gcpBucketName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCP_BUCKET_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGcpBucketName() { + return gcpBucketName; + } + + public void setGcpBucketName(String gcpBucketName) { + this.gcpBucketName = gcpBucketName; + } + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpProjectId( + String gcpProjectId) { + this.gcpProjectId = gcpProjectId; + return this; + } + + /** + * The ID of the GCP project. + * + * @return gcpProjectId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCP_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGcpProjectId() { + return gcpProjectId; + } + + public void setGcpProjectId(String gcpProjectId) { + this.gcpProjectId = gcpProjectId; + } + + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail gcpServiceAccountEmail( + String gcpServiceAccountEmail) { + this.gcpServiceAccountEmail = gcpServiceAccountEmail; + return this; + } + + /** + * The email of the GCP service account. + * + * @return gcpServiceAccountEmail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCP_SERVICE_ACCOUNT_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGcpServiceAccountEmail() { + return gcpServiceAccountEmail; + } + + public void setGcpServiceAccountEmail(String gcpServiceAccountEmail) { + this.gcpServiceAccountEmail = gcpServiceAccountEmail; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail + */ + @JsonAnySetter + public TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail object + * is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail = + (TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail) o; + return Objects.equals( + this.filePath, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail.filePath) + && Objects.equals( + this.gcpBucketName, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail.gcpBucketName) + && Objects.equals( + this.gcpProjectId, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail.gcpProjectId) + && Objects.equals( + this.gcpServiceAccountEmail, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .gcpServiceAccountEmail) + && Objects.equals( + this.additionalProperties, + tableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + filePath, gcpBucketName, gcpProjectId, gcpServiceAccountEmail, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail {\n"); + sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); + sb.append(" gcpBucketName: ").append(toIndentedString(gcpBucketName)).append("\n"); + sb.append(" gcpProjectId: ").append(toIndentedString(gcpProjectId)).append("\n"); + sb.append(" gcpServiceAccountEmail: ") + .append(toIndentedString(gcpServiceAccountEmail)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesSchema.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesSchema.java new file mode 100644 index 00000000000..ba5d57d0a71 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesSchema.java @@ -0,0 +1,195 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of TableResultV2DataAttributesSchema object. */ +@JsonPropertyOrder({ + TableResultV2DataAttributesSchema.JSON_PROPERTY_FIELDS, + TableResultV2DataAttributesSchema.JSON_PROPERTY_PRIMARY_KEYS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2DataAttributesSchema { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIELDS = "fields"; + private List fields = new ArrayList<>(); + + public static final String JSON_PROPERTY_PRIMARY_KEYS = "primary_keys"; + private List primaryKeys = new ArrayList<>(); + + public TableResultV2DataAttributesSchema() {} + + @JsonCreator + public TableResultV2DataAttributesSchema( + @JsonProperty(required = true, value = JSON_PROPERTY_FIELDS) + List fields, + @JsonProperty(required = true, value = JSON_PROPERTY_PRIMARY_KEYS) List primaryKeys) { + this.fields = fields; + this.primaryKeys = primaryKeys; + } + + public TableResultV2DataAttributesSchema fields( + List fields) { + this.fields = fields; + for (TableResultV2DataAttributesSchemaFieldsItems item : fields) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TableResultV2DataAttributesSchema addFieldsItem( + TableResultV2DataAttributesSchemaFieldsItems fieldsItem) { + this.fields.add(fieldsItem); + this.unparsed |= fieldsItem.unparsed; + return this; + } + + /** + * The schema fields. + * + * @return fields + */ + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFields() { + return fields; + } + + public void setFields(List fields) { + this.fields = fields; + } + + public TableResultV2DataAttributesSchema primaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + return this; + } + + public TableResultV2DataAttributesSchema addPrimaryKeysItem(String primaryKeysItem) { + this.primaryKeys.add(primaryKeysItem); + return this; + } + + /** + * List of field names that serve as primary keys for the table. Currently only 1 primary key is + * supported, and it is used as an ID to retrieve rows. + * + * @return primaryKeys + */ + @JsonProperty(JSON_PROPERTY_PRIMARY_KEYS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPrimaryKeys() { + return primaryKeys; + } + + public void setPrimaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2DataAttributesSchema + */ + @JsonAnySetter + public TableResultV2DataAttributesSchema putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TableResultV2DataAttributesSchema object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2DataAttributesSchema tableResultV2DataAttributesSchema = + (TableResultV2DataAttributesSchema) o; + return Objects.equals(this.fields, tableResultV2DataAttributesSchema.fields) + && Objects.equals(this.primaryKeys, tableResultV2DataAttributesSchema.primaryKeys) + && Objects.equals( + this.additionalProperties, tableResultV2DataAttributesSchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, primaryKeys, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2DataAttributesSchema {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" primaryKeys: ").append(toIndentedString(primaryKeys)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesSchemaFieldsItems.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesSchemaFieldsItems.java new file mode 100644 index 00000000000..733c6f714db --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataAttributesSchemaFieldsItems.java @@ -0,0 +1,183 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of TableResultV2DataAttributesSchemaFieldsItems object. */ +@JsonPropertyOrder({ + TableResultV2DataAttributesSchemaFieldsItems.JSON_PROPERTY_NAME, + TableResultV2DataAttributesSchemaFieldsItems.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableResultV2DataAttributesSchemaFieldsItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ReferenceTableSchemaFieldType type; + + public TableResultV2DataAttributesSchemaFieldsItems() {} + + @JsonCreator + public TableResultV2DataAttributesSchemaFieldsItems( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ReferenceTableSchemaFieldType type) { + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TableResultV2DataAttributesSchemaFieldsItems name(String name) { + this.name = name; + return this; + } + + /** + * The field name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TableResultV2DataAttributesSchemaFieldsItems type(ReferenceTableSchemaFieldType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The field type for reference table schema fields. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReferenceTableSchemaFieldType getType() { + return type; + } + + public void setType(ReferenceTableSchemaFieldType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableResultV2DataAttributesSchemaFieldsItems + */ + @JsonAnySetter + public TableResultV2DataAttributesSchemaFieldsItems putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TableResultV2DataAttributesSchemaFieldsItems object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableResultV2DataAttributesSchemaFieldsItems tableResultV2DataAttributesSchemaFieldsItems = + (TableResultV2DataAttributesSchemaFieldsItems) o; + return Objects.equals(this.name, tableResultV2DataAttributesSchemaFieldsItems.name) + && Objects.equals(this.type, tableResultV2DataAttributesSchemaFieldsItems.type) + && Objects.equals( + this.additionalProperties, + tableResultV2DataAttributesSchemaFieldsItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableResultV2DataAttributesSchemaFieldsItems {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataType.java b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataType.java new file mode 100644 index 00000000000..ffcbc3a2572 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableResultV2DataType.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Reference table resource type. */ +@JsonSerialize(using = TableResultV2DataType.TableResultV2DataTypeSerializer.class) +public class TableResultV2DataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("reference_table")); + + public static final TableResultV2DataType REFERENCE_TABLE = + new TableResultV2DataType("reference_table"); + + TableResultV2DataType(String value) { + super(value, allowedValues); + } + + public static class TableResultV2DataTypeSerializer extends StdSerializer { + public TableResultV2DataTypeSerializer(Class t) { + super(t); + } + + public TableResultV2DataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TableResultV2DataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TableResultV2DataType fromValue(String value) { + return new TableResultV2DataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableRowResourceArray.java b/src/main/java/com/datadog/api/client/v2/model/TableRowResourceArray.java new file mode 100644 index 00000000000..d70ba0eb2c2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableRowResourceArray.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of TableRowResourceArray object. */ +@JsonPropertyOrder({TableRowResourceArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableRowResourceArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public TableRowResourceArray() {} + + @JsonCreator + public TableRowResourceArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public TableRowResourceArray data(List data) { + this.data = data; + for (TableRowResourceData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TableRowResourceArray addDataItem(TableRowResourceData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The rows. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableRowResourceArray + */ + @JsonAnySetter + public TableRowResourceArray putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TableRowResourceArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableRowResourceArray tableRowResourceArray = (TableRowResourceArray) o; + return Objects.equals(this.data, tableRowResourceArray.data) + && Objects.equals(this.additionalProperties, tableRowResourceArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableRowResourceArray {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableRowResourceData.java b/src/main/java/com/datadog/api/client/v2/model/TableRowResourceData.java new file mode 100644 index 00000000000..6768e084162 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableRowResourceData.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of TableRowResourceData object. */ +@JsonPropertyOrder({ + TableRowResourceData.JSON_PROPERTY_ATTRIBUTES, + TableRowResourceData.JSON_PROPERTY_ID, + TableRowResourceData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableRowResourceData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TableRowResourceDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TableRowResourceDataType type = TableRowResourceDataType.ROW; + + public TableRowResourceData() {} + + @JsonCreator + public TableRowResourceData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TableRowResourceDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TableRowResourceData attributes(TableRowResourceDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of TableRowResourceDataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableRowResourceDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TableRowResourceDataAttributes attributes) { + this.attributes = attributes; + } + + public TableRowResourceData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the row. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TableRowResourceData type(TableRowResourceDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Row resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TableRowResourceDataType getType() { + return type; + } + + public void setType(TableRowResourceDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableRowResourceData + */ + @JsonAnySetter + public TableRowResourceData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TableRowResourceData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableRowResourceData tableRowResourceData = (TableRowResourceData) o; + return Objects.equals(this.attributes, tableRowResourceData.attributes) + && Objects.equals(this.id, tableRowResourceData.id) + && Objects.equals(this.type, tableRowResourceData.type) + && Objects.equals(this.additionalProperties, tableRowResourceData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableRowResourceData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableRowResourceDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TableRowResourceDataAttributes.java new file mode 100644 index 00000000000..37605e2657f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableRowResourceDataAttributes.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of TableRowResourceDataAttributes object. */ +@JsonPropertyOrder({TableRowResourceDataAttributes.JSON_PROPERTY_VALUES}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TableRowResourceDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_VALUES = "values"; + private Map values = null; + + public TableRowResourceDataAttributes values(Map values) { + this.values = values; + return this; + } + + public TableRowResourceDataAttributes putValuesItem(String key, Object valuesItem) { + if (this.values == null) { + this.values = new HashMap<>(); + } + this.values.put(key, valuesItem); + return this; + } + + /** + * The values of the row. + * + * @return values + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getValues() { + return values; + } + + public void setValues(Map values) { + this.values = values; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TableRowResourceDataAttributes + */ + @JsonAnySetter + public TableRowResourceDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TableRowResourceDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableRowResourceDataAttributes tableRowResourceDataAttributes = + (TableRowResourceDataAttributes) o; + return Objects.equals(this.values, tableRowResourceDataAttributes.values) + && Objects.equals( + this.additionalProperties, tableRowResourceDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(values, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableRowResourceDataAttributes {\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TableRowResourceDataType.java b/src/main/java/com/datadog/api/client/v2/model/TableRowResourceDataType.java new file mode 100644 index 00000000000..133b1c265ca --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TableRowResourceDataType.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Row resource type. */ +@JsonSerialize(using = TableRowResourceDataType.TableRowResourceDataTypeSerializer.class) +public class TableRowResourceDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("row")); + + public static final TableRowResourceDataType ROW = new TableRowResourceDataType("row"); + + TableRowResourceDataType(String value) { + super(value, allowedValues); + } + + public static class TableRowResourceDataTypeSerializer + extends StdSerializer { + public TableRowResourceDataTypeSerializer(Class t) { + super(t); + } + + public TableRowResourceDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TableRowResourceDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TableRowResourceDataType fromValue(String value) { + return new TableRowResourceDataType(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_reference_table_without_upload_or_access_details_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_reference_table_without_upload_or_access_details_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..2e6c5cff613 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_reference_table_without_upload_or_access_details_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-10-01T20:51:23.877Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_reference_table_without_upload_or_access_details_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_reference_table_without_upload_or_access_details_returns_Bad_Request_response.json new file mode 100644 index 00000000000..a740b520d68 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_reference_table_without_upload_or_access_details_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/reference-tables/tables", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"upload_id is required for tables with 'LOCAL_FILE' source\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b227430e-09ea-cae9-d1cd-62ee343d2443" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/reference_tables.feature b/src/test/resources/com/datadog/api/client/v2/api/reference_tables.feature new file mode 100644 index 00000000000..17e66019c05 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index c4c269d3cab..f57ef906513 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/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": {