From b3ad28d11f6fd7f214338102542e0a094855d9f0 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 18 Jun 2026 16:01:29 +0000 Subject: [PATCH] Regenerate client from commit bce6c00 of spec repo --- .generator/schemas/v2/openapi.yaml | 320 ++++++++++++ examples/v2/vercel/CreateVercelToken.java | 26 + examples/v2/vercel/GetVercelConfig.java | 24 + examples/v2/vercel/UpdateVercelConfig.java | 44 ++ .../datadog/api/client/v2/api/VercelApi.java | 485 ++++++++++++++++++ .../api/client/v2/model/VercelApiKey.java | 170 ++++++ .../v2/model/VercelConfigAttributes.java | 208 ++++++++ .../v2/model/VercelConfigDataResponse.java | 210 ++++++++ .../model/VercelConfigDataResponseType.java | 57 ++ .../client/v2/model/VercelConfigResponse.java | 145 ++++++ .../client/v2/model/VercelEnvironment.java | 55 ++ .../api/client/v2/model/VercelLogSource.java | 60 +++ .../api/client/v2/model/VercelLogsConfig.java | 247 +++++++++ .../v2/model/VercelTokenCreateRequest.java | 179 +++++++ .../client/v2/model/VercelTraceConfig.java | 203 ++++++++ .../com/datadog/api/client/v2/api/undo.json | 18 + .../datadog/api/client/v2/api/vercel.feature | 70 +++ 17 files changed, 2521 insertions(+) create mode 100644 examples/v2/vercel/CreateVercelToken.java create mode 100644 examples/v2/vercel/GetVercelConfig.java create mode 100644 examples/v2/vercel/UpdateVercelConfig.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/VercelApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/VercelApiKey.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/VercelConfigAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/VercelConfigDataResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/VercelConfigDataResponseType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/VercelConfigResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/VercelEnvironment.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/VercelLogSource.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/VercelLogsConfig.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/VercelTokenCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/VercelTraceConfig.java create mode 100644 src/test/resources/com/datadog/api/client/v2/api/vercel.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 51127c3aea2..51829339a92 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1909,6 +1909,14 @@ components: required: true schema: type: string + VercelConfigurationID: + description: The Vercel configuration ID. + example: icfg_abc123 + in: path + name: configuration_id + required: true + schema: + type: string ViewIDPathParameter: description: The UUID of the case view. example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 @@ -106727,6 +106735,168 @@ components: required: - value type: object + VercelApiKey: + description: Datadog API key reference used by the Vercel integration to send telemetry. + properties: + id: + description: ID of the Datadog API key used by the Vercel integration. + example: 00000000-0000-0000-0000-000000000001 + type: string + value: + description: Value of the Datadog API key. Returned as an empty string in read responses. + example: "" + type: string + required: + - id + - value + type: object + VercelConfigAttributes: + description: Attributes of the Datadog Vercel integration configuration. + properties: + apiKey: + $ref: "#/components/schemas/VercelApiKey" + logsConfig: + $ref: "#/components/schemas/VercelLogsConfig" + traceConfig: + $ref: "#/components/schemas/VercelTraceConfig" + required: + - apiKey + - logsConfig + - traceConfig + type: object + VercelConfigDataResponse: + description: Vercel configuration data returned by the API. + properties: + attributes: + $ref: "#/components/schemas/VercelConfigAttributes" + id: + description: Vercel configuration ID. + example: icfg_abc123 + type: string + type: + $ref: "#/components/schemas/VercelConfigDataResponseType" + required: + - id + - type + - attributes + type: object + VercelConfigDataResponseType: + default: vercelConfiguration + description: Type identifier for a Vercel configuration resource. + enum: + - vercelConfiguration + example: vercelConfiguration + type: string + x-enum-varnames: + - VERCEL_CONFIGURATION + VercelConfigResponse: + description: Response containing the Datadog Vercel integration configuration. + properties: + data: + $ref: "#/components/schemas/VercelConfigDataResponse" + required: + - data + type: object + VercelEnvironment: + description: Vercel deployment environment. + enum: + - production + - preview + example: production + type: string + x-enum-varnames: + - PRODUCTION + - PREVIEW + VercelLogSource: + description: Source of logs that Vercel forwards to Datadog. + enum: + - static + - lambda + - edge + - build + - external + - firewall + example: lambda + type: string + x-enum-varnames: + - STATIC + - LAMBDA + - EDGE + - BUILD + - EXTERNAL + - FIREWALL + VercelLogsConfig: + description: Logs forwarding configuration for the Vercel integration. + properties: + enabled: + description: Whether logs forwarding is enabled. + example: true + type: boolean + environments: + description: List of Vercel deployment environments to forward telemetry from. + example: + - production + items: + $ref: "#/components/schemas/VercelEnvironment" + type: array + logSources: + description: List of Vercel log sources to forward to Datadog. + example: + - lambda + items: + $ref: "#/components/schemas/VercelLogSource" + type: array + samplingPercentage: + description: Percentage of logs to forward to Datadog, between 0 and 100. + example: 100 + format: int32 + maximum: 100 + minimum: 0 + type: integer + required: + - enabled + - samplingPercentage + - logSources + - environments + type: object + VercelTokenCreateRequest: + description: Request to exchange a Vercel marketplace authorization code for a Datadog-managed access token. + properties: + authGrantCode: + description: OAuth authorization code received from the Vercel marketplace flow. + example: code + type: string + vercelConfigurationId: + description: Vercel configuration identifier returned by the marketplace flow. + example: icfg_abc123 + type: string + required: + - authGrantCode + - vercelConfigurationId + type: object + VercelTraceConfig: + description: Tracing configuration for the Vercel integration. + properties: + enabled: + description: Whether tracing is enabled. + example: true + type: boolean + isDeprecatedOtel: + description: Whether the configuration uses the deprecated OpenTelemetry tracing setup. + example: false + type: boolean + samplingPercentage: + description: Percentage of traces to forward to Datadog, between 0 and 100. + example: 100 + format: int32 + maximum: 100 + minimum: 0 + type: integer + required: + - enabled + - samplingPercentage + - isDeprecatedOtel + type: object Version: description: Version of the notification rule. It is updated when the rule is modified. example: 1 @@ -191561,6 +191731,154 @@ paths: "x-permission": operator: OPEN permissions: [] + /api/v2/vercel/config/{configuration_id}: + get: + description: Retrieve the Datadog Vercel integration configuration for a given Vercel configuration. The response contains the API key reference, logs forwarding settings, and tracing settings stored in Datadog for this configuration. + operationId: GetVercelConfig + parameters: + - $ref: "#/components/parameters/VercelConfigurationID" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + apiKey: + id: 00000000-0000-0000-0000-000000000001 + value: "" + logsConfig: + enabled: true + environments: + - production + logSources: + - lambda + - edge + samplingPercentage: 100 + traceConfig: + enabled: true + isDeprecatedOtel: false + samplingPercentage: 100 + id: icfg_abc123 + type: vercelConfiguration + schema: + $ref: "#/components/schemas/VercelConfigResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get Vercel configuration + tags: + - Vercel + put: + description: Update the Datadog Vercel integration configuration for a given Vercel configuration. The provided payload replaces the existing API key reference, logs forwarding settings, and tracing settings stored in Datadog for this configuration. + operationId: UpdateVercelConfig + parameters: + - $ref: "#/components/parameters/VercelConfigurationID" + requestBody: + content: + application/json: + examples: + default: + value: + apiKey: + id: 00000000-0000-0000-0000-000000000001 + value: "" + logsConfig: + enabled: true + environments: + - production + logSources: + - lambda + - edge + samplingPercentage: 100 + traceConfig: + enabled: true + isDeprecatedOtel: false + samplingPercentage: 100 + schema: + $ref: "#/components/schemas/VercelConfigAttributes" + required: true + responses: + "200": + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update Vercel configuration + tags: + - Vercel + /api/v2/vercel/token: + post: + description: Exchange a Vercel marketplace authorization code for an access token and store it in Datadog so that the integration can call Vercel APIs on behalf of the customer. This endpoint is invoked once when a customer installs the Datadog integration from the Vercel marketplace. + operationId: CreateVercelToken + requestBody: + content: + application/json: + examples: + default: + value: + authGrantCode: "code" + vercelConfigurationId: "icfg_abc123" + schema: + $ref: "#/components/schemas/VercelTokenCreateRequest" + required: true + responses: + "200": + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create Vercel access token + tags: + - Vercel /api/v2/web-integrations/{integration_name}/accounts: get: description: List accounts for a given web integration. @@ -193556,6 +193874,8 @@ tags: externalDocs: url: https://docs.datadoghq.com/account_management/users name: Users + - description: Configure the Datadog Vercel integration. Endpoints in this section let you exchange a Vercel marketplace authorization code for a Datadog-managed access token and read or update the logs, traces, and API key configuration associated with a Vercel project. + name: Vercel - description: |- Manage web integration accounts programmatically through the Datadog API. See the [Web Integrations page](https://app.datadoghq.com/integrations) for more information. diff --git a/examples/v2/vercel/CreateVercelToken.java b/examples/v2/vercel/CreateVercelToken.java new file mode 100644 index 00000000000..f5a57cb5441 --- /dev/null +++ b/examples/v2/vercel/CreateVercelToken.java @@ -0,0 +1,26 @@ +// Create Vercel access token returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.VercelApi; +import com.datadog.api.client.v2.model.VercelTokenCreateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + VercelApi apiInstance = new VercelApi(defaultClient); + + VercelTokenCreateRequest body = + new VercelTokenCreateRequest().authGrantCode("code").vercelConfigurationId("icfg_abc123"); + + try { + apiInstance.createVercelToken(body); + } catch (ApiException e) { + System.err.println("Exception when calling VercelApi#createVercelToken"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/vercel/GetVercelConfig.java b/examples/v2/vercel/GetVercelConfig.java new file mode 100644 index 00000000000..250ed598e80 --- /dev/null +++ b/examples/v2/vercel/GetVercelConfig.java @@ -0,0 +1,24 @@ +// Get Vercel configuration returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.VercelApi; +import com.datadog.api.client.v2.model.VercelConfigResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + VercelApi apiInstance = new VercelApi(defaultClient); + + try { + VercelConfigResponse result = apiInstance.getVercelConfig("icfg_abc123"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling VercelApi#getVercelConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/vercel/UpdateVercelConfig.java b/examples/v2/vercel/UpdateVercelConfig.java new file mode 100644 index 00000000000..e9e39d752ce --- /dev/null +++ b/examples/v2/vercel/UpdateVercelConfig.java @@ -0,0 +1,44 @@ +// Update Vercel configuration returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.VercelApi; +import com.datadog.api.client.v2.model.VercelApiKey; +import com.datadog.api.client.v2.model.VercelConfigAttributes; +import com.datadog.api.client.v2.model.VercelEnvironment; +import com.datadog.api.client.v2.model.VercelLogSource; +import com.datadog.api.client.v2.model.VercelLogsConfig; +import com.datadog.api.client.v2.model.VercelTraceConfig; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + VercelApi apiInstance = new VercelApi(defaultClient); + + VercelConfigAttributes body = + new VercelConfigAttributes() + .apiKey(new VercelApiKey().id("00000000-0000-0000-0000-000000000001").value("")) + .logsConfig( + new VercelLogsConfig() + .enabled(true) + .environments(Collections.singletonList(VercelEnvironment.PRODUCTION)) + .logSources(Collections.singletonList(VercelLogSource.LAMBDA)) + .samplingPercentage(100)) + .traceConfig( + new VercelTraceConfig() + .enabled(true) + .isDeprecatedOtel(false) + .samplingPercentage(100)); + + try { + apiInstance.updateVercelConfig("icfg_abc123", body); + } catch (ApiException e) { + System.err.println("Exception when calling VercelApi#updateVercelConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/VercelApi.java b/src/main/java/com/datadog/api/client/v2/api/VercelApi.java new file mode 100644 index 00000000000..0f97c1a28f9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/VercelApi.java @@ -0,0 +1,485 @@ +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.VercelConfigAttributes; +import com.datadog.api.client.v2.model.VercelConfigResponse; +import com.datadog.api.client.v2.model.VercelTokenCreateRequest; +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 VercelApi { + private ApiClient apiClient; + + public VercelApi() { + this(ApiClient.getDefaultApiClient()); + } + + public VercelApi(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 Vercel access token. + * + *

See {@link #createVercelTokenWithHttpInfo}. + * + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void createVercelToken(VercelTokenCreateRequest body) throws ApiException { + createVercelTokenWithHttpInfo(body); + } + + /** + * Create Vercel access token. + * + *

See {@link #createVercelTokenWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture createVercelTokenAsync(VercelTokenCreateRequest body) { + return createVercelTokenWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Exchange a Vercel marketplace authorization code for an access token and store it in Datadog so + * that the integration can call Vercel APIs on behalf of the customer. This endpoint is invoked + * once when a customer installs the Datadog integration from the Vercel marketplace. + * + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse createVercelTokenWithHttpInfo(VercelTokenCreateRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createVercelToken"); + } + // create path and map variables + String localVarPath = "/api/v2/vercel/token"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.VercelApi.createVercelToken", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Create Vercel access token. + * + *

See {@link #createVercelTokenWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> createVercelTokenWithHttpInfoAsync( + VercelTokenCreateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createVercelToken")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/vercel/token"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.VercelApi.createVercelToken", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get Vercel configuration. + * + *

See {@link #getVercelConfigWithHttpInfo}. + * + * @param configurationId The Vercel configuration ID. (required) + * @return VercelConfigResponse + * @throws ApiException if fails to make API call + */ + public VercelConfigResponse getVercelConfig(String configurationId) throws ApiException { + return getVercelConfigWithHttpInfo(configurationId).getData(); + } + + /** + * Get Vercel configuration. + * + *

See {@link #getVercelConfigWithHttpInfoAsync}. + * + * @param configurationId The Vercel configuration ID. (required) + * @return CompletableFuture<VercelConfigResponse> + */ + public CompletableFuture getVercelConfigAsync(String configurationId) { + return getVercelConfigWithHttpInfoAsync(configurationId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve the Datadog Vercel integration configuration for a given Vercel configuration. The + * response contains the API key reference, logs forwarding settings, and tracing settings stored + * in Datadog for this configuration. + * + * @param configurationId The Vercel configuration ID. (required) + * @return ApiResponse<VercelConfigResponse> + * @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 -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getVercelConfigWithHttpInfo(String configurationId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'configurationId' is set + if (configurationId == null) { + throw new ApiException( + 400, "Missing the required parameter 'configurationId' when calling getVercelConfig"); + } + // create path and map variables + String localVarPath = + "/api/v2/vercel/config/{configuration_id}" + .replaceAll( + "\\{" + "configuration_id" + "\\}", + apiClient.escapeString(configurationId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.VercelApi.getVercelConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get Vercel configuration. + * + *

See {@link #getVercelConfigWithHttpInfo}. + * + * @param configurationId The Vercel configuration ID. (required) + * @return CompletableFuture<ApiResponse<VercelConfigResponse>> + */ + public CompletableFuture> getVercelConfigWithHttpInfoAsync( + String configurationId) { + Object localVarPostBody = null; + + // verify the required parameter 'configurationId' is set + if (configurationId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'configurationId' when calling getVercelConfig")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/vercel/config/{configuration_id}" + .replaceAll( + "\\{" + "configuration_id" + "\\}", + apiClient.escapeString(configurationId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.VercelApi.getVercelConfig", + 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( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update Vercel configuration. + * + *

See {@link #updateVercelConfigWithHttpInfo}. + * + * @param configurationId The Vercel configuration ID. (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void updateVercelConfig(String configurationId, VercelConfigAttributes body) + throws ApiException { + updateVercelConfigWithHttpInfo(configurationId, body); + } + + /** + * Update Vercel configuration. + * + *

See {@link #updateVercelConfigWithHttpInfoAsync}. + * + * @param configurationId The Vercel configuration ID. (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture updateVercelConfigAsync( + String configurationId, VercelConfigAttributes body) { + return updateVercelConfigWithHttpInfoAsync(configurationId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the Datadog Vercel integration configuration for a given Vercel configuration. The + * provided payload replaces the existing API key reference, logs forwarding settings, and tracing + * settings stored in Datadog for this configuration. + * + * @param configurationId The Vercel configuration ID. (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateVercelConfigWithHttpInfo( + String configurationId, VercelConfigAttributes body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'configurationId' is set + if (configurationId == null) { + throw new ApiException( + 400, "Missing the required parameter 'configurationId' when calling updateVercelConfig"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateVercelConfig"); + } + // create path and map variables + String localVarPath = + "/api/v2/vercel/config/{configuration_id}" + .replaceAll( + "\\{" + "configuration_id" + "\\}", + apiClient.escapeString(configurationId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.VercelApi.updateVercelConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update Vercel configuration. + * + *

See {@link #updateVercelConfigWithHttpInfo}. + * + * @param configurationId The Vercel configuration ID. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> updateVercelConfigWithHttpInfoAsync( + String configurationId, VercelConfigAttributes body) { + Object localVarPostBody = body; + + // verify the required parameter 'configurationId' is set + if (configurationId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'configurationId' when calling updateVercelConfig")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateVercelConfig")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/vercel/config/{configuration_id}" + .replaceAll( + "\\{" + "configuration_id" + "\\}", + apiClient.escapeString(configurationId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.VercelApi.updateVercelConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + 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, + null); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/VercelApiKey.java b/src/main/java/com/datadog/api/client/v2/model/VercelApiKey.java new file mode 100644 index 00000000000..2a0531b5737 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/VercelApiKey.java @@ -0,0 +1,170 @@ +/* + * 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; + +/** Datadog API key reference used by the Vercel integration to send telemetry. */ +@JsonPropertyOrder({VercelApiKey.JSON_PROPERTY_ID, VercelApiKey.JSON_PROPERTY_VALUE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class VercelApiKey { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public VercelApiKey() {} + + @JsonCreator + public VercelApiKey( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.id = id; + this.value = value; + } + + public VercelApiKey id(String id) { + this.id = id; + return this; + } + + /** + * ID of the Datadog API key used by the Vercel integration. + * + * @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 VercelApiKey value(String value) { + this.value = value; + return this; + } + + /** + * Value of the Datadog API key. Returned as an empty string in read responses. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * 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 VercelApiKey + */ + @JsonAnySetter + public VercelApiKey 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 VercelApiKey object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VercelApiKey vercelApiKey = (VercelApiKey) o; + return Objects.equals(this.id, vercelApiKey.id) + && Objects.equals(this.value, vercelApiKey.value) + && Objects.equals(this.additionalProperties, vercelApiKey.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VercelApiKey {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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/VercelConfigAttributes.java b/src/main/java/com/datadog/api/client/v2/model/VercelConfigAttributes.java new file mode 100644 index 00000000000..074eac98d70 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/VercelConfigAttributes.java @@ -0,0 +1,208 @@ +/* + * 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 of the Datadog Vercel integration configuration. */ +@JsonPropertyOrder({ + VercelConfigAttributes.JSON_PROPERTY_API_KEY, + VercelConfigAttributes.JSON_PROPERTY_LOGS_CONFIG, + VercelConfigAttributes.JSON_PROPERTY_TRACE_CONFIG +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class VercelConfigAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_API_KEY = "apiKey"; + private VercelApiKey apiKey; + + public static final String JSON_PROPERTY_LOGS_CONFIG = "logsConfig"; + private VercelLogsConfig logsConfig; + + public static final String JSON_PROPERTY_TRACE_CONFIG = "traceConfig"; + private VercelTraceConfig traceConfig; + + public VercelConfigAttributes() {} + + @JsonCreator + public VercelConfigAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_API_KEY) VercelApiKey apiKey, + @JsonProperty(required = true, value = JSON_PROPERTY_LOGS_CONFIG) VercelLogsConfig logsConfig, + @JsonProperty(required = true, value = JSON_PROPERTY_TRACE_CONFIG) + VercelTraceConfig traceConfig) { + this.apiKey = apiKey; + this.unparsed |= apiKey.unparsed; + this.logsConfig = logsConfig; + this.unparsed |= logsConfig.unparsed; + this.traceConfig = traceConfig; + this.unparsed |= traceConfig.unparsed; + } + + public VercelConfigAttributes apiKey(VercelApiKey apiKey) { + this.apiKey = apiKey; + this.unparsed |= apiKey.unparsed; + return this; + } + + /** + * Datadog API key reference used by the Vercel integration to send telemetry. + * + * @return apiKey + */ + @JsonProperty(JSON_PROPERTY_API_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public VercelApiKey getApiKey() { + return apiKey; + } + + public void setApiKey(VercelApiKey apiKey) { + this.apiKey = apiKey; + } + + public VercelConfigAttributes logsConfig(VercelLogsConfig logsConfig) { + this.logsConfig = logsConfig; + this.unparsed |= logsConfig.unparsed; + return this; + } + + /** + * Logs forwarding configuration for the Vercel integration. + * + * @return logsConfig + */ + @JsonProperty(JSON_PROPERTY_LOGS_CONFIG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public VercelLogsConfig getLogsConfig() { + return logsConfig; + } + + public void setLogsConfig(VercelLogsConfig logsConfig) { + this.logsConfig = logsConfig; + } + + public VercelConfigAttributes traceConfig(VercelTraceConfig traceConfig) { + this.traceConfig = traceConfig; + this.unparsed |= traceConfig.unparsed; + return this; + } + + /** + * Tracing configuration for the Vercel integration. + * + * @return traceConfig + */ + @JsonProperty(JSON_PROPERTY_TRACE_CONFIG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public VercelTraceConfig getTraceConfig() { + return traceConfig; + } + + public void setTraceConfig(VercelTraceConfig traceConfig) { + this.traceConfig = traceConfig; + } + + /** + * 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 VercelConfigAttributes + */ + @JsonAnySetter + public VercelConfigAttributes 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 VercelConfigAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VercelConfigAttributes vercelConfigAttributes = (VercelConfigAttributes) o; + return Objects.equals(this.apiKey, vercelConfigAttributes.apiKey) + && Objects.equals(this.logsConfig, vercelConfigAttributes.logsConfig) + && Objects.equals(this.traceConfig, vercelConfigAttributes.traceConfig) + && Objects.equals(this.additionalProperties, vercelConfigAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(apiKey, logsConfig, traceConfig, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VercelConfigAttributes {\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n"); + sb.append(" logsConfig: ").append(toIndentedString(logsConfig)).append("\n"); + sb.append(" traceConfig: ").append(toIndentedString(traceConfig)).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/VercelConfigDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/VercelConfigDataResponse.java new file mode 100644 index 00000000000..85c0ae0f315 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/VercelConfigDataResponse.java @@ -0,0 +1,210 @@ +/* + * 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; + +/** Vercel configuration data returned by the API. */ +@JsonPropertyOrder({ + VercelConfigDataResponse.JSON_PROPERTY_ATTRIBUTES, + VercelConfigDataResponse.JSON_PROPERTY_ID, + VercelConfigDataResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class VercelConfigDataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private VercelConfigAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private VercelConfigDataResponseType type = VercelConfigDataResponseType.VERCEL_CONFIGURATION; + + public VercelConfigDataResponse() {} + + @JsonCreator + public VercelConfigDataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + VercelConfigAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + VercelConfigDataResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public VercelConfigDataResponse attributes(VercelConfigAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the Datadog Vercel integration configuration. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public VercelConfigAttributes getAttributes() { + return attributes; + } + + public void setAttributes(VercelConfigAttributes attributes) { + this.attributes = attributes; + } + + public VercelConfigDataResponse id(String id) { + this.id = id; + return this; + } + + /** + * Vercel configuration ID. + * + * @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 VercelConfigDataResponse type(VercelConfigDataResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for a Vercel configuration resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public VercelConfigDataResponseType getType() { + return type; + } + + public void setType(VercelConfigDataResponseType 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 VercelConfigDataResponse + */ + @JsonAnySetter + public VercelConfigDataResponse 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 VercelConfigDataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VercelConfigDataResponse vercelConfigDataResponse = (VercelConfigDataResponse) o; + return Objects.equals(this.attributes, vercelConfigDataResponse.attributes) + && Objects.equals(this.id, vercelConfigDataResponse.id) + && Objects.equals(this.type, vercelConfigDataResponse.type) + && Objects.equals(this.additionalProperties, vercelConfigDataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VercelConfigDataResponse {\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/VercelConfigDataResponseType.java b/src/main/java/com/datadog/api/client/v2/model/VercelConfigDataResponseType.java new file mode 100644 index 00000000000..de884d47cda --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/VercelConfigDataResponseType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type identifier for a Vercel configuration resource. */ +@JsonSerialize(using = VercelConfigDataResponseType.VercelConfigDataResponseTypeSerializer.class) +public class VercelConfigDataResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("vercelConfiguration")); + + public static final VercelConfigDataResponseType VERCEL_CONFIGURATION = + new VercelConfigDataResponseType("vercelConfiguration"); + + VercelConfigDataResponseType(String value) { + super(value, allowedValues); + } + + public static class VercelConfigDataResponseTypeSerializer + extends StdSerializer { + public VercelConfigDataResponseTypeSerializer(Class t) { + super(t); + } + + public VercelConfigDataResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + VercelConfigDataResponseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static VercelConfigDataResponseType fromValue(String value) { + return new VercelConfigDataResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/VercelConfigResponse.java b/src/main/java/com/datadog/api/client/v2/model/VercelConfigResponse.java new file mode 100644 index 00000000000..d8c32e5a01d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/VercelConfigResponse.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.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 Datadog Vercel integration configuration. */ +@JsonPropertyOrder({VercelConfigResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class VercelConfigResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private VercelConfigDataResponse data; + + public VercelConfigResponse() {} + + @JsonCreator + public VercelConfigResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) VercelConfigDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public VercelConfigResponse data(VercelConfigDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Vercel configuration data returned by the API. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public VercelConfigDataResponse getData() { + return data; + } + + public void setData(VercelConfigDataResponse 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 VercelConfigResponse + */ + @JsonAnySetter + public VercelConfigResponse 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 VercelConfigResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VercelConfigResponse vercelConfigResponse = (VercelConfigResponse) o; + return Objects.equals(this.data, vercelConfigResponse.data) + && Objects.equals(this.additionalProperties, vercelConfigResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VercelConfigResponse {\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/VercelEnvironment.java b/src/main/java/com/datadog/api/client/v2/model/VercelEnvironment.java new file mode 100644 index 00000000000..cd9a8fdc8ab --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/VercelEnvironment.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Vercel deployment environment. */ +@JsonSerialize(using = VercelEnvironment.VercelEnvironmentSerializer.class) +public class VercelEnvironment extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("production", "preview")); + + public static final VercelEnvironment PRODUCTION = new VercelEnvironment("production"); + public static final VercelEnvironment PREVIEW = new VercelEnvironment("preview"); + + VercelEnvironment(String value) { + super(value, allowedValues); + } + + public static class VercelEnvironmentSerializer extends StdSerializer { + public VercelEnvironmentSerializer(Class t) { + super(t); + } + + public VercelEnvironmentSerializer() { + this(null); + } + + @Override + public void serialize(VercelEnvironment value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static VercelEnvironment fromValue(String value) { + return new VercelEnvironment(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/VercelLogSource.java b/src/main/java/com/datadog/api/client/v2/model/VercelLogSource.java new file mode 100644 index 00000000000..bc9457ffda5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/VercelLogSource.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; + +/** Source of logs that Vercel forwards to Datadog. */ +@JsonSerialize(using = VercelLogSource.VercelLogSourceSerializer.class) +public class VercelLogSource extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList("static", "lambda", "edge", "build", "external", "firewall")); + + public static final VercelLogSource STATIC = new VercelLogSource("static"); + public static final VercelLogSource LAMBDA = new VercelLogSource("lambda"); + public static final VercelLogSource EDGE = new VercelLogSource("edge"); + public static final VercelLogSource BUILD = new VercelLogSource("build"); + public static final VercelLogSource EXTERNAL = new VercelLogSource("external"); + public static final VercelLogSource FIREWALL = new VercelLogSource("firewall"); + + VercelLogSource(String value) { + super(value, allowedValues); + } + + public static class VercelLogSourceSerializer extends StdSerializer { + public VercelLogSourceSerializer(Class t) { + super(t); + } + + public VercelLogSourceSerializer() { + this(null); + } + + @Override + public void serialize(VercelLogSource value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static VercelLogSource fromValue(String value) { + return new VercelLogSource(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/VercelLogsConfig.java b/src/main/java/com/datadog/api/client/v2/model/VercelLogsConfig.java new file mode 100644 index 00000000000..0a93c7d31bf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/VercelLogsConfig.java @@ -0,0 +1,247 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Logs forwarding configuration for the Vercel integration. */ +@JsonPropertyOrder({ + VercelLogsConfig.JSON_PROPERTY_ENABLED, + VercelLogsConfig.JSON_PROPERTY_ENVIRONMENTS, + VercelLogsConfig.JSON_PROPERTY_LOG_SOURCES, + VercelLogsConfig.JSON_PROPERTY_SAMPLING_PERCENTAGE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class VercelLogsConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_ENVIRONMENTS = "environments"; + private List environments = new ArrayList<>(); + + public static final String JSON_PROPERTY_LOG_SOURCES = "logSources"; + private List logSources = new ArrayList<>(); + + public static final String JSON_PROPERTY_SAMPLING_PERCENTAGE = "samplingPercentage"; + private Integer samplingPercentage; + + public VercelLogsConfig() {} + + @JsonCreator + public VercelLogsConfig( + @JsonProperty(required = true, value = JSON_PROPERTY_ENABLED) Boolean enabled, + @JsonProperty(required = true, value = JSON_PROPERTY_ENVIRONMENTS) + List environments, + @JsonProperty(required = true, value = JSON_PROPERTY_LOG_SOURCES) + List logSources, + @JsonProperty(required = true, value = JSON_PROPERTY_SAMPLING_PERCENTAGE) + Integer samplingPercentage) { + this.enabled = enabled; + this.environments = environments; + this.logSources = logSources; + this.samplingPercentage = samplingPercentage; + } + + public VercelLogsConfig enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether logs forwarding is enabled. + * + * @return enabled + */ + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public VercelLogsConfig environments(List environments) { + this.environments = environments; + return this; + } + + public VercelLogsConfig addEnvironmentsItem(VercelEnvironment environmentsItem) { + this.environments.add(environmentsItem); + this.unparsed |= !environmentsItem.isValid(); + return this; + } + + /** + * List of Vercel deployment environments to forward telemetry from. + * + * @return environments + */ + @JsonProperty(JSON_PROPERTY_ENVIRONMENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getEnvironments() { + return environments; + } + + public void setEnvironments(List environments) { + this.environments = environments; + } + + public VercelLogsConfig logSources(List logSources) { + this.logSources = logSources; + return this; + } + + public VercelLogsConfig addLogSourcesItem(VercelLogSource logSourcesItem) { + this.logSources.add(logSourcesItem); + this.unparsed |= !logSourcesItem.isValid(); + return this; + } + + /** + * List of Vercel log sources to forward to Datadog. + * + * @return logSources + */ + @JsonProperty(JSON_PROPERTY_LOG_SOURCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getLogSources() { + return logSources; + } + + public void setLogSources(List logSources) { + this.logSources = logSources; + } + + public VercelLogsConfig samplingPercentage(Integer samplingPercentage) { + this.samplingPercentage = samplingPercentage; + return this; + } + + /** + * Percentage of logs to forward to Datadog, between 0 and 100. minimum: 0 maximum: 100 + * + * @return samplingPercentage + */ + @JsonProperty(JSON_PROPERTY_SAMPLING_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getSamplingPercentage() { + return samplingPercentage; + } + + public void setSamplingPercentage(Integer samplingPercentage) { + this.samplingPercentage = samplingPercentage; + } + + /** + * 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 VercelLogsConfig + */ + @JsonAnySetter + public VercelLogsConfig 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 VercelLogsConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VercelLogsConfig vercelLogsConfig = (VercelLogsConfig) o; + return Objects.equals(this.enabled, vercelLogsConfig.enabled) + && Objects.equals(this.environments, vercelLogsConfig.environments) + && Objects.equals(this.logSources, vercelLogsConfig.logSources) + && Objects.equals(this.samplingPercentage, vercelLogsConfig.samplingPercentage) + && Objects.equals(this.additionalProperties, vercelLogsConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + enabled, environments, logSources, samplingPercentage, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VercelLogsConfig {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" environments: ").append(toIndentedString(environments)).append("\n"); + sb.append(" logSources: ").append(toIndentedString(logSources)).append("\n"); + sb.append(" samplingPercentage: ").append(toIndentedString(samplingPercentage)).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/VercelTokenCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/VercelTokenCreateRequest.java new file mode 100644 index 00000000000..533e179df89 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/VercelTokenCreateRequest.java @@ -0,0 +1,179 @@ +/* + * 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 to exchange a Vercel marketplace authorization code for a Datadog-managed access token. + */ +@JsonPropertyOrder({ + VercelTokenCreateRequest.JSON_PROPERTY_AUTH_GRANT_CODE, + VercelTokenCreateRequest.JSON_PROPERTY_VERCEL_CONFIGURATION_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class VercelTokenCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTH_GRANT_CODE = "authGrantCode"; + private String authGrantCode; + + public static final String JSON_PROPERTY_VERCEL_CONFIGURATION_ID = "vercelConfigurationId"; + private String vercelConfigurationId; + + public VercelTokenCreateRequest() {} + + @JsonCreator + public VercelTokenCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_AUTH_GRANT_CODE) String authGrantCode, + @JsonProperty(required = true, value = JSON_PROPERTY_VERCEL_CONFIGURATION_ID) + String vercelConfigurationId) { + this.authGrantCode = authGrantCode; + this.vercelConfigurationId = vercelConfigurationId; + } + + public VercelTokenCreateRequest authGrantCode(String authGrantCode) { + this.authGrantCode = authGrantCode; + return this; + } + + /** + * OAuth authorization code received from the Vercel marketplace flow. + * + * @return authGrantCode + */ + @JsonProperty(JSON_PROPERTY_AUTH_GRANT_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAuthGrantCode() { + return authGrantCode; + } + + public void setAuthGrantCode(String authGrantCode) { + this.authGrantCode = authGrantCode; + } + + public VercelTokenCreateRequest vercelConfigurationId(String vercelConfigurationId) { + this.vercelConfigurationId = vercelConfigurationId; + return this; + } + + /** + * Vercel configuration identifier returned by the marketplace flow. + * + * @return vercelConfigurationId + */ + @JsonProperty(JSON_PROPERTY_VERCEL_CONFIGURATION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getVercelConfigurationId() { + return vercelConfigurationId; + } + + public void setVercelConfigurationId(String vercelConfigurationId) { + this.vercelConfigurationId = vercelConfigurationId; + } + + /** + * 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 VercelTokenCreateRequest + */ + @JsonAnySetter + public VercelTokenCreateRequest 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 VercelTokenCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VercelTokenCreateRequest vercelTokenCreateRequest = (VercelTokenCreateRequest) o; + return Objects.equals(this.authGrantCode, vercelTokenCreateRequest.authGrantCode) + && Objects.equals( + this.vercelConfigurationId, vercelTokenCreateRequest.vercelConfigurationId) + && Objects.equals(this.additionalProperties, vercelTokenCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(authGrantCode, vercelConfigurationId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VercelTokenCreateRequest {\n"); + sb.append(" authGrantCode: ").append(toIndentedString(authGrantCode)).append("\n"); + sb.append(" vercelConfigurationId: ") + .append(toIndentedString(vercelConfigurationId)) + .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/VercelTraceConfig.java b/src/main/java/com/datadog/api/client/v2/model/VercelTraceConfig.java new file mode 100644 index 00000000000..99f26e0bee1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/VercelTraceConfig.java @@ -0,0 +1,203 @@ +/* + * 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; + +/** Tracing configuration for the Vercel integration. */ +@JsonPropertyOrder({ + VercelTraceConfig.JSON_PROPERTY_ENABLED, + VercelTraceConfig.JSON_PROPERTY_IS_DEPRECATED_OTEL, + VercelTraceConfig.JSON_PROPERTY_SAMPLING_PERCENTAGE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class VercelTraceConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_IS_DEPRECATED_OTEL = "isDeprecatedOtel"; + private Boolean isDeprecatedOtel; + + public static final String JSON_PROPERTY_SAMPLING_PERCENTAGE = "samplingPercentage"; + private Integer samplingPercentage; + + public VercelTraceConfig() {} + + @JsonCreator + public VercelTraceConfig( + @JsonProperty(required = true, value = JSON_PROPERTY_ENABLED) Boolean enabled, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_DEPRECATED_OTEL) + Boolean isDeprecatedOtel, + @JsonProperty(required = true, value = JSON_PROPERTY_SAMPLING_PERCENTAGE) + Integer samplingPercentage) { + this.enabled = enabled; + this.isDeprecatedOtel = isDeprecatedOtel; + this.samplingPercentage = samplingPercentage; + } + + public VercelTraceConfig enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether tracing is enabled. + * + * @return enabled + */ + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public VercelTraceConfig isDeprecatedOtel(Boolean isDeprecatedOtel) { + this.isDeprecatedOtel = isDeprecatedOtel; + return this; + } + + /** + * Whether the configuration uses the deprecated OpenTelemetry tracing setup. + * + * @return isDeprecatedOtel + */ + @JsonProperty(JSON_PROPERTY_IS_DEPRECATED_OTEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsDeprecatedOtel() { + return isDeprecatedOtel; + } + + public void setIsDeprecatedOtel(Boolean isDeprecatedOtel) { + this.isDeprecatedOtel = isDeprecatedOtel; + } + + public VercelTraceConfig samplingPercentage(Integer samplingPercentage) { + this.samplingPercentage = samplingPercentage; + return this; + } + + /** + * Percentage of traces to forward to Datadog, between 0 and 100. minimum: 0 maximum: 100 + * + * @return samplingPercentage + */ + @JsonProperty(JSON_PROPERTY_SAMPLING_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getSamplingPercentage() { + return samplingPercentage; + } + + public void setSamplingPercentage(Integer samplingPercentage) { + this.samplingPercentage = samplingPercentage; + } + + /** + * 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 VercelTraceConfig + */ + @JsonAnySetter + public VercelTraceConfig 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 VercelTraceConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VercelTraceConfig vercelTraceConfig = (VercelTraceConfig) o; + return Objects.equals(this.enabled, vercelTraceConfig.enabled) + && Objects.equals(this.isDeprecatedOtel, vercelTraceConfig.isDeprecatedOtel) + && Objects.equals(this.samplingPercentage, vercelTraceConfig.samplingPercentage) + && Objects.equals(this.additionalProperties, vercelTraceConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, isDeprecatedOtel, samplingPercentage, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VercelTraceConfig {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" isDeprecatedOtel: ").append(toIndentedString(isDeprecatedOtel)).append("\n"); + sb.append(" samplingPercentage: ").append(toIndentedString(samplingPercentage)).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/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 89626bc569e..d1cdac2882b 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 @@ -9305,6 +9305,24 @@ "type": "safe" } }, + "GetVercelConfig": { + "tag": "Vercel", + "undo": { + "type": "safe" + } + }, + "UpdateVercelConfig": { + "tag": "Vercel", + "undo": { + "type": "idempotent" + } + }, + "CreateVercelToken": { + "tag": "Vercel", + "undo": { + "type": "unsafe" + } + }, "ListWebIntegrationAccounts": { "tag": "Web Integrations", "undo": { diff --git a/src/test/resources/com/datadog/api/client/v2/api/vercel.feature b/src/test/resources/com/datadog/api/client/v2/api/vercel.feature new file mode 100644 index 00000000000..9a3b33d482d --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/vercel.feature @@ -0,0 +1,70 @@ +@endpoint(vercel) @endpoint(vercel-v2) +Feature: Vercel + Configure the Datadog Vercel integration. Endpoints in this section let + you exchange a Vercel marketplace authorization code for a Datadog-managed + access token and read or update the logs, traces, and API key + configuration associated with a Vercel project. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Vercel" API + + @generated @skip @team:DataDog/serverless-onboarding-and-enablement + Scenario: Create Vercel access token returns "Bad Request" response + Given new "CreateVercelToken" request + And body with value {"authGrantCode": "code", "vercelConfigurationId": "icfg_abc123"} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/serverless-onboarding-and-enablement + Scenario: Create Vercel access token returns "OK" response + Given new "CreateVercelToken" request + And body with value {"authGrantCode": "code", "vercelConfigurationId": "icfg_abc123"} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/serverless-onboarding-and-enablement + Scenario: Get Vercel configuration returns "Bad Request" response + Given new "GetVercelConfig" request + And request contains "configuration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/serverless-onboarding-and-enablement + Scenario: Get Vercel configuration returns "Not Found" response + Given new "GetVercelConfig" request + And request contains "configuration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/serverless-onboarding-and-enablement + Scenario: Get Vercel configuration returns "OK" response + Given new "GetVercelConfig" request + And request contains "configuration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/serverless-onboarding-and-enablement + Scenario: Update Vercel configuration returns "Bad Request" response + Given new "UpdateVercelConfig" request + And request contains "configuration_id" parameter from "REPLACE.ME" + And body with value {"apiKey": {"id": "00000000-0000-0000-0000-000000000001", "value": ""}, "logsConfig": {"enabled": true, "environments": ["production"], "logSources": ["lambda"], "samplingPercentage": 100}, "traceConfig": {"enabled": true, "isDeprecatedOtel": false, "samplingPercentage": 100}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/serverless-onboarding-and-enablement + Scenario: Update Vercel configuration returns "Not Found" response + Given new "UpdateVercelConfig" request + And request contains "configuration_id" parameter from "REPLACE.ME" + And body with value {"apiKey": {"id": "00000000-0000-0000-0000-000000000001", "value": ""}, "logsConfig": {"enabled": true, "environments": ["production"], "logSources": ["lambda"], "samplingPercentage": 100}, "traceConfig": {"enabled": true, "isDeprecatedOtel": false, "samplingPercentage": 100}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/serverless-onboarding-and-enablement + Scenario: Update Vercel configuration returns "OK" response + Given new "UpdateVercelConfig" request + And request contains "configuration_id" parameter from "REPLACE.ME" + And body with value {"apiKey": {"id": "00000000-0000-0000-0000-000000000001", "value": ""}, "logsConfig": {"enabled": true, "environments": ["production"], "logSources": ["lambda"], "samplingPercentage": 100}, "traceConfig": {"enabled": true, "isDeprecatedOtel": false, "samplingPercentage": 100}} + When the request is sent + Then the response status is 200 OK