diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 382c9233aa5..93b41388a76 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -12652,6 +12652,219 @@ components: type: string x-enum-varnames: - CLOUD_CONFIGURATION + CloudInventoryCloudProviderId: + description: |- + Cloud provider for this sync configuration (`aws`, `gcp`, or `azure`). For requests, must match the provider block supplied under `attributes`. + enum: + - aws + - gcp + - azure + example: aws + type: string + x-enum-varnames: + - AWS + - GCP + - AZURE + CloudInventoryCloudProviderRequestType: + description: JSON:API type for upsert sync configuration requests. + enum: + - cloud_provider + example: cloud_provider + type: string + x-enum-varnames: + - CLOUD_PROVIDER + CloudInventorySyncConfigAWSRequestAttributes: + description: AWS settings for the customer bucket that stores inventory reports. + properties: + aws_account_id: + description: AWS account ID that owns the inventory bucket. + example: "123456789012" + type: string + destination_bucket_name: + description: Name of the S3 bucket containing inventory files. + example: my-inventory-bucket + type: string + destination_bucket_region: + description: AWS Region of the inventory bucket. + example: us-east-1 + type: string + destination_prefix: + description: Optional object key prefix for inventory files. Use `/` or omit for the entire bucket. + example: logs/ + type: string + required: + - aws_account_id + - destination_bucket_name + - destination_bucket_region + type: object + CloudInventorySyncConfigAttributes: + description: Attributes for a cloud inventory sync configuration. Values beyond `id` may be omitted immediately after upsert. + properties: + aws_account_id: + description: AWS account ID for the inventory bucket. + example: "123456789012" + type: string + aws_bucket_name: + description: AWS S3 bucket name for inventory files. + example: my-inventory-bucket + type: string + aws_region: + description: AWS Region for the inventory bucket. + example: us-east-1 + type: string + azure_client_id: + description: Azure AD application (client) ID. + example: 11111111-1111-1111-1111-111111111111 + type: string + azure_container_name: + description: Azure blob container name. + example: inventory-container + type: string + azure_storage_account_name: + description: Azure storage account name. + example: mystorageaccount + type: string + azure_tenant_id: + description: Azure AD tenant ID. + example: 22222222-2222-2222-2222-222222222222 + type: string + cloud_provider: + $ref: "#/components/schemas/CloudInventoryCloudProviderId" + error: + description: Human-readable error detail when sync is unhealthy. + example: "" + readOnly: true + type: string + error_code: + description: Machine-readable error code when sync is unhealthy. + example: "" + readOnly: true + type: string + gcp_bucket_name: + description: GCS bucket name for inventory files Datadog reads. + example: my-inventory-reports + type: string + gcp_project_id: + description: GCP project ID. + example: my-gcp-project + type: string + gcp_service_account_email: + description: Service account email for bucket access. + example: reader@my-gcp-project.iam.gserviceaccount.com + type: string + prefix: + description: Object key prefix or `/` when the entire bucket is synced. + example: logs/ + readOnly: true + type: string + required: + - aws_bucket_name + - aws_account_id + - aws_region + - azure_storage_account_name + - azure_container_name + - azure_client_id + - azure_tenant_id + - gcp_bucket_name + - gcp_project_id + - gcp_service_account_email + - cloud_provider + - prefix + - error + - error_code + type: object + CloudInventorySyncConfigAzureRequestAttributes: + description: Azure settings for the storage account and container with inventory data. + properties: + client_id: + description: Azure AD application (client) ID used for access. + example: 11111111-1111-1111-1111-111111111111 + type: string + container: + description: Blob container name. + example: inventory-container + type: string + resource_group: + description: Resource group containing the storage account. + example: my-resource-group + type: string + storage_account: + description: Storage account name. + example: mystorageaccount + type: string + subscription_id: + description: Azure subscription ID. + example: 33333333-3333-3333-3333-333333333333 + type: string + tenant_id: + description: Azure AD tenant ID. + example: 22222222-2222-2222-2222-222222222222 + type: string + required: + - client_id + - tenant_id + - subscription_id + - resource_group + - storage_account + - container + type: object + CloudInventorySyncConfigGCPRequestAttributes: + description: GCP settings for buckets involved in inventory reporting. + properties: + destination_bucket_name: + description: GCS bucket name where Datadog reads inventory reports. + example: my-inventory-reports + type: string + project_id: + description: GCP project ID for the inventory destination bucket. + example: my-gcp-project + type: string + service_account_email: + description: Service account email used to read the destination bucket. + example: reader@my-gcp-project.iam.gserviceaccount.com + type: string + source_bucket_name: + description: GCS bucket name that inventory reports are generated for. + example: my-monitored-bucket + type: string + required: + - project_id + - destination_bucket_name + - source_bucket_name + - service_account_email + type: object + CloudInventorySyncConfigResourceType: + description: JSON:API type for sync configuration resources. + enum: + - sync_configs + example: sync_configs + type: string + x-enum-varnames: + - SYNC_CONFIGS + CloudInventorySyncConfigResponse: + description: Response containing the upserted sync configuration. Additional read-only fields appear on list and get. + properties: + data: + $ref: "#/components/schemas/CloudInventorySyncConfigResponseData" + required: + - data + type: object + CloudInventorySyncConfigResponseData: + description: JSON:API data object for a sync configuration. + properties: + attributes: + $ref: "#/components/schemas/CloudInventorySyncConfigAttributes" + id: + description: Unique identifier for the recurring sync configuration. + example: abc123 + type: string + type: + $ref: "#/components/schemas/CloudInventorySyncConfigResourceType" + required: + - id + - type + - attributes + type: object CloudWorkloadSecurityAgentPoliciesListResponse: description: "Response object that includes a list of Agent policies" properties: @@ -80681,6 +80894,39 @@ components: meta: $ref: "#/components/schemas/KindResponseMeta" type: object + UpsertCloudInventorySyncConfigRequest: + description: Request body for creating or updating a cloud inventory sync configuration. + properties: + data: + $ref: "#/components/schemas/UpsertCloudInventorySyncConfigRequestData" + required: + - data + type: object + UpsertCloudInventorySyncConfigRequestAttributes: + description: |- + Provider-specific configuration. Include the object that matches `data.id` (`aws`, `gcp`, or `azure`). + properties: + aws: + $ref: "#/components/schemas/CloudInventorySyncConfigAWSRequestAttributes" + azure: + $ref: "#/components/schemas/CloudInventorySyncConfigAzureRequestAttributes" + gcp: + $ref: "#/components/schemas/CloudInventorySyncConfigGCPRequestAttributes" + type: object + UpsertCloudInventorySyncConfigRequestData: + description: JSON:API data envelope for an upsert sync configuration request. + properties: + attributes: + $ref: "#/components/schemas/UpsertCloudInventorySyncConfigRequestAttributes" + id: + $ref: "#/components/schemas/CloudInventoryCloudProviderId" + type: + $ref: "#/components/schemas/CloudInventoryCloudProviderRequestType" + required: + - type + - id + - attributes + type: object Urgency: description: Specifies the level of urgency for a routing rule (low, high, or dynamic). enum: @@ -82895,6 +83141,7 @@ components: apm_service_catalog_read: View service catalog and service definitions. apm_service_catalog_write: Add, modify, and delete service catalog definitions when those definitions are maintained by Datadog. appsec_vm_read: View infrastructure, application code, and library vulnerability findings. + aws_configurations_manage: Manage AWS integration account configurations and related integration settings. billing_read: View your organization's billing information. bits_investigations_read: View Bits AI investigations. bits_investigations_write: Create and manage Bits AI investigations. @@ -91595,6 +91842,59 @@ paths: operator: OR permissions: - security_monitoring_filters_write + /api/v2/cloudinventoryservice/syncconfigs: + put: + description: |- + Create or update a cloud inventory sync configuration. Specify the cloud provider in `data.id` + and provider-specific settings under `data.attributes`. This endpoint uses an upsert model. + operationId: UpsertSyncConfig + requestBody: + content: + application/json: + examples: + default: + summary: AWS inventory bucket + value: + data: + attributes: + aws: + aws_account_id: "123456789012" + destination_bucket_name: my-inventory-bucket + destination_bucket_region: us-east-1 + destination_prefix: logs/ + id: aws + type: cloud_provider + schema: + $ref: "#/components/schemas/UpsertCloudInventorySyncConfigRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/CloudInventorySyncConfigResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create or update a sync configuration + tags: + - Cloud Inventory Sync Configs + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - aws_configurations_manage + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/code-coverage/branch/summary: post: description: |- @@ -134830,6 +135130,9 @@ tags: - description: |- The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS, Azure, and Google Cloud. You can query your cost data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products) and the `cloud_cost` data source. For more information, see the [Cloud Cost Management documentation](https://docs.datadoghq.com/cloud_cost_management/). name: Cloud Cost Management + - description: |- + Configure cloud inventory file synchronization from your cloud storage to Datadog. + name: Cloud Inventory Sync Configs - description: |- The Cloud Network Monitoring API allows you to fetch aggregated connections and DNS traffic with their attributes. See the [Cloud Network Monitoring page](https://docs.datadoghq.com/network_monitoring/cloud_network_monitoring/) and [DNS Monitoring page](https://docs.datadoghq.com/network_monitoring/dns/) for more information. name: Cloud Network Monitoring diff --git a/examples/v2/cloud-inventory-sync-configs/UpsertSyncConfig.java b/examples/v2/cloud-inventory-sync-configs/UpsertSyncConfig.java new file mode 100644 index 00000000000..03716b01aa3 --- /dev/null +++ b/examples/v2/cloud-inventory-sync-configs/UpsertSyncConfig.java @@ -0,0 +1,63 @@ +// Create or update a sync configuration returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudInventorySyncConfigsApi; +import com.datadog.api.client.v2.model.CloudInventoryCloudProviderId; +import com.datadog.api.client.v2.model.CloudInventoryCloudProviderRequestType; +import com.datadog.api.client.v2.model.CloudInventorySyncConfigAWSRequestAttributes; +import com.datadog.api.client.v2.model.CloudInventorySyncConfigAzureRequestAttributes; +import com.datadog.api.client.v2.model.CloudInventorySyncConfigGCPRequestAttributes; +import com.datadog.api.client.v2.model.CloudInventorySyncConfigResponse; +import com.datadog.api.client.v2.model.UpsertCloudInventorySyncConfigRequest; +import com.datadog.api.client.v2.model.UpsertCloudInventorySyncConfigRequestAttributes; +import com.datadog.api.client.v2.model.UpsertCloudInventorySyncConfigRequestData; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.upsertSyncConfig", true); + CloudInventorySyncConfigsApi apiInstance = new CloudInventorySyncConfigsApi(defaultClient); + + UpsertCloudInventorySyncConfigRequest body = + new UpsertCloudInventorySyncConfigRequest() + .data( + new UpsertCloudInventorySyncConfigRequestData() + .attributes( + new UpsertCloudInventorySyncConfigRequestAttributes() + .aws( + new CloudInventorySyncConfigAWSRequestAttributes() + .awsAccountId("123456789012") + .destinationBucketName("my-inventory-bucket") + .destinationBucketRegion("us-east-1") + .destinationPrefix("logs/")) + .azure( + new CloudInventorySyncConfigAzureRequestAttributes() + .clientId("11111111-1111-1111-1111-111111111111") + .container("inventory-container") + .resourceGroup("my-resource-group") + .storageAccount("mystorageaccount") + .subscriptionId("33333333-3333-3333-3333-333333333333") + .tenantId("22222222-2222-2222-2222-222222222222")) + .gcp( + new CloudInventorySyncConfigGCPRequestAttributes() + .destinationBucketName("my-inventory-reports") + .projectId("my-gcp-project") + .serviceAccountEmail( + "reader@my-gcp-project.iam.gserviceaccount.com") + .sourceBucketName("my-monitored-bucket"))) + .id(CloudInventoryCloudProviderId.AWS) + .type(CloudInventoryCloudProviderRequestType.CLOUD_PROVIDER)); + + try { + CloudInventorySyncConfigResponse result = apiInstance.upsertSyncConfig(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CloudInventorySyncConfigsApi#upsertSyncConfig"); + 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/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 9b9c702b3cb..e50cdd037c4 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -856,6 +856,7 @@ public class ApiClient { put("v2.muteSecurityFindings", false); put("v2.runHistoricalJob", false); put("v2.searchSecurityMonitoringHistsignals", false); + put("v2.upsertSyncConfig", false); put("v2.getCodeCoverageBranchSummary", false); put("v2.getCodeCoverageCommitSummary", false); put("v2.createDashboardSecureEmbed", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/CloudInventorySyncConfigsApi.java b/src/main/java/com/datadog/api/client/v2/api/CloudInventorySyncConfigsApi.java new file mode 100644 index 00000000000..b3db1b27f38 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/CloudInventorySyncConfigsApi.java @@ -0,0 +1,201 @@ +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.CloudInventorySyncConfigResponse; +import com.datadog.api.client.v2.model.UpsertCloudInventorySyncConfigRequest; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +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 CloudInventorySyncConfigsApi { + private ApiClient apiClient; + + public CloudInventorySyncConfigsApi() { + this(ApiClient.getDefaultApiClient()); + } + + public CloudInventorySyncConfigsApi(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 or update a sync configuration. + * + *

See {@link #upsertSyncConfigWithHttpInfo}. + * + * @param body (required) + * @return CloudInventorySyncConfigResponse + * @throws ApiException if fails to make API call + */ + public CloudInventorySyncConfigResponse upsertSyncConfig( + UpsertCloudInventorySyncConfigRequest body) throws ApiException { + return upsertSyncConfigWithHttpInfo(body).getData(); + } + + /** + * Create or update a sync configuration. + * + *

See {@link #upsertSyncConfigWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<CloudInventorySyncConfigResponse> + */ + public CompletableFuture upsertSyncConfigAsync( + UpsertCloudInventorySyncConfigRequest body) { + return upsertSyncConfigWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create or update a cloud inventory sync configuration. Specify the cloud provider in + * data.id and provider-specific settings under data.attributes. This endpoint + * uses an upsert model. + * + * @param body (required) + * @return ApiResponse<CloudInventorySyncConfigResponse> + * @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 upsertSyncConfigWithHttpInfo( + UpsertCloudInventorySyncConfigRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "upsertSyncConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling upsertSyncConfig"); + } + // create path and map variables + String localVarPath = "/api/v2/cloudinventoryservice/syncconfigs"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudInventorySyncConfigsApi.upsertSyncConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create or update a sync configuration. + * + *

See {@link #upsertSyncConfigWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<CloudInventorySyncConfigResponse>> + */ + public CompletableFuture> + upsertSyncConfigWithHttpInfoAsync(UpsertCloudInventorySyncConfigRequest body) { + // Check if unstable operation is enabled + String operationId = "upsertSyncConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + 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 upsertSyncConfig")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cloudinventoryservice/syncconfigs"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudInventorySyncConfigsApi.upsertSyncConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CloudInventoryCloudProviderId.java b/src/main/java/com/datadog/api/client/v2/model/CloudInventoryCloudProviderId.java new file mode 100644 index 00000000000..ec2c31f4c2e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CloudInventoryCloudProviderId.java @@ -0,0 +1,62 @@ +/* + * 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; + +/** + * Cloud provider for this sync configuration (aws, gcp, or azure + * ). For requests, must match the provider block supplied under attributes. + */ +@JsonSerialize(using = CloudInventoryCloudProviderId.CloudInventoryCloudProviderIdSerializer.class) +public class CloudInventoryCloudProviderId extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("aws", "gcp", "azure")); + + public static final CloudInventoryCloudProviderId AWS = new CloudInventoryCloudProviderId("aws"); + public static final CloudInventoryCloudProviderId GCP = new CloudInventoryCloudProviderId("gcp"); + public static final CloudInventoryCloudProviderId AZURE = + new CloudInventoryCloudProviderId("azure"); + + CloudInventoryCloudProviderId(String value) { + super(value, allowedValues); + } + + public static class CloudInventoryCloudProviderIdSerializer + extends StdSerializer { + public CloudInventoryCloudProviderIdSerializer(Class t) { + super(t); + } + + public CloudInventoryCloudProviderIdSerializer() { + this(null); + } + + @Override + public void serialize( + CloudInventoryCloudProviderId value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CloudInventoryCloudProviderId fromValue(String value) { + return new CloudInventoryCloudProviderId(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CloudInventoryCloudProviderRequestType.java b/src/main/java/com/datadog/api/client/v2/model/CloudInventoryCloudProviderRequestType.java new file mode 100644 index 00000000000..6347ade1647 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CloudInventoryCloudProviderRequestType.java @@ -0,0 +1,63 @@ +/* + * 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; + +/** JSON:API type for upsert sync configuration requests. */ +@JsonSerialize( + using = + CloudInventoryCloudProviderRequestType.CloudInventoryCloudProviderRequestTypeSerializer + .class) +public class CloudInventoryCloudProviderRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cloud_provider")); + + public static final CloudInventoryCloudProviderRequestType CLOUD_PROVIDER = + new CloudInventoryCloudProviderRequestType("cloud_provider"); + + CloudInventoryCloudProviderRequestType(String value) { + super(value, allowedValues); + } + + public static class CloudInventoryCloudProviderRequestTypeSerializer + extends StdSerializer { + public CloudInventoryCloudProviderRequestTypeSerializer( + Class t) { + super(t); + } + + public CloudInventoryCloudProviderRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CloudInventoryCloudProviderRequestType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CloudInventoryCloudProviderRequestType fromValue(String value) { + return new CloudInventoryCloudProviderRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigAWSRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigAWSRequestAttributes.java new file mode 100644 index 00000000000..87d7ceda797 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigAWSRequestAttributes.java @@ -0,0 +1,252 @@ +/* + * 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; + +/** AWS settings for the customer bucket that stores inventory reports. */ +@JsonPropertyOrder({ + CloudInventorySyncConfigAWSRequestAttributes.JSON_PROPERTY_AWS_ACCOUNT_ID, + CloudInventorySyncConfigAWSRequestAttributes.JSON_PROPERTY_DESTINATION_BUCKET_NAME, + CloudInventorySyncConfigAWSRequestAttributes.JSON_PROPERTY_DESTINATION_BUCKET_REGION, + CloudInventorySyncConfigAWSRequestAttributes.JSON_PROPERTY_DESTINATION_PREFIX +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CloudInventorySyncConfigAWSRequestAttributes { + @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_DESTINATION_BUCKET_NAME = "destination_bucket_name"; + private String destinationBucketName; + + public static final String JSON_PROPERTY_DESTINATION_BUCKET_REGION = "destination_bucket_region"; + private String destinationBucketRegion; + + public static final String JSON_PROPERTY_DESTINATION_PREFIX = "destination_prefix"; + private String destinationPrefix; + + public CloudInventorySyncConfigAWSRequestAttributes() {} + + @JsonCreator + public CloudInventorySyncConfigAWSRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_AWS_ACCOUNT_ID) String awsAccountId, + @JsonProperty(required = true, value = JSON_PROPERTY_DESTINATION_BUCKET_NAME) + String destinationBucketName, + @JsonProperty(required = true, value = JSON_PROPERTY_DESTINATION_BUCKET_REGION) + String destinationBucketRegion) { + this.awsAccountId = awsAccountId; + this.destinationBucketName = destinationBucketName; + this.destinationBucketRegion = destinationBucketRegion; + } + + public CloudInventorySyncConfigAWSRequestAttributes awsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * AWS account ID that owns the inventory bucket. + * + * @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 CloudInventorySyncConfigAWSRequestAttributes destinationBucketName( + String destinationBucketName) { + this.destinationBucketName = destinationBucketName; + return this; + } + + /** + * Name of the S3 bucket containing inventory files. + * + * @return destinationBucketName + */ + @JsonProperty(JSON_PROPERTY_DESTINATION_BUCKET_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDestinationBucketName() { + return destinationBucketName; + } + + public void setDestinationBucketName(String destinationBucketName) { + this.destinationBucketName = destinationBucketName; + } + + public CloudInventorySyncConfigAWSRequestAttributes destinationBucketRegion( + String destinationBucketRegion) { + this.destinationBucketRegion = destinationBucketRegion; + return this; + } + + /** + * AWS Region of the inventory bucket. + * + * @return destinationBucketRegion + */ + @JsonProperty(JSON_PROPERTY_DESTINATION_BUCKET_REGION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDestinationBucketRegion() { + return destinationBucketRegion; + } + + public void setDestinationBucketRegion(String destinationBucketRegion) { + this.destinationBucketRegion = destinationBucketRegion; + } + + public CloudInventorySyncConfigAWSRequestAttributes destinationPrefix(String destinationPrefix) { + this.destinationPrefix = destinationPrefix; + return this; + } + + /** + * Optional object key prefix for inventory files. Use / or omit for the entire + * bucket. + * + * @return destinationPrefix + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESTINATION_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDestinationPrefix() { + return destinationPrefix; + } + + public void setDestinationPrefix(String destinationPrefix) { + this.destinationPrefix = destinationPrefix; + } + + /** + * 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 CloudInventorySyncConfigAWSRequestAttributes + */ + @JsonAnySetter + public CloudInventorySyncConfigAWSRequestAttributes 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 CloudInventorySyncConfigAWSRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudInventorySyncConfigAWSRequestAttributes cloudInventorySyncConfigAwsRequestAttributes = + (CloudInventorySyncConfigAWSRequestAttributes) o; + return Objects.equals( + this.awsAccountId, cloudInventorySyncConfigAwsRequestAttributes.awsAccountId) + && Objects.equals( + this.destinationBucketName, + cloudInventorySyncConfigAwsRequestAttributes.destinationBucketName) + && Objects.equals( + this.destinationBucketRegion, + cloudInventorySyncConfigAwsRequestAttributes.destinationBucketRegion) + && Objects.equals( + this.destinationPrefix, cloudInventorySyncConfigAwsRequestAttributes.destinationPrefix) + && Objects.equals( + this.additionalProperties, + cloudInventorySyncConfigAwsRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + awsAccountId, + destinationBucketName, + destinationBucketRegion, + destinationPrefix, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CloudInventorySyncConfigAWSRequestAttributes {\n"); + sb.append(" awsAccountId: ").append(toIndentedString(awsAccountId)).append("\n"); + sb.append(" destinationBucketName: ") + .append(toIndentedString(destinationBucketName)) + .append("\n"); + sb.append(" destinationBucketRegion: ") + .append(toIndentedString(destinationBucketRegion)) + .append("\n"); + sb.append(" destinationPrefix: ").append(toIndentedString(destinationPrefix)).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/CloudInventorySyncConfigAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigAttributes.java new file mode 100644 index 00000000000..a008f8a233d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigAttributes.java @@ -0,0 +1,523 @@ +/* + * 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; + +/** + * Attributes for a cloud inventory sync configuration. Values beyond id may be omitted + * immediately after upsert. + */ +@JsonPropertyOrder({ + CloudInventorySyncConfigAttributes.JSON_PROPERTY_AWS_ACCOUNT_ID, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_AWS_BUCKET_NAME, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_AWS_REGION, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_AZURE_CLIENT_ID, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_AZURE_CONTAINER_NAME, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_AZURE_STORAGE_ACCOUNT_NAME, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_AZURE_TENANT_ID, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_CLOUD_PROVIDER, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_ERROR, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_ERROR_CODE, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_GCP_BUCKET_NAME, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_GCP_PROJECT_ID, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_GCP_SERVICE_ACCOUNT_EMAIL, + CloudInventorySyncConfigAttributes.JSON_PROPERTY_PREFIX +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CloudInventorySyncConfigAttributes { + @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_AWS_REGION = "aws_region"; + private String awsRegion; + + 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_CLOUD_PROVIDER = "cloud_provider"; + private CloudInventoryCloudProviderId cloudProvider; + + public static final String JSON_PROPERTY_ERROR = "error"; + private String error; + + public static final String JSON_PROPERTY_ERROR_CODE = "error_code"; + private String errorCode; + + 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 static final String JSON_PROPERTY_PREFIX = "prefix"; + private String prefix; + + public CloudInventorySyncConfigAttributes() {} + + @JsonCreator + public CloudInventorySyncConfigAttributes( + @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_AWS_REGION) String awsRegion, + @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_CLOUD_PROVIDER) + CloudInventoryCloudProviderId cloudProvider, + @JsonProperty(required = true, value = JSON_PROPERTY_ERROR) String error, + @JsonProperty(required = true, value = JSON_PROPERTY_ERROR_CODE) String errorCode, + @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, + @JsonProperty(required = true, value = JSON_PROPERTY_PREFIX) String prefix) { + this.awsAccountId = awsAccountId; + this.awsBucketName = awsBucketName; + this.awsRegion = awsRegion; + this.azureClientId = azureClientId; + this.azureContainerName = azureContainerName; + this.azureStorageAccountName = azureStorageAccountName; + this.azureTenantId = azureTenantId; + this.cloudProvider = cloudProvider; + this.unparsed |= !cloudProvider.isValid(); + this.error = error; + this.errorCode = errorCode; + this.gcpBucketName = gcpBucketName; + this.gcpProjectId = gcpProjectId; + this.gcpServiceAccountEmail = gcpServiceAccountEmail; + this.prefix = prefix; + } + + public CloudInventorySyncConfigAttributes awsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * AWS account ID for the inventory bucket. + * + * @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 CloudInventorySyncConfigAttributes awsBucketName(String awsBucketName) { + this.awsBucketName = awsBucketName; + return this; + } + + /** + * AWS S3 bucket name for inventory files. + * + * @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 CloudInventorySyncConfigAttributes awsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * AWS Region for the inventory bucket. + * + * @return awsRegion + */ + @JsonProperty(JSON_PROPERTY_AWS_REGION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAwsRegion() { + return awsRegion; + } + + public void setAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + } + + public CloudInventorySyncConfigAttributes azureClientId(String azureClientId) { + this.azureClientId = azureClientId; + return this; + } + + /** + * Azure AD application (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 CloudInventorySyncConfigAttributes azureContainerName(String azureContainerName) { + this.azureContainerName = azureContainerName; + return this; + } + + /** + * Azure blob container name. + * + * @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 CloudInventorySyncConfigAttributes azureStorageAccountName( + String azureStorageAccountName) { + this.azureStorageAccountName = azureStorageAccountName; + return this; + } + + /** + * Azure storage account name. + * + * @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 CloudInventorySyncConfigAttributes azureTenantId(String azureTenantId) { + this.azureTenantId = azureTenantId; + return this; + } + + /** + * Azure AD tenant ID. + * + * @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 CloudInventorySyncConfigAttributes cloudProvider( + CloudInventoryCloudProviderId cloudProvider) { + this.cloudProvider = cloudProvider; + this.unparsed |= !cloudProvider.isValid(); + return this; + } + + /** + * Cloud provider for this sync configuration (aws, gcp, or azure + * ). For requests, must match the provider block supplied under attributes. + * + * @return cloudProvider + */ + @JsonProperty(JSON_PROPERTY_CLOUD_PROVIDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CloudInventoryCloudProviderId getCloudProvider() { + return cloudProvider; + } + + public void setCloudProvider(CloudInventoryCloudProviderId cloudProvider) { + if (!cloudProvider.isValid()) { + this.unparsed = true; + } + this.cloudProvider = cloudProvider; + } + + /** + * Human-readable error detail when sync is unhealthy. + * + * @return error + */ + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getError() { + return error; + } + + /** + * Machine-readable error code when sync is unhealthy. + * + * @return errorCode + */ + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getErrorCode() { + return errorCode; + } + + public CloudInventorySyncConfigAttributes gcpBucketName(String gcpBucketName) { + this.gcpBucketName = gcpBucketName; + return this; + } + + /** + * GCS bucket name for inventory files Datadog reads. + * + * @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 CloudInventorySyncConfigAttributes gcpProjectId(String gcpProjectId) { + this.gcpProjectId = gcpProjectId; + return this; + } + + /** + * GCP project ID. + * + * @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 CloudInventorySyncConfigAttributes gcpServiceAccountEmail(String gcpServiceAccountEmail) { + this.gcpServiceAccountEmail = gcpServiceAccountEmail; + return this; + } + + /** + * Service account email for bucket access. + * + * @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; + } + + /** + * Object key prefix or / when the entire bucket is synced. + * + * @return prefix + */ + @JsonProperty(JSON_PROPERTY_PREFIX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPrefix() { + return prefix; + } + + /** + * 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 CloudInventorySyncConfigAttributes + */ + @JsonAnySetter + public CloudInventorySyncConfigAttributes 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 CloudInventorySyncConfigAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudInventorySyncConfigAttributes cloudInventorySyncConfigAttributes = + (CloudInventorySyncConfigAttributes) o; + return Objects.equals(this.awsAccountId, cloudInventorySyncConfigAttributes.awsAccountId) + && Objects.equals(this.awsBucketName, cloudInventorySyncConfigAttributes.awsBucketName) + && Objects.equals(this.awsRegion, cloudInventorySyncConfigAttributes.awsRegion) + && Objects.equals(this.azureClientId, cloudInventorySyncConfigAttributes.azureClientId) + && Objects.equals( + this.azureContainerName, cloudInventorySyncConfigAttributes.azureContainerName) + && Objects.equals( + this.azureStorageAccountName, + cloudInventorySyncConfigAttributes.azureStorageAccountName) + && Objects.equals(this.azureTenantId, cloudInventorySyncConfigAttributes.azureTenantId) + && Objects.equals(this.cloudProvider, cloudInventorySyncConfigAttributes.cloudProvider) + && Objects.equals(this.error, cloudInventorySyncConfigAttributes.error) + && Objects.equals(this.errorCode, cloudInventorySyncConfigAttributes.errorCode) + && Objects.equals(this.gcpBucketName, cloudInventorySyncConfigAttributes.gcpBucketName) + && Objects.equals(this.gcpProjectId, cloudInventorySyncConfigAttributes.gcpProjectId) + && Objects.equals( + this.gcpServiceAccountEmail, cloudInventorySyncConfigAttributes.gcpServiceAccountEmail) + && Objects.equals(this.prefix, cloudInventorySyncConfigAttributes.prefix) + && Objects.equals( + this.additionalProperties, cloudInventorySyncConfigAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + awsAccountId, + awsBucketName, + awsRegion, + azureClientId, + azureContainerName, + azureStorageAccountName, + azureTenantId, + cloudProvider, + error, + errorCode, + gcpBucketName, + gcpProjectId, + gcpServiceAccountEmail, + prefix, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CloudInventorySyncConfigAttributes {\n"); + sb.append(" awsAccountId: ").append(toIndentedString(awsAccountId)).append("\n"); + sb.append(" awsBucketName: ").append(toIndentedString(awsBucketName)).append("\n"); + sb.append(" awsRegion: ").append(toIndentedString(awsRegion)).append("\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(" cloudProvider: ").append(toIndentedString(cloudProvider)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).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(" prefix: ").append(toIndentedString(prefix)).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/CloudInventorySyncConfigAzureRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigAzureRequestAttributes.java new file mode 100644 index 00000000000..f74fb3ee73f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigAzureRequestAttributes.java @@ -0,0 +1,299 @@ +/* + * 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; + +/** Azure settings for the storage account and container with inventory data. */ +@JsonPropertyOrder({ + CloudInventorySyncConfigAzureRequestAttributes.JSON_PROPERTY_CLIENT_ID, + CloudInventorySyncConfigAzureRequestAttributes.JSON_PROPERTY_CONTAINER, + CloudInventorySyncConfigAzureRequestAttributes.JSON_PROPERTY_RESOURCE_GROUP, + CloudInventorySyncConfigAzureRequestAttributes.JSON_PROPERTY_STORAGE_ACCOUNT, + CloudInventorySyncConfigAzureRequestAttributes.JSON_PROPERTY_SUBSCRIPTION_ID, + CloudInventorySyncConfigAzureRequestAttributes.JSON_PROPERTY_TENANT_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CloudInventorySyncConfigAzureRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_CONTAINER = "container"; + private String container; + + public static final String JSON_PROPERTY_RESOURCE_GROUP = "resource_group"; + private String resourceGroup; + + public static final String JSON_PROPERTY_STORAGE_ACCOUNT = "storage_account"; + private String storageAccount; + + public static final String JSON_PROPERTY_SUBSCRIPTION_ID = "subscription_id"; + private String subscriptionId; + + public static final String JSON_PROPERTY_TENANT_ID = "tenant_id"; + private String tenantId; + + public CloudInventorySyncConfigAzureRequestAttributes() {} + + @JsonCreator + public CloudInventorySyncConfigAzureRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CLIENT_ID) String clientId, + @JsonProperty(required = true, value = JSON_PROPERTY_CONTAINER) String container, + @JsonProperty(required = true, value = JSON_PROPERTY_RESOURCE_GROUP) String resourceGroup, + @JsonProperty(required = true, value = JSON_PROPERTY_STORAGE_ACCOUNT) String storageAccount, + @JsonProperty(required = true, value = JSON_PROPERTY_SUBSCRIPTION_ID) String subscriptionId, + @JsonProperty(required = true, value = JSON_PROPERTY_TENANT_ID) String tenantId) { + this.clientId = clientId; + this.container = container; + this.resourceGroup = resourceGroup; + this.storageAccount = storageAccount; + this.subscriptionId = subscriptionId; + this.tenantId = tenantId; + } + + public CloudInventorySyncConfigAzureRequestAttributes clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Azure AD application (client) ID used for access. + * + * @return clientId + */ + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public CloudInventorySyncConfigAzureRequestAttributes container(String container) { + this.container = container; + return this; + } + + /** + * Blob container name. + * + * @return container + */ + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getContainer() { + return container; + } + + public void setContainer(String container) { + this.container = container; + } + + public CloudInventorySyncConfigAzureRequestAttributes resourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Resource group containing the storage account. + * + * @return resourceGroup + */ + @JsonProperty(JSON_PROPERTY_RESOURCE_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getResourceGroup() { + return resourceGroup; + } + + public void setResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + } + + public CloudInventorySyncConfigAzureRequestAttributes storageAccount(String storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * Storage account name. + * + * @return storageAccount + */ + @JsonProperty(JSON_PROPERTY_STORAGE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStorageAccount() { + return storageAccount; + } + + public void setStorageAccount(String storageAccount) { + this.storageAccount = storageAccount; + } + + public CloudInventorySyncConfigAzureRequestAttributes subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Azure subscription ID. + * + * @return subscriptionId + */ + @JsonProperty(JSON_PROPERTY_SUBSCRIPTION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public CloudInventorySyncConfigAzureRequestAttributes tenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Azure AD tenant ID. + * + * @return tenantId + */ + @JsonProperty(JSON_PROPERTY_TENANT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + /** + * 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 CloudInventorySyncConfigAzureRequestAttributes + */ + @JsonAnySetter + public CloudInventorySyncConfigAzureRequestAttributes 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 CloudInventorySyncConfigAzureRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudInventorySyncConfigAzureRequestAttributes cloudInventorySyncConfigAzureRequestAttributes = + (CloudInventorySyncConfigAzureRequestAttributes) o; + return Objects.equals(this.clientId, cloudInventorySyncConfigAzureRequestAttributes.clientId) + && Objects.equals(this.container, cloudInventorySyncConfigAzureRequestAttributes.container) + && Objects.equals( + this.resourceGroup, cloudInventorySyncConfigAzureRequestAttributes.resourceGroup) + && Objects.equals( + this.storageAccount, cloudInventorySyncConfigAzureRequestAttributes.storageAccount) + && Objects.equals( + this.subscriptionId, cloudInventorySyncConfigAzureRequestAttributes.subscriptionId) + && Objects.equals(this.tenantId, cloudInventorySyncConfigAzureRequestAttributes.tenantId) + && Objects.equals( + this.additionalProperties, + cloudInventorySyncConfigAzureRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + clientId, + container, + resourceGroup, + storageAccount, + subscriptionId, + tenantId, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CloudInventorySyncConfigAzureRequestAttributes {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" resourceGroup: ").append(toIndentedString(resourceGroup)).append("\n"); + sb.append(" storageAccount: ").append(toIndentedString(storageAccount)).append("\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" tenantId: ").append(toIndentedString(tenantId)).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/CloudInventorySyncConfigGCPRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigGCPRequestAttributes.java new file mode 100644 index 00000000000..6b6819ae0bb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigGCPRequestAttributes.java @@ -0,0 +1,252 @@ +/* + * 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; + +/** GCP settings for buckets involved in inventory reporting. */ +@JsonPropertyOrder({ + CloudInventorySyncConfigGCPRequestAttributes.JSON_PROPERTY_DESTINATION_BUCKET_NAME, + CloudInventorySyncConfigGCPRequestAttributes.JSON_PROPERTY_PROJECT_ID, + CloudInventorySyncConfigGCPRequestAttributes.JSON_PROPERTY_SERVICE_ACCOUNT_EMAIL, + CloudInventorySyncConfigGCPRequestAttributes.JSON_PROPERTY_SOURCE_BUCKET_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CloudInventorySyncConfigGCPRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESTINATION_BUCKET_NAME = "destination_bucket_name"; + private String destinationBucketName; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + private String projectId; + + public static final String JSON_PROPERTY_SERVICE_ACCOUNT_EMAIL = "service_account_email"; + private String serviceAccountEmail; + + public static final String JSON_PROPERTY_SOURCE_BUCKET_NAME = "source_bucket_name"; + private String sourceBucketName; + + public CloudInventorySyncConfigGCPRequestAttributes() {} + + @JsonCreator + public CloudInventorySyncConfigGCPRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DESTINATION_BUCKET_NAME) + String destinationBucketName, + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECT_ID) String projectId, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE_ACCOUNT_EMAIL) + String serviceAccountEmail, + @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE_BUCKET_NAME) + String sourceBucketName) { + this.destinationBucketName = destinationBucketName; + this.projectId = projectId; + this.serviceAccountEmail = serviceAccountEmail; + this.sourceBucketName = sourceBucketName; + } + + public CloudInventorySyncConfigGCPRequestAttributes destinationBucketName( + String destinationBucketName) { + this.destinationBucketName = destinationBucketName; + return this; + } + + /** + * GCS bucket name where Datadog reads inventory reports. + * + * @return destinationBucketName + */ + @JsonProperty(JSON_PROPERTY_DESTINATION_BUCKET_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDestinationBucketName() { + return destinationBucketName; + } + + public void setDestinationBucketName(String destinationBucketName) { + this.destinationBucketName = destinationBucketName; + } + + public CloudInventorySyncConfigGCPRequestAttributes projectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * GCP project ID for the inventory destination bucket. + * + * @return projectId + */ + @JsonProperty(JSON_PROPERTY_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public CloudInventorySyncConfigGCPRequestAttributes serviceAccountEmail( + String serviceAccountEmail) { + this.serviceAccountEmail = serviceAccountEmail; + return this; + } + + /** + * Service account email used to read the destination bucket. + * + * @return serviceAccountEmail + */ + @JsonProperty(JSON_PROPERTY_SERVICE_ACCOUNT_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getServiceAccountEmail() { + return serviceAccountEmail; + } + + public void setServiceAccountEmail(String serviceAccountEmail) { + this.serviceAccountEmail = serviceAccountEmail; + } + + public CloudInventorySyncConfigGCPRequestAttributes sourceBucketName(String sourceBucketName) { + this.sourceBucketName = sourceBucketName; + return this; + } + + /** + * GCS bucket name that inventory reports are generated for. + * + * @return sourceBucketName + */ + @JsonProperty(JSON_PROPERTY_SOURCE_BUCKET_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSourceBucketName() { + return sourceBucketName; + } + + public void setSourceBucketName(String sourceBucketName) { + this.sourceBucketName = sourceBucketName; + } + + /** + * 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 CloudInventorySyncConfigGCPRequestAttributes + */ + @JsonAnySetter + public CloudInventorySyncConfigGCPRequestAttributes 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 CloudInventorySyncConfigGCPRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudInventorySyncConfigGCPRequestAttributes cloudInventorySyncConfigGcpRequestAttributes = + (CloudInventorySyncConfigGCPRequestAttributes) o; + return Objects.equals( + this.destinationBucketName, + cloudInventorySyncConfigGcpRequestAttributes.destinationBucketName) + && Objects.equals(this.projectId, cloudInventorySyncConfigGcpRequestAttributes.projectId) + && Objects.equals( + this.serviceAccountEmail, + cloudInventorySyncConfigGcpRequestAttributes.serviceAccountEmail) + && Objects.equals( + this.sourceBucketName, cloudInventorySyncConfigGcpRequestAttributes.sourceBucketName) + && Objects.equals( + this.additionalProperties, + cloudInventorySyncConfigGcpRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + destinationBucketName, + projectId, + serviceAccountEmail, + sourceBucketName, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CloudInventorySyncConfigGCPRequestAttributes {\n"); + sb.append(" destinationBucketName: ") + .append(toIndentedString(destinationBucketName)) + .append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" serviceAccountEmail: ") + .append(toIndentedString(serviceAccountEmail)) + .append("\n"); + sb.append(" sourceBucketName: ").append(toIndentedString(sourceBucketName)).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/CloudInventorySyncConfigResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigResourceType.java new file mode 100644 index 00000000000..2ee3601dce9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigResourceType.java @@ -0,0 +1,60 @@ +/* + * 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; + +/** JSON:API type for sync configuration resources. */ +@JsonSerialize( + using = + CloudInventorySyncConfigResourceType.CloudInventorySyncConfigResourceTypeSerializer.class) +public class CloudInventorySyncConfigResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("sync_configs")); + + public static final CloudInventorySyncConfigResourceType SYNC_CONFIGS = + new CloudInventorySyncConfigResourceType("sync_configs"); + + CloudInventorySyncConfigResourceType(String value) { + super(value, allowedValues); + } + + public static class CloudInventorySyncConfigResourceTypeSerializer + extends StdSerializer { + public CloudInventorySyncConfigResourceTypeSerializer( + Class t) { + super(t); + } + + public CloudInventorySyncConfigResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CloudInventorySyncConfigResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CloudInventorySyncConfigResourceType fromValue(String value) { + return new CloudInventorySyncConfigResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigResponse.java b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigResponse.java new file mode 100644 index 00000000000..f0b0984654b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigResponse.java @@ -0,0 +1,151 @@ +/* + * 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; + +/** + * Response containing the upserted sync configuration. Additional read-only fields appear on list + * and get. + */ +@JsonPropertyOrder({CloudInventorySyncConfigResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CloudInventorySyncConfigResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CloudInventorySyncConfigResponseData data; + + public CloudInventorySyncConfigResponse() {} + + @JsonCreator + public CloudInventorySyncConfigResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + CloudInventorySyncConfigResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CloudInventorySyncConfigResponse data(CloudInventorySyncConfigResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * JSON:API data object for a sync configuration. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CloudInventorySyncConfigResponseData getData() { + return data; + } + + public void setData(CloudInventorySyncConfigResponseData 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 CloudInventorySyncConfigResponse + */ + @JsonAnySetter + public CloudInventorySyncConfigResponse 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 CloudInventorySyncConfigResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudInventorySyncConfigResponse cloudInventorySyncConfigResponse = + (CloudInventorySyncConfigResponse) o; + return Objects.equals(this.data, cloudInventorySyncConfigResponse.data) + && Objects.equals( + this.additionalProperties, cloudInventorySyncConfigResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CloudInventorySyncConfigResponse {\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/CloudInventorySyncConfigResponseData.java b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigResponseData.java new file mode 100644 index 00000000000..d614d405dac --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CloudInventorySyncConfigResponseData.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.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; + +/** JSON:API data object for a sync configuration. */ +@JsonPropertyOrder({ + CloudInventorySyncConfigResponseData.JSON_PROPERTY_ATTRIBUTES, + CloudInventorySyncConfigResponseData.JSON_PROPERTY_ID, + CloudInventorySyncConfigResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CloudInventorySyncConfigResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CloudInventorySyncConfigAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CloudInventorySyncConfigResourceType type; + + public CloudInventorySyncConfigResponseData() {} + + @JsonCreator + public CloudInventorySyncConfigResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CloudInventorySyncConfigAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CloudInventorySyncConfigResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CloudInventorySyncConfigResponseData attributes( + CloudInventorySyncConfigAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for a cloud inventory sync configuration. Values beyond id may be + * omitted immediately after upsert. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CloudInventorySyncConfigAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CloudInventorySyncConfigAttributes attributes) { + this.attributes = attributes; + } + + public CloudInventorySyncConfigResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the recurring sync configuration. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CloudInventorySyncConfigResponseData type(CloudInventorySyncConfigResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API type for sync configuration resources. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CloudInventorySyncConfigResourceType getType() { + return type; + } + + public void setType(CloudInventorySyncConfigResourceType 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 CloudInventorySyncConfigResponseData + */ + @JsonAnySetter + public CloudInventorySyncConfigResponseData 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 CloudInventorySyncConfigResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudInventorySyncConfigResponseData cloudInventorySyncConfigResponseData = + (CloudInventorySyncConfigResponseData) o; + return Objects.equals(this.attributes, cloudInventorySyncConfigResponseData.attributes) + && Objects.equals(this.id, cloudInventorySyncConfigResponseData.id) + && Objects.equals(this.type, cloudInventorySyncConfigResponseData.type) + && Objects.equals( + this.additionalProperties, cloudInventorySyncConfigResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CloudInventorySyncConfigResponseData {\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/UpsertCloudInventorySyncConfigRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpsertCloudInventorySyncConfigRequest.java new file mode 100644 index 00000000000..395a1e19467 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpsertCloudInventorySyncConfigRequest.java @@ -0,0 +1,149 @@ +/* + * 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; + +/** Request body for creating or updating a cloud inventory sync configuration. */ +@JsonPropertyOrder({UpsertCloudInventorySyncConfigRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpsertCloudInventorySyncConfigRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpsertCloudInventorySyncConfigRequestData data; + + public UpsertCloudInventorySyncConfigRequest() {} + + @JsonCreator + public UpsertCloudInventorySyncConfigRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + UpsertCloudInventorySyncConfigRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public UpsertCloudInventorySyncConfigRequest data( + UpsertCloudInventorySyncConfigRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * JSON:API data envelope for an upsert sync configuration request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpsertCloudInventorySyncConfigRequestData getData() { + return data; + } + + public void setData(UpsertCloudInventorySyncConfigRequestData 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 UpsertCloudInventorySyncConfigRequest + */ + @JsonAnySetter + public UpsertCloudInventorySyncConfigRequest 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 UpsertCloudInventorySyncConfigRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertCloudInventorySyncConfigRequest upsertCloudInventorySyncConfigRequest = + (UpsertCloudInventorySyncConfigRequest) o; + return Objects.equals(this.data, upsertCloudInventorySyncConfigRequest.data) + && Objects.equals( + this.additionalProperties, upsertCloudInventorySyncConfigRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpsertCloudInventorySyncConfigRequest {\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/UpsertCloudInventorySyncConfigRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpsertCloudInventorySyncConfigRequestAttributes.java new file mode 100644 index 00000000000..92943bae986 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpsertCloudInventorySyncConfigRequestAttributes.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.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; + +/** + * Provider-specific configuration. Include the object that matches data.id (aws + * , gcp, or azure). + */ +@JsonPropertyOrder({ + UpsertCloudInventorySyncConfigRequestAttributes.JSON_PROPERTY_AWS, + UpsertCloudInventorySyncConfigRequestAttributes.JSON_PROPERTY_AZURE, + UpsertCloudInventorySyncConfigRequestAttributes.JSON_PROPERTY_GCP +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpsertCloudInventorySyncConfigRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AWS = "aws"; + private CloudInventorySyncConfigAWSRequestAttributes aws; + + public static final String JSON_PROPERTY_AZURE = "azure"; + private CloudInventorySyncConfigAzureRequestAttributes azure; + + public static final String JSON_PROPERTY_GCP = "gcp"; + private CloudInventorySyncConfigGCPRequestAttributes gcp; + + public UpsertCloudInventorySyncConfigRequestAttributes aws( + CloudInventorySyncConfigAWSRequestAttributes aws) { + this.aws = aws; + this.unparsed |= aws.unparsed; + return this; + } + + /** + * AWS settings for the customer bucket that stores inventory reports. + * + * @return aws + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CloudInventorySyncConfigAWSRequestAttributes getAws() { + return aws; + } + + public void setAws(CloudInventorySyncConfigAWSRequestAttributes aws) { + this.aws = aws; + } + + public UpsertCloudInventorySyncConfigRequestAttributes azure( + CloudInventorySyncConfigAzureRequestAttributes azure) { + this.azure = azure; + this.unparsed |= azure.unparsed; + return this; + } + + /** + * Azure settings for the storage account and container with inventory data. + * + * @return azure + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CloudInventorySyncConfigAzureRequestAttributes getAzure() { + return azure; + } + + public void setAzure(CloudInventorySyncConfigAzureRequestAttributes azure) { + this.azure = azure; + } + + public UpsertCloudInventorySyncConfigRequestAttributes gcp( + CloudInventorySyncConfigGCPRequestAttributes gcp) { + this.gcp = gcp; + this.unparsed |= gcp.unparsed; + return this; + } + + /** + * GCP settings for buckets involved in inventory reporting. + * + * @return gcp + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CloudInventorySyncConfigGCPRequestAttributes getGcp() { + return gcp; + } + + public void setGcp(CloudInventorySyncConfigGCPRequestAttributes gcp) { + this.gcp = gcp; + } + + /** + * 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 UpsertCloudInventorySyncConfigRequestAttributes + */ + @JsonAnySetter + public UpsertCloudInventorySyncConfigRequestAttributes 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 UpsertCloudInventorySyncConfigRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertCloudInventorySyncConfigRequestAttributes + upsertCloudInventorySyncConfigRequestAttributes = + (UpsertCloudInventorySyncConfigRequestAttributes) o; + return Objects.equals(this.aws, upsertCloudInventorySyncConfigRequestAttributes.aws) + && Objects.equals(this.azure, upsertCloudInventorySyncConfigRequestAttributes.azure) + && Objects.equals(this.gcp, upsertCloudInventorySyncConfigRequestAttributes.gcp) + && Objects.equals( + this.additionalProperties, + upsertCloudInventorySyncConfigRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aws, azure, gcp, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpsertCloudInventorySyncConfigRequestAttributes {\n"); + sb.append(" aws: ").append(toIndentedString(aws)).append("\n"); + sb.append(" azure: ").append(toIndentedString(azure)).append("\n"); + sb.append(" gcp: ").append(toIndentedString(gcp)).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/UpsertCloudInventorySyncConfigRequestData.java b/src/main/java/com/datadog/api/client/v2/model/UpsertCloudInventorySyncConfigRequestData.java new file mode 100644 index 00000000000..cd7f184cfa4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpsertCloudInventorySyncConfigRequestData.java @@ -0,0 +1,222 @@ +/* + * 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; + +/** JSON:API data envelope for an upsert sync configuration request. */ +@JsonPropertyOrder({ + UpsertCloudInventorySyncConfigRequestData.JSON_PROPERTY_ATTRIBUTES, + UpsertCloudInventorySyncConfigRequestData.JSON_PROPERTY_ID, + UpsertCloudInventorySyncConfigRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpsertCloudInventorySyncConfigRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpsertCloudInventorySyncConfigRequestAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private CloudInventoryCloudProviderId id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CloudInventoryCloudProviderRequestType type; + + public UpsertCloudInventorySyncConfigRequestData() {} + + @JsonCreator + public UpsertCloudInventorySyncConfigRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + UpsertCloudInventorySyncConfigRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) CloudInventoryCloudProviderId id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CloudInventoryCloudProviderRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.unparsed |= !id.isValid(); + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpsertCloudInventorySyncConfigRequestData attributes( + UpsertCloudInventorySyncConfigRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Provider-specific configuration. Include the object that matches data.id ( + * aws, gcp, or azure). + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpsertCloudInventorySyncConfigRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpsertCloudInventorySyncConfigRequestAttributes attributes) { + this.attributes = attributes; + } + + public UpsertCloudInventorySyncConfigRequestData id(CloudInventoryCloudProviderId id) { + this.id = id; + this.unparsed |= !id.isValid(); + return this; + } + + /** + * Cloud provider for this sync configuration (aws, gcp, or azure + * ). For requests, must match the provider block supplied under attributes. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CloudInventoryCloudProviderId getId() { + return id; + } + + public void setId(CloudInventoryCloudProviderId id) { + if (!id.isValid()) { + this.unparsed = true; + } + this.id = id; + } + + public UpsertCloudInventorySyncConfigRequestData type( + CloudInventoryCloudProviderRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API type for upsert sync configuration requests. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CloudInventoryCloudProviderRequestType getType() { + return type; + } + + public void setType(CloudInventoryCloudProviderRequestType 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 UpsertCloudInventorySyncConfigRequestData + */ + @JsonAnySetter + public UpsertCloudInventorySyncConfigRequestData 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 UpsertCloudInventorySyncConfigRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertCloudInventorySyncConfigRequestData upsertCloudInventorySyncConfigRequestData = + (UpsertCloudInventorySyncConfigRequestData) o; + return Objects.equals(this.attributes, upsertCloudInventorySyncConfigRequestData.attributes) + && Objects.equals(this.id, upsertCloudInventorySyncConfigRequestData.id) + && Objects.equals(this.type, upsertCloudInventorySyncConfigRequestData.type) + && Objects.equals( + this.additionalProperties, + upsertCloudInventorySyncConfigRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpsertCloudInventorySyncConfigRequestData {\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/test/resources/com/datadog/api/client/v2/api/cloud_inventory_sync_configs.feature b/src/test/resources/com/datadog/api/client/v2/api/cloud_inventory_sync_configs.feature new file mode 100644 index 00000000000..32a7d292efb --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/cloud_inventory_sync_configs.feature @@ -0,0 +1,22 @@ +@endpoint(cloud-inventory-sync-configs) @endpoint(cloud-inventory-sync-configs-v2) +Feature: Cloud Inventory Sync Configs + Configure cloud inventory file synchronization from your cloud storage to + Datadog. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CloudInventorySyncConfigs" API + And operation "UpsertSyncConfig" enabled + And new "UpsertSyncConfig" request + And body with value {"data": {"attributes": {"aws": {"aws_account_id": "123456789012", "destination_bucket_name": "my-inventory-bucket", "destination_bucket_region": "us-east-1", "destination_prefix": "logs/"}, "azure": {"client_id": "11111111-1111-1111-1111-111111111111", "container": "inventory-container", "resource_group": "my-resource-group", "storage_account": "mystorageaccount", "subscription_id": "33333333-3333-3333-3333-333333333333", "tenant_id": "22222222-2222-2222-2222-222222222222"}, "gcp": {"destination_bucket_name": "my-inventory-reports", "project_id": "my-gcp-project", "service_account_email": "reader@my-gcp-project.iam.gserviceaccount.com", "source_bucket_name": "my-monitored-bucket"}}, "id": "aws", "type": "cloud_provider"}} + + @generated @skip @team:DataDog/storage-management + Scenario: Create or update a sync configuration returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/storage-management + Scenario: Create or update a sync configuration returns "OK" response + 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 f606e4a8658..4d694af5be3 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 @@ -1235,6 +1235,12 @@ "type": "idempotent" } }, + "UpsertSyncConfig": { + "tag": "Cloud Inventory Sync Configs", + "undo": { + "type": "idempotent" + } + }, "GetCodeCoverageBranchSummary": { "tag": "Code Coverage", "undo": {