From 66244bf560c0a65fe43ecc5ef4c98a5865d3316e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 21 Nov 2025 12:58:44 +0000 Subject: [PATCH] Regenerate client from commit 73f2ad5 of spec repo --- .generator/schemas/v2/openapi.yaml | 315 ++++++++++++++ .../v2/synthetics/PatchGlobalVariable.java | 44 ++ .../api/client/v2/api/SyntheticsApi.java | 167 +++++++ .../client/v2/model/GlobalVariableData.java | 196 +++++++++ .../model/GlobalVariableJsonPatchRequest.java | 148 +++++++ .../GlobalVariableJsonPatchRequestData.java | 172 ++++++++ ...ariableJsonPatchRequestDataAttributes.java | 155 +++++++ .../v2/model/GlobalVariableJsonPatchType.java | 57 +++ .../v2/model/GlobalVariableResponse.java | 136 ++++++ .../client/v2/model/GlobalVariableType.java | 55 +++ .../client/v2/model/JsonPatchOperation.java | 205 +++++++++ .../client/v2/model/JsonPatchOperationOp.java | 60 +++ .../v2/model/SyntheticsGlobalVariable.java | 407 ++++++++++++++++++ .../SyntheticsGlobalVariableAttributes.java | 148 +++++++ .../SyntheticsGlobalVariableOptions.java | 139 ++++++ ...theticsGlobalVariableParseTestOptions.java | 242 +++++++++++ ...icsGlobalVariableParseTestOptionsType.java | 70 +++ .../SyntheticsGlobalVariableParserType.java | 65 +++ ...yntheticsGlobalVariableTOTPParameters.java | 167 +++++++ .../model/SyntheticsGlobalVariableValue.java | 194 +++++++++ .../v2/model/SyntheticsVariableParser.java | 178 ++++++++ .../api/client/v2/api/synthetics.feature | 24 ++ .../com/datadog/api/client/v2/api/undo.json | 6 + 23 files changed, 3350 insertions(+) create mode 100644 examples/v2/synthetics/PatchGlobalVariable.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalVariableData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalVariableResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalVariableType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/JsonPatchOperation.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/JsonPatchOperationOp.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariable.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableOptions.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableParseTestOptions.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableParseTestOptionsType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableParserType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableTOTPParameters.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableValue.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsVariableParser.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb715496..1fe0e1f167d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -23651,6 +23651,61 @@ components: required: - type type: object + GlobalVariableData: + description: Synthetics global variable data. Wrapper around the global variable + object. + properties: + attributes: + $ref: '#/components/schemas/SyntheticsGlobalVariable' + id: + description: Global variable identifier. + type: string + type: + $ref: '#/components/schemas/GlobalVariableType' + type: object + GlobalVariableJsonPatchRequest: + description: JSON Patch request for global variable. + properties: + data: + $ref: '#/components/schemas/GlobalVariableJsonPatchRequestData' + required: + - data + type: object + GlobalVariableJsonPatchRequestData: + properties: + attributes: + $ref: '#/components/schemas/GlobalVariableJsonPatchRequestDataAttributes' + type: + $ref: '#/components/schemas/GlobalVariableJsonPatchType' + type: object + GlobalVariableJsonPatchRequestDataAttributes: + properties: + json_patch: + description: JSON Patch operations following RFC 6902. + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + type: object + GlobalVariableJsonPatchType: + description: Global variable JSON Patch type. + enum: + - global_variables_json_patch + type: string + x-enum-varnames: + - GLOBAL_VARIABLES_JSON_PATCH + GlobalVariableResponse: + description: Global variable response. + properties: + data: + $ref: '#/components/schemas/GlobalVariableData' + type: object + GlobalVariableType: + description: Global variable type. + enum: + - global_variables + type: string + x-enum-varnames: + - GLOBAL_VARIABLES GoogleMeetConfigurationReference: description: A reference to a Google Meet Configuration resource. nullable: true @@ -28404,6 +28459,40 @@ components: - to - index type: object + JsonPatchOperation: + description: A JSON Patch operation as per RFC 6902. + properties: + op: + $ref: '#/components/schemas/JsonPatchOperationOp' + path: + description: A JSON Pointer path (e.g., "/name", "/value/secure"). + example: /name + type: string + value: + description: The value to use for the operation (not applicable for "remove" + and "test" operations). + required: + - op + - path + type: object + JsonPatchOperationOp: + description: The operation to perform. + enum: + - add + - remove + - replace + - move + - copy + - test + example: add + type: string + x-enum-varnames: + - ADD + - REMOVE + - REPLACE + - MOVE + - COPY + - TEST KindAttributes: description: Kind attributes. properties: @@ -51322,6 +51411,178 @@ components: format: double type: number type: object + SyntheticsGlobalVariable: + description: Synthetic global variable. + properties: + attributes: + $ref: '#/components/schemas/SyntheticsGlobalVariableAttributes' + description: + description: Description of the global variable. + example: Example description + type: string + id: + description: Unique identifier of the global variable. + readOnly: true + type: string + is_fido: + description: Determines if the global variable is a FIDO variable. + type: boolean + is_totp: + description: Determines if the global variable is a TOTP/MFA variable. + type: boolean + name: + description: Name of the global variable. Unique across Synthetic global + variables. + example: MY_VARIABLE + type: string + parse_test_options: + $ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptions' + parse_test_public_id: + description: A Synthetic test ID to use as a test to generate the variable + value. + example: abc-def-123 + type: string + tags: + description: Tags of the global variable. + example: + - team:front + - test:workflow-1 + items: + description: Tag name. + type: string + type: array + value: + $ref: '#/components/schemas/SyntheticsGlobalVariableValue' + required: + - description + - name + - tags + - value + type: object + SyntheticsGlobalVariableAttributes: + description: Attributes of the global variable. + properties: + restricted_roles: + $ref: '#/components/schemas/SyntheticsRestrictedRoles' + type: object + SyntheticsGlobalVariableOptions: + description: Options for the Global Variable for MFA. + properties: + totp_parameters: + $ref: '#/components/schemas/SyntheticsGlobalVariableTOTPParameters' + type: object + SyntheticsGlobalVariableParseTestOptions: + description: Parser options to use for retrieving a Synthetic global variable + from a Synthetic test. Used in conjunction with `parse_test_public_id`. + properties: + field: + description: When type is `http_header`, name of the header to use to extract + the value. + example: content-type + type: string + localVariableName: + description: When type is `local_variable`, name of the local variable to + use to extract the value. + example: LOCAL_VARIABLE + type: string + parser: + $ref: '#/components/schemas/SyntheticsVariableParser' + type: + $ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptionsType' + required: + - type + type: object + SyntheticsGlobalVariableParseTestOptionsType: + description: Type of value to extract from a test for a Synthetic global variable. + enum: + - http_body + - http_header + - http_status_code + - local_variable + example: http_body + type: string + x-enum-varnames: + - HTTP_BODY + - HTTP_HEADER + - HTTP_STATUS_CODE + - LOCAL_VARIABLE + SyntheticsGlobalVariableParserType: + description: Type of parser for a Synthetic global variable from a synthetics + test. + enum: + - raw + - json_path + - regex + - x_path + example: raw + type: string + x-enum-varnames: + - RAW + - JSON_PATH + - REGEX + - X_PATH + SyntheticsGlobalVariableTOTPParameters: + description: Parameters for the TOTP/MFA variable + properties: + digits: + description: Number of digits for the OTP code. + example: 6 + format: int32 + maximum: 10 + minimum: 4 + type: integer + refresh_interval: + description: Interval for which to refresh the token (in seconds). + example: 30 + format: int32 + maximum: 999 + minimum: 0 + type: integer + type: object + SyntheticsGlobalVariableValue: + description: Value of the global variable. + example: + secure: true + value: value + properties: + options: + $ref: '#/components/schemas/SyntheticsGlobalVariableOptions' + secure: + description: Determines if the value of the variable is hidden. + type: boolean + value: + description: 'Value of the global variable. When reading a global variable, + + the value will not be present if the variable is hidden with the `secure` + property.' + example: example-value + type: string + type: object + SyntheticsRestrictedRoles: + description: A list of role identifiers that can be pulled from the Roles API, + for restricting read and write access. + example: + - xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + items: + description: UUID for a role. + example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + type: string + type: array + SyntheticsVariableParser: + description: Details of the parser to use for the global variable. + example: + type: regex + value: .* + properties: + type: + $ref: '#/components/schemas/SyntheticsGlobalVariableParserType' + value: + description: Regex or JSON path used for the parser. Not used with type + `raw`. + type: string + required: + - type + type: object TableResultV2: description: A reference table resource containing its full configuration and state. @@ -81694,6 +81955,60 @@ paths: operator: OR permissions: - billing_edit + /api/v2/synthetics/variables/{variable_id}/jsonpatch: + patch: + description: 'Patch a global variable using JSON Patch (RFC 6902). + + This endpoint allows partial updates to a global variable by specifying only + the fields to modify. + + + Common operations include: + + - Replace field values: `{"op": "replace", "path": "/name", "value": "new_name"}` + + - Update nested values: `{"op": "replace", "path": "/value/value", "value": + "new_value"}` + + - Add/update tags: `{"op": "add", "path": "/tags/-", "value": "new_tag"}` + + - Remove fields: `{"op": "remove", "path": "/description"}`' + operationId: PatchGlobalVariable + parameters: + - description: The ID of the global variable. + in: path + name: variable_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalVariableJsonPatchRequest' + description: JSON Patch document with operations to apply. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalVariableResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Patch a global variable + tags: + - Synthetics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - synthetics_global_variable_write /api/v2/tags/enrichment: get: description: List all tag pipeline rulesets - Retrieve a list of all tag pipeline diff --git a/examples/v2/synthetics/PatchGlobalVariable.java b/examples/v2/synthetics/PatchGlobalVariable.java new file mode 100644 index 00000000000..496f47e7f5c --- /dev/null +++ b/examples/v2/synthetics/PatchGlobalVariable.java @@ -0,0 +1,44 @@ +// Patch a global variable returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SyntheticsApi; +import com.datadog.api.client.v2.model.GlobalVariableJsonPatchRequest; +import com.datadog.api.client.v2.model.GlobalVariableJsonPatchRequestData; +import com.datadog.api.client.v2.model.GlobalVariableJsonPatchRequestDataAttributes; +import com.datadog.api.client.v2.model.GlobalVariableJsonPatchType; +import com.datadog.api.client.v2.model.GlobalVariableResponse; +import com.datadog.api.client.v2.model.JsonPatchOperation; +import com.datadog.api.client.v2.model.JsonPatchOperationOp; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + GlobalVariableJsonPatchRequest body = + new GlobalVariableJsonPatchRequest() + .data( + new GlobalVariableJsonPatchRequestData() + .attributes( + new GlobalVariableJsonPatchRequestDataAttributes() + .jsonPatch( + Collections.singletonList( + new JsonPatchOperation() + .op(JsonPatchOperationOp.ADD) + .path("/name")))) + .type(GlobalVariableJsonPatchType.GLOBAL_VARIABLES_JSON_PATCH)); + + try { + GlobalVariableResponse result = apiInstance.patchGlobalVariable("variable_id", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#patchGlobalVariable"); + 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/SyntheticsApi.java b/src/main/java/com/datadog/api/client/v2/api/SyntheticsApi.java index 22822b322e3..474f3ad7f24 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SyntheticsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SyntheticsApi.java @@ -4,6 +4,8 @@ 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.GlobalVariableJsonPatchRequest; +import com.datadog.api.client.v2.model.GlobalVariableResponse; import com.datadog.api.client.v2.model.OnDemandConcurrencyCapAttributes; import com.datadog.api.client.v2.model.OnDemandConcurrencyCapResponse; import jakarta.ws.rs.client.Invocation; @@ -155,6 +157,171 @@ public ApiResponse getOnDemandConcurrencyCapWith new GenericType() {}); } + /** + * Patch a global variable. + * + *

See {@link #patchGlobalVariableWithHttpInfo}. + * + * @param variableId The ID of the global variable. (required) + * @param body JSON Patch document with operations to apply. (required) + * @return GlobalVariableResponse + * @throws ApiException if fails to make API call + */ + public GlobalVariableResponse patchGlobalVariable( + String variableId, GlobalVariableJsonPatchRequest body) throws ApiException { + return patchGlobalVariableWithHttpInfo(variableId, body).getData(); + } + + /** + * Patch a global variable. + * + *

See {@link #patchGlobalVariableWithHttpInfoAsync}. + * + * @param variableId The ID of the global variable. (required) + * @param body JSON Patch document with operations to apply. (required) + * @return CompletableFuture<GlobalVariableResponse> + */ + public CompletableFuture patchGlobalVariableAsync( + String variableId, GlobalVariableJsonPatchRequest body) { + return patchGlobalVariableWithHttpInfoAsync(variableId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Patch a global variable using JSON Patch (RFC 6902). This endpoint allows partial updates to a + * global variable by specifying only the fields to modify. + * + *

Common operations include: - Replace field values: + * {"op": "replace", "path": "/name", "value": "new_name"} - Update nested values: + * {"op": "replace", "path": "/value/value", "value": "new_value"} - Add/update tags: + * {"op": "add", "path": "/tags/-", "value": "new_tag"} - Remove fields: + * {"op": "remove", "path": "/description"} + * + * @param variableId The ID of the global variable. (required) + * @param body JSON Patch document with operations to apply. (required) + * @return ApiResponse<GlobalVariableResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse patchGlobalVariableWithHttpInfo( + String variableId, GlobalVariableJsonPatchRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'variableId' is set + if (variableId == null) { + throw new ApiException( + 400, "Missing the required parameter 'variableId' when calling patchGlobalVariable"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling patchGlobalVariable"); + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/variables/{variable_id}/jsonpatch" + .replaceAll( + "\\{" + "variable_id" + "\\}", apiClient.escapeString(variableId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SyntheticsApi.patchGlobalVariable", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Patch a global variable. + * + *

See {@link #patchGlobalVariableWithHttpInfo}. + * + * @param variableId The ID of the global variable. (required) + * @param body JSON Patch document with operations to apply. (required) + * @return CompletableFuture<ApiResponse<GlobalVariableResponse>> + */ + public CompletableFuture> + patchGlobalVariableWithHttpInfoAsync(String variableId, GlobalVariableJsonPatchRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'variableId' is set + if (variableId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'variableId' when calling patchGlobalVariable")); + 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 patchGlobalVariable")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/variables/{variable_id}/jsonpatch" + .replaceAll( + "\\{" + "variable_id" + "\\}", apiClient.escapeString(variableId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SyntheticsApi.patchGlobalVariable", + 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( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Save new value for on-demand concurrency cap. * diff --git a/src/main/java/com/datadog/api/client/v2/model/GlobalVariableData.java b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableData.java new file mode 100644 index 00000000000..da6a72d710b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableData.java @@ -0,0 +1,196 @@ +/* + * 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; + +/** Synthetics global variable data. Wrapper around the global variable object. */ +@JsonPropertyOrder({ + GlobalVariableData.JSON_PROPERTY_ATTRIBUTES, + GlobalVariableData.JSON_PROPERTY_ID, + GlobalVariableData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalVariableData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SyntheticsGlobalVariable attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GlobalVariableType type; + + public GlobalVariableData attributes(SyntheticsGlobalVariable attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Synthetic global variable. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsGlobalVariable getAttributes() { + return attributes; + } + + public void setAttributes(SyntheticsGlobalVariable attributes) { + this.attributes = attributes; + } + + public GlobalVariableData id(String id) { + this.id = id; + return this; + } + + /** + * Global variable identifier. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GlobalVariableData type(GlobalVariableType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Global variable type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GlobalVariableType getType() { + return type; + } + + public void setType(GlobalVariableType 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 GlobalVariableData + */ + @JsonAnySetter + public GlobalVariableData 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 GlobalVariableData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalVariableData globalVariableData = (GlobalVariableData) o; + return Objects.equals(this.attributes, globalVariableData.attributes) + && Objects.equals(this.id, globalVariableData.id) + && Objects.equals(this.type, globalVariableData.type) + && Objects.equals(this.additionalProperties, globalVariableData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalVariableData {\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/GlobalVariableJsonPatchRequest.java b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchRequest.java new file mode 100644 index 00000000000..29c15a1303a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchRequest.java @@ -0,0 +1,148 @@ +/* + * 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 Patch request for global variable. */ +@JsonPropertyOrder({GlobalVariableJsonPatchRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalVariableJsonPatchRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GlobalVariableJsonPatchRequestData data; + + public GlobalVariableJsonPatchRequest() {} + + @JsonCreator + public GlobalVariableJsonPatchRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GlobalVariableJsonPatchRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GlobalVariableJsonPatchRequest data(GlobalVariableJsonPatchRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GlobalVariableJsonPatchRequestData getData() { + return data; + } + + public void setData(GlobalVariableJsonPatchRequestData 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 GlobalVariableJsonPatchRequest + */ + @JsonAnySetter + public GlobalVariableJsonPatchRequest 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 GlobalVariableJsonPatchRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalVariableJsonPatchRequest globalVariableJsonPatchRequest = + (GlobalVariableJsonPatchRequest) o; + return Objects.equals(this.data, globalVariableJsonPatchRequest.data) + && Objects.equals( + this.additionalProperties, globalVariableJsonPatchRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalVariableJsonPatchRequest {\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/GlobalVariableJsonPatchRequestData.java b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchRequestData.java new file mode 100644 index 00000000000..f0a1ad20711 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchRequestData.java @@ -0,0 +1,172 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ + GlobalVariableJsonPatchRequestData.JSON_PROPERTY_ATTRIBUTES, + GlobalVariableJsonPatchRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalVariableJsonPatchRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GlobalVariableJsonPatchRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GlobalVariableJsonPatchType type; + + public GlobalVariableJsonPatchRequestData attributes( + GlobalVariableJsonPatchRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Getattributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GlobalVariableJsonPatchRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GlobalVariableJsonPatchRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public GlobalVariableJsonPatchRequestData type(GlobalVariableJsonPatchType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Global variable JSON Patch type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GlobalVariableJsonPatchType getType() { + return type; + } + + public void setType(GlobalVariableJsonPatchType 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 GlobalVariableJsonPatchRequestData + */ + @JsonAnySetter + public GlobalVariableJsonPatchRequestData 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 GlobalVariableJsonPatchRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalVariableJsonPatchRequestData globalVariableJsonPatchRequestData = + (GlobalVariableJsonPatchRequestData) o; + return Objects.equals(this.attributes, globalVariableJsonPatchRequestData.attributes) + && Objects.equals(this.type, globalVariableJsonPatchRequestData.type) + && Objects.equals( + this.additionalProperties, globalVariableJsonPatchRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalVariableJsonPatchRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/GlobalVariableJsonPatchRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchRequestDataAttributes.java new file mode 100644 index 00000000000..7dc82fa8fcb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchRequestDataAttributes.java @@ -0,0 +1,155 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({GlobalVariableJsonPatchRequestDataAttributes.JSON_PROPERTY_JSON_PATCH}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalVariableJsonPatchRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_JSON_PATCH = "json_patch"; + private List jsonPatch = null; + + public GlobalVariableJsonPatchRequestDataAttributes jsonPatch( + List jsonPatch) { + this.jsonPatch = jsonPatch; + for (JsonPatchOperation item : jsonPatch) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GlobalVariableJsonPatchRequestDataAttributes addJsonPatchItem( + JsonPatchOperation jsonPatchItem) { + if (this.jsonPatch == null) { + this.jsonPatch = new ArrayList<>(); + } + this.jsonPatch.add(jsonPatchItem); + this.unparsed |= jsonPatchItem.unparsed; + return this; + } + + /** + * JSON Patch operations following RFC 6902. + * + * @return jsonPatch + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JSON_PATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getJsonPatch() { + return jsonPatch; + } + + public void setJsonPatch(List jsonPatch) { + this.jsonPatch = jsonPatch; + } + + /** + * 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 GlobalVariableJsonPatchRequestDataAttributes + */ + @JsonAnySetter + public GlobalVariableJsonPatchRequestDataAttributes 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 GlobalVariableJsonPatchRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalVariableJsonPatchRequestDataAttributes globalVariableJsonPatchRequestDataAttributes = + (GlobalVariableJsonPatchRequestDataAttributes) o; + return Objects.equals(this.jsonPatch, globalVariableJsonPatchRequestDataAttributes.jsonPatch) + && Objects.equals( + this.additionalProperties, + globalVariableJsonPatchRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(jsonPatch, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalVariableJsonPatchRequestDataAttributes {\n"); + sb.append(" jsonPatch: ").append(toIndentedString(jsonPatch)).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/GlobalVariableJsonPatchType.java b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchType.java new file mode 100644 index 00000000000..9a65c08b720 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableJsonPatchType.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; + +/** Global variable JSON Patch type. */ +@JsonSerialize(using = GlobalVariableJsonPatchType.GlobalVariableJsonPatchTypeSerializer.class) +public class GlobalVariableJsonPatchType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("global_variables_json_patch")); + + public static final GlobalVariableJsonPatchType GLOBAL_VARIABLES_JSON_PATCH = + new GlobalVariableJsonPatchType("global_variables_json_patch"); + + GlobalVariableJsonPatchType(String value) { + super(value, allowedValues); + } + + public static class GlobalVariableJsonPatchTypeSerializer + extends StdSerializer { + public GlobalVariableJsonPatchTypeSerializer(Class t) { + super(t); + } + + public GlobalVariableJsonPatchTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GlobalVariableJsonPatchType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GlobalVariableJsonPatchType fromValue(String value) { + return new GlobalVariableJsonPatchType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GlobalVariableResponse.java b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableResponse.java new file mode 100644 index 00000000000..f8b342c1c8a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableResponse.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Global variable response. */ +@JsonPropertyOrder({GlobalVariableResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalVariableResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GlobalVariableData data; + + public GlobalVariableResponse data(GlobalVariableData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Synthetics global variable data. Wrapper around the global variable object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GlobalVariableData getData() { + return data; + } + + public void setData(GlobalVariableData 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 GlobalVariableResponse + */ + @JsonAnySetter + public GlobalVariableResponse 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 GlobalVariableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalVariableResponse globalVariableResponse = (GlobalVariableResponse) o; + return Objects.equals(this.data, globalVariableResponse.data) + && Objects.equals(this.additionalProperties, globalVariableResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalVariableResponse {\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/GlobalVariableType.java b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableType.java new file mode 100644 index 00000000000..9ebeb89084c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalVariableType.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; + +/** Global variable type. */ +@JsonSerialize(using = GlobalVariableType.GlobalVariableTypeSerializer.class) +public class GlobalVariableType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("global_variables")); + + public static final GlobalVariableType GLOBAL_VARIABLES = + new GlobalVariableType("global_variables"); + + GlobalVariableType(String value) { + super(value, allowedValues); + } + + public static class GlobalVariableTypeSerializer extends StdSerializer { + public GlobalVariableTypeSerializer(Class t) { + super(t); + } + + public GlobalVariableTypeSerializer() { + this(null); + } + + @Override + public void serialize(GlobalVariableType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GlobalVariableType fromValue(String value) { + return new GlobalVariableType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/JsonPatchOperation.java b/src/main/java/com/datadog/api/client/v2/model/JsonPatchOperation.java new file mode 100644 index 00000000000..629b1d74b03 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JsonPatchOperation.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A JSON Patch operation as per RFC 6902. */ +@JsonPropertyOrder({ + JsonPatchOperation.JSON_PROPERTY_OP, + JsonPatchOperation.JSON_PROPERTY_PATH, + JsonPatchOperation.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class JsonPatchOperation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OP = "op"; + private JsonPatchOperationOp op; + + public static final String JSON_PROPERTY_PATH = "path"; + private String path; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Object value = null; + + public JsonPatchOperation() {} + + @JsonCreator + public JsonPatchOperation( + @JsonProperty(required = true, value = JSON_PROPERTY_OP) JsonPatchOperationOp op, + @JsonProperty(required = true, value = JSON_PROPERTY_PATH) String path) { + this.op = op; + this.unparsed |= !op.isValid(); + this.path = path; + } + + public JsonPatchOperation op(JsonPatchOperationOp op) { + this.op = op; + this.unparsed |= !op.isValid(); + return this; + } + + /** + * The operation to perform. + * + * @return op + */ + @JsonProperty(JSON_PROPERTY_OP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JsonPatchOperationOp getOp() { + return op; + } + + public void setOp(JsonPatchOperationOp op) { + if (!op.isValid()) { + this.unparsed = true; + } + this.op = op; + } + + public JsonPatchOperation path(String path) { + this.path = path; + return this; + } + + /** + * A JSON Pointer path (e.g., "/name", "/value/secure"). + * + * @return path + */ + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public JsonPatchOperation value(Object value) { + this.value = value; + return this; + } + + /** + * The value to use for the operation (not applicable for "remove" and "test" operations). + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getValue() { + return value; + } + + public void setValue(Object 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 JsonPatchOperation + */ + @JsonAnySetter + public JsonPatchOperation 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 JsonPatchOperation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JsonPatchOperation jsonPatchOperation = (JsonPatchOperation) o; + return Objects.equals(this.op, jsonPatchOperation.op) + && Objects.equals(this.path, jsonPatchOperation.path) + && Objects.equals(this.value, jsonPatchOperation.value) + && Objects.equals(this.additionalProperties, jsonPatchOperation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(op, path, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JsonPatchOperation {\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).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/JsonPatchOperationOp.java b/src/main/java/com/datadog/api/client/v2/model/JsonPatchOperationOp.java new file mode 100644 index 00000000000..368648ad030 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JsonPatchOperationOp.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; + +/** The operation to perform. */ +@JsonSerialize(using = JsonPatchOperationOp.JsonPatchOperationOpSerializer.class) +public class JsonPatchOperationOp extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("add", "remove", "replace", "move", "copy", "test")); + + public static final JsonPatchOperationOp ADD = new JsonPatchOperationOp("add"); + public static final JsonPatchOperationOp REMOVE = new JsonPatchOperationOp("remove"); + public static final JsonPatchOperationOp REPLACE = new JsonPatchOperationOp("replace"); + public static final JsonPatchOperationOp MOVE = new JsonPatchOperationOp("move"); + public static final JsonPatchOperationOp COPY = new JsonPatchOperationOp("copy"); + public static final JsonPatchOperationOp TEST = new JsonPatchOperationOp("test"); + + JsonPatchOperationOp(String value) { + super(value, allowedValues); + } + + public static class JsonPatchOperationOpSerializer extends StdSerializer { + public JsonPatchOperationOpSerializer(Class t) { + super(t); + } + + public JsonPatchOperationOpSerializer() { + this(null); + } + + @Override + public void serialize( + JsonPatchOperationOp value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static JsonPatchOperationOp fromValue(String value) { + return new JsonPatchOperationOp(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariable.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariable.java new file mode 100644 index 00000000000..dcd72b41d40 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariable.java @@ -0,0 +1,407 @@ +/* + * 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; + +/** Synthetic global variable. */ +@JsonPropertyOrder({ + SyntheticsGlobalVariable.JSON_PROPERTY_ATTRIBUTES, + SyntheticsGlobalVariable.JSON_PROPERTY_DESCRIPTION, + SyntheticsGlobalVariable.JSON_PROPERTY_ID, + SyntheticsGlobalVariable.JSON_PROPERTY_IS_FIDO, + SyntheticsGlobalVariable.JSON_PROPERTY_IS_TOTP, + SyntheticsGlobalVariable.JSON_PROPERTY_NAME, + SyntheticsGlobalVariable.JSON_PROPERTY_PARSE_TEST_OPTIONS, + SyntheticsGlobalVariable.JSON_PROPERTY_PARSE_TEST_PUBLIC_ID, + SyntheticsGlobalVariable.JSON_PROPERTY_TAGS, + SyntheticsGlobalVariable.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsGlobalVariable { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SyntheticsGlobalVariableAttributes attributes; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_IS_FIDO = "is_fido"; + private Boolean isFido; + + public static final String JSON_PROPERTY_IS_TOTP = "is_totp"; + private Boolean isTotp; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PARSE_TEST_OPTIONS = "parse_test_options"; + private SyntheticsGlobalVariableParseTestOptions parseTestOptions; + + public static final String JSON_PROPERTY_PARSE_TEST_PUBLIC_ID = "parse_test_public_id"; + private String parseTestPublicId; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); + + public static final String JSON_PROPERTY_VALUE = "value"; + private SyntheticsGlobalVariableValue value; + + public SyntheticsGlobalVariable() {} + + @JsonCreator + public SyntheticsGlobalVariable( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) + SyntheticsGlobalVariableValue value) { + this.description = description; + this.name = name; + this.tags = tags; + this.value = value; + this.unparsed |= value.unparsed; + } + + public SyntheticsGlobalVariable attributes(SyntheticsGlobalVariableAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the global variable. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsGlobalVariableAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SyntheticsGlobalVariableAttributes attributes) { + this.attributes = attributes; + } + + public SyntheticsGlobalVariable description(String description) { + this.description = description; + return this; + } + + /** + * Description of the global variable. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * Unique identifier of the global variable. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public SyntheticsGlobalVariable isFido(Boolean isFido) { + this.isFido = isFido; + return this; + } + + /** + * Determines if the global variable is a FIDO variable. + * + * @return isFido + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_FIDO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFido() { + return isFido; + } + + public void setIsFido(Boolean isFido) { + this.isFido = isFido; + } + + public SyntheticsGlobalVariable isTotp(Boolean isTotp) { + this.isTotp = isTotp; + return this; + } + + /** + * Determines if the global variable is a TOTP/MFA variable. + * + * @return isTotp + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_TOTP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsTotp() { + return isTotp; + } + + public void setIsTotp(Boolean isTotp) { + this.isTotp = isTotp; + } + + public SyntheticsGlobalVariable name(String name) { + this.name = name; + return this; + } + + /** + * Name of the global variable. Unique across Synthetic global variables. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SyntheticsGlobalVariable parseTestOptions( + SyntheticsGlobalVariableParseTestOptions parseTestOptions) { + this.parseTestOptions = parseTestOptions; + this.unparsed |= parseTestOptions.unparsed; + return this; + } + + /** + * Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in + * conjunction with parse_test_public_id. + * + * @return parseTestOptions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARSE_TEST_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsGlobalVariableParseTestOptions getParseTestOptions() { + return parseTestOptions; + } + + public void setParseTestOptions(SyntheticsGlobalVariableParseTestOptions parseTestOptions) { + this.parseTestOptions = parseTestOptions; + } + + public SyntheticsGlobalVariable parseTestPublicId(String parseTestPublicId) { + this.parseTestPublicId = parseTestPublicId; + return this; + } + + /** + * A Synthetic test ID to use as a test to generate the variable value. + * + * @return parseTestPublicId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARSE_TEST_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParseTestPublicId() { + return parseTestPublicId; + } + + public void setParseTestPublicId(String parseTestPublicId) { + this.parseTestPublicId = parseTestPublicId; + } + + public SyntheticsGlobalVariable tags(List tags) { + this.tags = tags; + return this; + } + + public SyntheticsGlobalVariable addTagsItem(String tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * Tags of the global variable. + * + * @return tags + */ + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public SyntheticsGlobalVariable value(SyntheticsGlobalVariableValue value) { + this.value = value; + this.unparsed |= value.unparsed; + return this; + } + + /** + * Value of the global variable. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsGlobalVariableValue getValue() { + return value; + } + + public void setValue(SyntheticsGlobalVariableValue 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 SyntheticsGlobalVariable + */ + @JsonAnySetter + public SyntheticsGlobalVariable 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 SyntheticsGlobalVariable object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsGlobalVariable syntheticsGlobalVariable = (SyntheticsGlobalVariable) o; + return Objects.equals(this.attributes, syntheticsGlobalVariable.attributes) + && Objects.equals(this.description, syntheticsGlobalVariable.description) + && Objects.equals(this.id, syntheticsGlobalVariable.id) + && Objects.equals(this.isFido, syntheticsGlobalVariable.isFido) + && Objects.equals(this.isTotp, syntheticsGlobalVariable.isTotp) + && Objects.equals(this.name, syntheticsGlobalVariable.name) + && Objects.equals(this.parseTestOptions, syntheticsGlobalVariable.parseTestOptions) + && Objects.equals(this.parseTestPublicId, syntheticsGlobalVariable.parseTestPublicId) + && Objects.equals(this.tags, syntheticsGlobalVariable.tags) + && Objects.equals(this.value, syntheticsGlobalVariable.value) + && Objects.equals(this.additionalProperties, syntheticsGlobalVariable.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + attributes, + description, + id, + isFido, + isTotp, + name, + parseTestOptions, + parseTestPublicId, + tags, + value, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsGlobalVariable {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" isFido: ").append(toIndentedString(isFido)).append("\n"); + sb.append(" isTotp: ").append(toIndentedString(isTotp)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parseTestOptions: ").append(toIndentedString(parseTestOptions)).append("\n"); + sb.append(" parseTestPublicId: ").append(toIndentedString(parseTestPublicId)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).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/SyntheticsGlobalVariableAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableAttributes.java new file mode 100644 index 00000000000..34236eed62e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableAttributes.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the global variable. */ +@JsonPropertyOrder({SyntheticsGlobalVariableAttributes.JSON_PROPERTY_RESTRICTED_ROLES}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsGlobalVariableAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RESTRICTED_ROLES = "restricted_roles"; + private List restrictedRoles = null; + + public SyntheticsGlobalVariableAttributes restrictedRoles(List restrictedRoles) { + this.restrictedRoles = restrictedRoles; + return this; + } + + public SyntheticsGlobalVariableAttributes addRestrictedRolesItem(String restrictedRolesItem) { + if (this.restrictedRoles == null) { + this.restrictedRoles = new ArrayList<>(); + } + this.restrictedRoles.add(restrictedRolesItem); + return this; + } + + /** + * A list of role identifiers that can be pulled from the Roles API, for restricting read and + * write access. + * + * @return restrictedRoles + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESTRICTED_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRestrictedRoles() { + return restrictedRoles; + } + + public void setRestrictedRoles(List restrictedRoles) { + this.restrictedRoles = restrictedRoles; + } + + /** + * 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 SyntheticsGlobalVariableAttributes + */ + @JsonAnySetter + public SyntheticsGlobalVariableAttributes 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 SyntheticsGlobalVariableAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsGlobalVariableAttributes syntheticsGlobalVariableAttributes = + (SyntheticsGlobalVariableAttributes) o; + return Objects.equals(this.restrictedRoles, syntheticsGlobalVariableAttributes.restrictedRoles) + && Objects.equals( + this.additionalProperties, syntheticsGlobalVariableAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(restrictedRoles, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsGlobalVariableAttributes {\n"); + sb.append(" restrictedRoles: ").append(toIndentedString(restrictedRoles)).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/SyntheticsGlobalVariableOptions.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableOptions.java new file mode 100644 index 00000000000..a0d4a8a74e6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableOptions.java @@ -0,0 +1,139 @@ +/* + * 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; + +/** Options for the Global Variable for MFA. */ +@JsonPropertyOrder({SyntheticsGlobalVariableOptions.JSON_PROPERTY_TOTP_PARAMETERS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsGlobalVariableOptions { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TOTP_PARAMETERS = "totp_parameters"; + private SyntheticsGlobalVariableTOTPParameters totpParameters; + + public SyntheticsGlobalVariableOptions totpParameters( + SyntheticsGlobalVariableTOTPParameters totpParameters) { + this.totpParameters = totpParameters; + this.unparsed |= totpParameters.unparsed; + return this; + } + + /** + * Parameters for the TOTP/MFA variable + * + * @return totpParameters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTP_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsGlobalVariableTOTPParameters getTotpParameters() { + return totpParameters; + } + + public void setTotpParameters(SyntheticsGlobalVariableTOTPParameters totpParameters) { + this.totpParameters = totpParameters; + } + + /** + * 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 SyntheticsGlobalVariableOptions + */ + @JsonAnySetter + public SyntheticsGlobalVariableOptions 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 SyntheticsGlobalVariableOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsGlobalVariableOptions syntheticsGlobalVariableOptions = + (SyntheticsGlobalVariableOptions) o; + return Objects.equals(this.totpParameters, syntheticsGlobalVariableOptions.totpParameters) + && Objects.equals( + this.additionalProperties, syntheticsGlobalVariableOptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(totpParameters, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsGlobalVariableOptions {\n"); + sb.append(" totpParameters: ").append(toIndentedString(totpParameters)).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/SyntheticsGlobalVariableParseTestOptions.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableParseTestOptions.java new file mode 100644 index 00000000000..08c0c30c9e9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableParseTestOptions.java @@ -0,0 +1,242 @@ +/* + * 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; + +/** + * Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in + * conjunction with parse_test_public_id. + */ +@JsonPropertyOrder({ + SyntheticsGlobalVariableParseTestOptions.JSON_PROPERTY_FIELD, + SyntheticsGlobalVariableParseTestOptions.JSON_PROPERTY_LOCAL_VARIABLE_NAME, + SyntheticsGlobalVariableParseTestOptions.JSON_PROPERTY_PARSER, + SyntheticsGlobalVariableParseTestOptions.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsGlobalVariableParseTestOptions { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIELD = "field"; + private String field; + + public static final String JSON_PROPERTY_LOCAL_VARIABLE_NAME = "localVariableName"; + private String localVariableName; + + public static final String JSON_PROPERTY_PARSER = "parser"; + private SyntheticsVariableParser parser; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsGlobalVariableParseTestOptionsType type; + + public SyntheticsGlobalVariableParseTestOptions() {} + + @JsonCreator + public SyntheticsGlobalVariableParseTestOptions( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + SyntheticsGlobalVariableParseTestOptionsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SyntheticsGlobalVariableParseTestOptions field(String field) { + this.field = field; + return this; + } + + /** + * When type is http_header, name of the header to use to extract the value. + * + * @return field + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getField() { + return field; + } + + public void setField(String field) { + this.field = field; + } + + public SyntheticsGlobalVariableParseTestOptions localVariableName(String localVariableName) { + this.localVariableName = localVariableName; + return this; + } + + /** + * When type is local_variable, name of the local variable to use to extract the + * value. + * + * @return localVariableName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCAL_VARIABLE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalVariableName() { + return localVariableName; + } + + public void setLocalVariableName(String localVariableName) { + this.localVariableName = localVariableName; + } + + public SyntheticsGlobalVariableParseTestOptions parser(SyntheticsVariableParser parser) { + this.parser = parser; + this.unparsed |= parser.unparsed; + return this; + } + + /** + * Details of the parser to use for the global variable. + * + * @return parser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARSER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsVariableParser getParser() { + return parser; + } + + public void setParser(SyntheticsVariableParser parser) { + this.parser = parser; + } + + public SyntheticsGlobalVariableParseTestOptions type( + SyntheticsGlobalVariableParseTestOptionsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of value to extract from a test for a Synthetic global variable. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsGlobalVariableParseTestOptionsType getType() { + return type; + } + + public void setType(SyntheticsGlobalVariableParseTestOptionsType 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 SyntheticsGlobalVariableParseTestOptions + */ + @JsonAnySetter + public SyntheticsGlobalVariableParseTestOptions 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 SyntheticsGlobalVariableParseTestOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsGlobalVariableParseTestOptions syntheticsGlobalVariableParseTestOptions = + (SyntheticsGlobalVariableParseTestOptions) o; + return Objects.equals(this.field, syntheticsGlobalVariableParseTestOptions.field) + && Objects.equals( + this.localVariableName, syntheticsGlobalVariableParseTestOptions.localVariableName) + && Objects.equals(this.parser, syntheticsGlobalVariableParseTestOptions.parser) + && Objects.equals(this.type, syntheticsGlobalVariableParseTestOptions.type) + && Objects.equals( + this.additionalProperties, + syntheticsGlobalVariableParseTestOptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(field, localVariableName, parser, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsGlobalVariableParseTestOptions {\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" localVariableName: ").append(toIndentedString(localVariableName)).append("\n"); + sb.append(" parser: ").append(toIndentedString(parser)).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/SyntheticsGlobalVariableParseTestOptionsType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableParseTestOptionsType.java new file mode 100644 index 00000000000..9b2168f90ed --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableParseTestOptionsType.java @@ -0,0 +1,70 @@ +/* + * 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 of value to extract from a test for a Synthetic global variable. */ +@JsonSerialize( + using = + SyntheticsGlobalVariableParseTestOptionsType + .SyntheticsGlobalVariableParseTestOptionsTypeSerializer.class) +public class SyntheticsGlobalVariableParseTestOptionsType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList("http_body", "http_header", "http_status_code", "local_variable")); + + public static final SyntheticsGlobalVariableParseTestOptionsType HTTP_BODY = + new SyntheticsGlobalVariableParseTestOptionsType("http_body"); + public static final SyntheticsGlobalVariableParseTestOptionsType HTTP_HEADER = + new SyntheticsGlobalVariableParseTestOptionsType("http_header"); + public static final SyntheticsGlobalVariableParseTestOptionsType HTTP_STATUS_CODE = + new SyntheticsGlobalVariableParseTestOptionsType("http_status_code"); + public static final SyntheticsGlobalVariableParseTestOptionsType LOCAL_VARIABLE = + new SyntheticsGlobalVariableParseTestOptionsType("local_variable"); + + SyntheticsGlobalVariableParseTestOptionsType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsGlobalVariableParseTestOptionsTypeSerializer + extends StdSerializer { + public SyntheticsGlobalVariableParseTestOptionsTypeSerializer( + Class t) { + super(t); + } + + public SyntheticsGlobalVariableParseTestOptionsTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsGlobalVariableParseTestOptionsType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsGlobalVariableParseTestOptionsType fromValue(String value) { + return new SyntheticsGlobalVariableParseTestOptionsType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableParserType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableParserType.java new file mode 100644 index 00000000000..c17df97313a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableParserType.java @@ -0,0 +1,65 @@ +/* + * 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 of parser for a Synthetic global variable from a synthetics test. */ +@JsonSerialize( + using = SyntheticsGlobalVariableParserType.SyntheticsGlobalVariableParserTypeSerializer.class) +public class SyntheticsGlobalVariableParserType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("raw", "json_path", "regex", "x_path")); + + public static final SyntheticsGlobalVariableParserType RAW = + new SyntheticsGlobalVariableParserType("raw"); + public static final SyntheticsGlobalVariableParserType JSON_PATH = + new SyntheticsGlobalVariableParserType("json_path"); + public static final SyntheticsGlobalVariableParserType REGEX = + new SyntheticsGlobalVariableParserType("regex"); + public static final SyntheticsGlobalVariableParserType X_PATH = + new SyntheticsGlobalVariableParserType("x_path"); + + SyntheticsGlobalVariableParserType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsGlobalVariableParserTypeSerializer + extends StdSerializer { + public SyntheticsGlobalVariableParserTypeSerializer( + Class t) { + super(t); + } + + public SyntheticsGlobalVariableParserTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsGlobalVariableParserType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsGlobalVariableParserType fromValue(String value) { + return new SyntheticsGlobalVariableParserType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableTOTPParameters.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableTOTPParameters.java new file mode 100644 index 00000000000..f0ceece7dd9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableTOTPParameters.java @@ -0,0 +1,167 @@ +/* + * 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; + +/** Parameters for the TOTP/MFA variable */ +@JsonPropertyOrder({ + SyntheticsGlobalVariableTOTPParameters.JSON_PROPERTY_DIGITS, + SyntheticsGlobalVariableTOTPParameters.JSON_PROPERTY_REFRESH_INTERVAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsGlobalVariableTOTPParameters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DIGITS = "digits"; + private Integer digits; + + public static final String JSON_PROPERTY_REFRESH_INTERVAL = "refresh_interval"; + private Integer refreshInterval; + + public SyntheticsGlobalVariableTOTPParameters digits(Integer digits) { + this.digits = digits; + return this; + } + + /** + * Number of digits for the OTP code. minimum: 4 maximum: 10 + * + * @return digits + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDigits() { + return digits; + } + + public void setDigits(Integer digits) { + this.digits = digits; + } + + public SyntheticsGlobalVariableTOTPParameters refreshInterval(Integer refreshInterval) { + this.refreshInterval = refreshInterval; + return this; + } + + /** + * Interval for which to refresh the token (in seconds). minimum: 0 maximum: 999 + * + * @return refreshInterval + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REFRESH_INTERVAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRefreshInterval() { + return refreshInterval; + } + + public void setRefreshInterval(Integer refreshInterval) { + this.refreshInterval = refreshInterval; + } + + /** + * 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 SyntheticsGlobalVariableTOTPParameters + */ + @JsonAnySetter + public SyntheticsGlobalVariableTOTPParameters 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 SyntheticsGlobalVariableTOTPParameters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsGlobalVariableTOTPParameters syntheticsGlobalVariableTotpParameters = + (SyntheticsGlobalVariableTOTPParameters) o; + return Objects.equals(this.digits, syntheticsGlobalVariableTotpParameters.digits) + && Objects.equals( + this.refreshInterval, syntheticsGlobalVariableTotpParameters.refreshInterval) + && Objects.equals( + this.additionalProperties, syntheticsGlobalVariableTotpParameters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(digits, refreshInterval, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsGlobalVariableTOTPParameters {\n"); + sb.append(" digits: ").append(toIndentedString(digits)).append("\n"); + sb.append(" refreshInterval: ").append(toIndentedString(refreshInterval)).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/SyntheticsGlobalVariableValue.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableValue.java new file mode 100644 index 00000000000..0ef4e174148 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsGlobalVariableValue.java @@ -0,0 +1,194 @@ +/* + * 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; + +/** Value of the global variable. */ +@JsonPropertyOrder({ + SyntheticsGlobalVariableValue.JSON_PROPERTY_OPTIONS, + SyntheticsGlobalVariableValue.JSON_PROPERTY_SECURE, + SyntheticsGlobalVariableValue.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsGlobalVariableValue { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OPTIONS = "options"; + private SyntheticsGlobalVariableOptions options; + + public static final String JSON_PROPERTY_SECURE = "secure"; + private Boolean secure; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SyntheticsGlobalVariableValue options(SyntheticsGlobalVariableOptions options) { + this.options = options; + this.unparsed |= options.unparsed; + return this; + } + + /** + * Options for the Global Variable for MFA. + * + * @return options + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsGlobalVariableOptions getOptions() { + return options; + } + + public void setOptions(SyntheticsGlobalVariableOptions options) { + this.options = options; + } + + public SyntheticsGlobalVariableValue secure(Boolean secure) { + this.secure = secure; + return this; + } + + /** + * Determines if the value of the variable is hidden. + * + * @return secure + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSecure() { + return secure; + } + + public void setSecure(Boolean secure) { + this.secure = secure; + } + + public SyntheticsGlobalVariableValue value(String value) { + this.value = value; + return this; + } + + /** + * Value of the global variable. When reading a global variable, the value will not be present if + * the variable is hidden with the secure property. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 SyntheticsGlobalVariableValue + */ + @JsonAnySetter + public SyntheticsGlobalVariableValue 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 SyntheticsGlobalVariableValue object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsGlobalVariableValue syntheticsGlobalVariableValue = (SyntheticsGlobalVariableValue) o; + return Objects.equals(this.options, syntheticsGlobalVariableValue.options) + && Objects.equals(this.secure, syntheticsGlobalVariableValue.secure) + && Objects.equals(this.value, syntheticsGlobalVariableValue.value) + && Objects.equals( + this.additionalProperties, syntheticsGlobalVariableValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(options, secure, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsGlobalVariableValue {\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" secure: ").append(toIndentedString(secure)).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/SyntheticsVariableParser.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsVariableParser.java new file mode 100644 index 00000000000..732374bfd5c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsVariableParser.java @@ -0,0 +1,178 @@ +/* + * 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; + +/** Details of the parser to use for the global variable. */ +@JsonPropertyOrder({ + SyntheticsVariableParser.JSON_PROPERTY_TYPE, + SyntheticsVariableParser.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsVariableParser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsGlobalVariableParserType type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SyntheticsVariableParser() {} + + @JsonCreator + public SyntheticsVariableParser( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + SyntheticsGlobalVariableParserType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SyntheticsVariableParser type(SyntheticsGlobalVariableParserType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of parser for a Synthetic global variable from a synthetics test. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsGlobalVariableParserType getType() { + return type; + } + + public void setType(SyntheticsGlobalVariableParserType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public SyntheticsVariableParser value(String value) { + this.value = value; + return this; + } + + /** + * Regex or JSON path used for the parser. Not used with type raw. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 SyntheticsVariableParser + */ + @JsonAnySetter + public SyntheticsVariableParser 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 SyntheticsVariableParser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsVariableParser syntheticsVariableParser = (SyntheticsVariableParser) o; + return Objects.equals(this.type, syntheticsVariableParser.type) + && Objects.equals(this.value, syntheticsVariableParser.value) + && Objects.equals(this.additionalProperties, syntheticsVariableParser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsVariableParser {\n"); + sb.append(" type: ").append(toIndentedString(type)).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/test/resources/com/datadog/api/client/v2/api/synthetics.feature b/src/test/resources/com/datadog/api/client/v2/api/synthetics.feature index 73efa73ec29..133993b11b7 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/synthetics.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/synthetics.feature @@ -20,6 +20,30 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Patch a global variable returns "Bad Request" response + Given new "PatchGlobalVariable" request + And request contains "variable_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"json_patch": [{"op": "add", "path": "/name"}]}, "type": "global_variables_json_patch"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Patch a global variable returns "Not Found" response + Given new "PatchGlobalVariable" request + And request contains "variable_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"json_patch": [{"op": "add", "path": "/name"}]}, "type": "global_variables_json_patch"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Patch a global variable returns "OK" response + Given new "PatchGlobalVariable" request + And request contains "variable_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"json_patch": [{"op": "add", "path": "/name"}]}, "type": "global_variables_json_patch"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/synthetics-managing Scenario: Save new value for on-demand concurrency cap returns "OK" response Given new "SetOnDemandConcurrencyCap" request 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 3799e64e630..f4cbbb2baae 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 @@ -4284,6 +4284,12 @@ "type": "safe" } }, + "PatchGlobalVariable": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "ListTagPipelinesRulesets": { "tag": "Cloud Cost Management", "undo": {