diff --git a/.apigentools-info b/.apigentools-info index cda145f920a..31717b93354 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-02 04:31:10.898749", - "spec_repo_commit": "272cce39" + "regenerated": "2025-05-02 16:32:06.843518", + "spec_repo_commit": "f88cc028" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-02 04:31:10.915000", - "spec_repo_commit": "272cce39" + "regenerated": "2025-05-02 16:32:06.863833", + "spec_repo_commit": "f88cc028" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 14c6d2062fa..5532ce327e8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -335,6 +335,7 @@ components: type: string FilterByRef: description: Filter entities by reference + example: service:shopping-cart explode: true in: query name: filter[ref] @@ -349,6 +350,32 @@ components: required: false schema: $ref: '#/components/schemas/RelationType' + FilterRelationByFromRef: + description: Filter relations by the reference of the first entity in the relation. + example: service:shopping-cart + explode: true + in: query + name: filter[from_ref] + required: false + schema: + type: string + FilterRelationByToRef: + description: Filter relations by the reference of the second entity in the relation. + example: service:shopping-cart + explode: true + in: query + name: filter[to_ref] + required: false + schema: + type: string + FilterRelationByType: + description: Filter relations by type. + explode: true + in: query + name: filter[type] + required: false + schema: + $ref: '#/components/schemas/RelationType' GCPSTSServiceAccountID: description: Your GCP STS enabled service account's unique ID. in: path @@ -659,6 +686,14 @@ components: required: true schema: type: string + RelationInclude: + description: Include relationship data. + explode: true + in: query + name: include + required: false + schema: + $ref: '#/components/schemas/RelationIncludeType' ReportID: description: The ID of the report job. in: path @@ -19254,6 +19289,38 @@ components: meta: $ref: '#/components/schemas/PowerpacksResponseMeta' type: object + ListRelationCatalogResponse: + description: List entity relation response. + properties: + data: + $ref: '#/components/schemas/RelationResponseData' + included: + $ref: '#/components/schemas/ListRelationCatalogResponseIncluded' + links: + $ref: '#/components/schemas/ListRelationCatalogResponseLinks' + meta: + $ref: '#/components/schemas/RelationResponseMeta' + type: object + ListRelationCatalogResponseIncluded: + description: List relation response included entities. + items: + $ref: '#/components/schemas/EntityData' + type: array + ListRelationCatalogResponseLinks: + description: List relation response links. + properties: + next: + description: Next link. + example: /api/v2/catalog/relation?filter[from_ref]=service:service-catalog&include=entity&page[limit]=2&page[offset]=2 + type: string + previous: + description: Previous link. + type: string + self: + description: Current link. + example: /api/v2/catalog/relation?filter[from_ref]=service:service-catalog&include=entity&page[limit]=2&page[offset]=0 + type: string + type: object ListRulesResponse: description: Scorecard rules response. properties: @@ -28556,6 +28623,114 @@ components: x-enum-varnames: - ANY - ALL + RelationAttributes: + description: Relation attributes. + properties: + from: + $ref: '#/components/schemas/RelationEntity' + to: + $ref: '#/components/schemas/RelationEntity' + type: + $ref: '#/components/schemas/RelationType' + type: object + RelationEntity: + description: Relation entity reference. + properties: + kind: + description: Entity kind. + type: string + name: + description: Entity name. + type: string + namespace: + description: Entity namespace. + type: string + type: object + RelationIncludeType: + description: Supported include types for relations. + enum: + - entity + - schema + type: string + x-enum-varnames: + - ENTITY + - SCHEMA + RelationMeta: + description: Relation metadata. + properties: + createdAt: + description: Relation creation time. + format: date-time + type: string + definedBy: + description: Relation defined by. + type: string + modifiedAt: + description: Relation modification time. + format: date-time + type: string + source: + description: Relation source. + type: string + type: object + RelationRelationships: + description: Relation relationships. + properties: + fromEntity: + $ref: '#/components/schemas/RelationToEntity' + toEntity: + $ref: '#/components/schemas/RelationToEntity' + type: object + RelationResponse: + description: Relation response data. + properties: + attributes: + $ref: '#/components/schemas/RelationAttributes' + id: + description: Relation ID. + type: string + meta: + $ref: '#/components/schemas/RelationMeta' + relationships: + $ref: '#/components/schemas/RelationRelationships' + subtype: + description: Relation subtype. + type: string + type: + $ref: '#/components/schemas/RelationResponseType' + type: object + RelationResponseData: + description: Array of relation responses + items: + $ref: '#/components/schemas/RelationResponse' + type: array + RelationResponseMeta: + description: Relation response metadata. + properties: + count: + description: Total relations count. + format: int64 + type: integer + includeCount: + description: Total included data count. + format: int64 + type: integer + type: object + RelationResponseType: + description: Relation type. + enum: + - relation + type: string + x-enum-varnames: + - RELATION + RelationToEntity: + description: Relation to entity. + properties: + data: + $ref: '#/components/schemas/RelationshipItem' + meta: + $ref: '#/components/schemas/EntityMeta' + type: object RelationType: description: Supported relation types. enum: @@ -42634,6 +42809,48 @@ paths: summary: Delete a single entity tags: - Software Catalog + /api/v2/catalog/relation: + get: + description: Get a list of entity relations from Software Catalog. + operationId: ListCatalogRelation + parameters: + - $ref: '#/components/parameters/PageOffset' + - description: Maximum number of relations in the response. + example: 100 + in: query + name: page[limit] + required: false + schema: + default: 100 + format: int64 + type: integer + - $ref: '#/components/parameters/FilterRelationByType' + - $ref: '#/components/parameters/FilterRelationByFromRef' + - $ref: '#/components/parameters/FilterRelationByToRef' + - $ref: '#/components/parameters/RelationInclude' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListRelationCatalogResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + summary: Get a list of entity relations + tags: + - Software Catalog + x-pagination: + limitParam: page[limit] + pageOffsetParam: page[offset] + resultsPath: data /api/v2/ci/pipeline: post: description: 'Send your pipeline event to your Datadog platform over HTTP. For diff --git a/examples/v2/software-catalog/ListCatalogRelation.java b/examples/v2/software-catalog/ListCatalogRelation.java new file mode 100644 index 00000000000..309317e5b98 --- /dev/null +++ b/examples/v2/software-catalog/ListCatalogRelation.java @@ -0,0 +1,24 @@ +// Get a list of entity relations returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SoftwareCatalogApi; +import com.datadog.api.client.v2.model.ListRelationCatalogResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SoftwareCatalogApi apiInstance = new SoftwareCatalogApi(defaultClient); + + try { + ListRelationCatalogResponse result = apiInstance.listCatalogRelation(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SoftwareCatalogApi#listCatalogRelation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/software-catalog/ListCatalogRelation_1311054087.java b/examples/v2/software-catalog/ListCatalogRelation_1311054087.java new file mode 100644 index 00000000000..4769103067e --- /dev/null +++ b/examples/v2/software-catalog/ListCatalogRelation_1311054087.java @@ -0,0 +1,27 @@ +// Get a list of entity relations returns "OK" response with pagination + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.PaginationIterable; +import com.datadog.api.client.v2.api.SoftwareCatalogApi; +import com.datadog.api.client.v2.model.RelationResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SoftwareCatalogApi apiInstance = new SoftwareCatalogApi(defaultClient); + + try { + PaginationIterable iterable = + apiInstance.listCatalogRelationWithPagination(); + + for (RelationResponse item : iterable) { + System.out.println(item); + } + } catch (RuntimeException e) { + System.err.println( + "Exception when calling SoftwareCatalogApi#listCatalogRelationWithPagination"); + System.err.println("Reason: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java b/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java index d7da3ed3d20..44a495538cd 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java @@ -8,6 +8,9 @@ import com.datadog.api.client.v2.model.EntityData; import com.datadog.api.client.v2.model.IncludeType; import com.datadog.api.client.v2.model.ListEntityCatalogResponse; +import com.datadog.api.client.v2.model.ListRelationCatalogResponse; +import com.datadog.api.client.v2.model.RelationIncludeType; +import com.datadog.api.client.v2.model.RelationResponse; import com.datadog.api.client.v2.model.RelationType; import com.datadog.api.client.v2.model.UpsertCatalogEntityRequest; import com.datadog.api.client.v2.model.UpsertCatalogEntityResponse; @@ -554,6 +557,310 @@ public ApiResponse listCatalogEntityWithHttpInfo( new GenericType() {}); } + /** Manage optional parameters to listCatalogRelation. */ + public static class ListCatalogRelationOptionalParameters { + private Long pageOffset; + private Long pageLimit; + private RelationType filterType; + private String filterFromRef; + private String filterToRef; + private RelationIncludeType include; + + /** + * Set pageOffset. + * + * @param pageOffset Specific offset to use as the beginning of the returned page. (optional, + * default to 0) + * @return ListCatalogRelationOptionalParameters + */ + public ListCatalogRelationOptionalParameters pageOffset(Long pageOffset) { + this.pageOffset = pageOffset; + return this; + } + + /** + * Set pageLimit. + * + * @param pageLimit Maximum number of relations in the response. (optional, default to 100) + * @return ListCatalogRelationOptionalParameters + */ + public ListCatalogRelationOptionalParameters pageLimit(Long pageLimit) { + this.pageLimit = pageLimit; + return this; + } + + /** + * Set filterType. + * + * @param filterType Filter relations by type. (optional) + * @return ListCatalogRelationOptionalParameters + */ + public ListCatalogRelationOptionalParameters filterType(RelationType filterType) { + this.filterType = filterType; + return this; + } + + /** + * Set filterFromRef. + * + * @param filterFromRef Filter relations by the reference of the first entity in the relation. + * (optional) + * @return ListCatalogRelationOptionalParameters + */ + public ListCatalogRelationOptionalParameters filterFromRef(String filterFromRef) { + this.filterFromRef = filterFromRef; + return this; + } + + /** + * Set filterToRef. + * + * @param filterToRef Filter relations by the reference of the second entity in the relation. + * (optional) + * @return ListCatalogRelationOptionalParameters + */ + public ListCatalogRelationOptionalParameters filterToRef(String filterToRef) { + this.filterToRef = filterToRef; + return this; + } + + /** + * Set include. + * + * @param include Include relationship data. (optional) + * @return ListCatalogRelationOptionalParameters + */ + public ListCatalogRelationOptionalParameters include(RelationIncludeType include) { + this.include = include; + return this; + } + } + + /** + * Get a list of entity relations. + * + *

See {@link #listCatalogRelationWithHttpInfo}. + * + * @return ListRelationCatalogResponse + * @throws ApiException if fails to make API call + */ + public ListRelationCatalogResponse listCatalogRelation() throws ApiException { + return listCatalogRelationWithHttpInfo(new ListCatalogRelationOptionalParameters()).getData(); + } + + /** + * Get a list of entity relations. + * + *

See {@link #listCatalogRelationWithHttpInfoAsync}. + * + * @return CompletableFuture<ListRelationCatalogResponse> + */ + public CompletableFuture listCatalogRelationAsync() { + return listCatalogRelationWithHttpInfoAsync(new ListCatalogRelationOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of entity relations. + * + *

See {@link #listCatalogRelationWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ListRelationCatalogResponse + * @throws ApiException if fails to make API call + */ + public ListRelationCatalogResponse listCatalogRelation( + ListCatalogRelationOptionalParameters parameters) throws ApiException { + return listCatalogRelationWithHttpInfo(parameters).getData(); + } + + /** + * Get a list of entity relations. + * + *

See {@link #listCatalogRelationWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ListRelationCatalogResponse> + */ + public CompletableFuture listCatalogRelationAsync( + ListCatalogRelationOptionalParameters parameters) { + return listCatalogRelationWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of entity relations. + * + *

See {@link #listCatalogRelationWithHttpInfo}. + * + * @return PaginationIterable<RelationResponse> + */ + public PaginationIterable listCatalogRelationWithPagination() { + ListCatalogRelationOptionalParameters parameters = new ListCatalogRelationOptionalParameters(); + return listCatalogRelationWithPagination(parameters); + } + + /** + * Get a list of entity relations. + * + *

See {@link #listCatalogRelationWithHttpInfo}. + * + * @return ListRelationCatalogResponse + */ + public PaginationIterable listCatalogRelationWithPagination( + ListCatalogRelationOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = ""; + String valueSetterPath = "pageOffset"; + Boolean valueSetterParamOptional = true; + Long limit; + + if (parameters.pageLimit == null) { + limit = 100l; + parameters.pageLimit(limit); + } else { + limit = parameters.pageLimit; + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "listCatalogRelation", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + true, + limit, + args); + + return iterator; + } + + /** + * Get a list of entity relations from Software Catalog. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ListRelationCatalogResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listCatalogRelationWithHttpInfo( + ListCatalogRelationOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Long pageOffset = parameters.pageOffset; + Long pageLimit = parameters.pageLimit; + RelationType filterType = parameters.filterType; + String filterFromRef = parameters.filterFromRef; + String filterToRef = parameters.filterToRef; + RelationIncludeType include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/catalog/relation"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[type]", filterType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from_ref]", filterFromRef)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to_ref]", filterToRef)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.listCatalogRelation", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a list of entity relations. + * + *

See {@link #listCatalogRelationWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ListRelationCatalogResponse>> + */ + public CompletableFuture> + listCatalogRelationWithHttpInfoAsync(ListCatalogRelationOptionalParameters parameters) { + Object localVarPostBody = null; + Long pageOffset = parameters.pageOffset; + Long pageLimit = parameters.pageLimit; + RelationType filterType = parameters.filterType; + String filterFromRef = parameters.filterFromRef; + String filterToRef = parameters.filterToRef; + RelationIncludeType include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/catalog/relation"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[type]", filterType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from_ref]", filterFromRef)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to_ref]", filterToRef)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.listCatalogRelation", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Create or update entities. * diff --git a/src/main/java/com/datadog/api/client/v2/model/ListRelationCatalogResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListRelationCatalogResponse.java new file mode 100644 index 00000000000..3df2a98b1ae --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListRelationCatalogResponse.java @@ -0,0 +1,247 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** List entity relation response. */ +@JsonPropertyOrder({ + ListRelationCatalogResponse.JSON_PROPERTY_DATA, + ListRelationCatalogResponse.JSON_PROPERTY_INCLUDED, + ListRelationCatalogResponse.JSON_PROPERTY_LINKS, + ListRelationCatalogResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListRelationCatalogResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public static final String JSON_PROPERTY_LINKS = "links"; + private ListRelationCatalogResponseLinks links; + + public static final String JSON_PROPERTY_META = "meta"; + private RelationResponseMeta meta; + + public ListRelationCatalogResponse data(List data) { + this.data = data; + for (RelationResponse item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListRelationCatalogResponse addDataItem(RelationResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of relation responses + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ListRelationCatalogResponse included(List included) { + this.included = included; + for (EntityData item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListRelationCatalogResponse addIncludedItem(EntityData includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * List relation response included entities. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + public ListRelationCatalogResponse links(ListRelationCatalogResponseLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * List relation response links. + * + * @return links + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ListRelationCatalogResponseLinks getLinks() { + return links; + } + + public void setLinks(ListRelationCatalogResponseLinks links) { + this.links = links; + } + + public ListRelationCatalogResponse meta(RelationResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Relation response metadata. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationResponseMeta getMeta() { + return meta; + } + + public void setMeta(RelationResponseMeta meta) { + this.meta = meta; + } + + /** + * 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 ListRelationCatalogResponse + */ + @JsonAnySetter + public ListRelationCatalogResponse 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 ListRelationCatalogResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListRelationCatalogResponse listRelationCatalogResponse = (ListRelationCatalogResponse) o; + return Objects.equals(this.data, listRelationCatalogResponse.data) + && Objects.equals(this.included, listRelationCatalogResponse.included) + && Objects.equals(this.links, listRelationCatalogResponse.links) + && Objects.equals(this.meta, listRelationCatalogResponse.meta) + && Objects.equals( + this.additionalProperties, listRelationCatalogResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListRelationCatalogResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/ListRelationCatalogResponseLinks.java b/src/main/java/com/datadog/api/client/v2/model/ListRelationCatalogResponseLinks.java new file mode 100644 index 00000000000..92860ea8990 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListRelationCatalogResponseLinks.java @@ -0,0 +1,193 @@ +/* + * 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; + +/** List relation response links. */ +@JsonPropertyOrder({ + ListRelationCatalogResponseLinks.JSON_PROPERTY_NEXT, + ListRelationCatalogResponseLinks.JSON_PROPERTY_PREVIOUS, + ListRelationCatalogResponseLinks.JSON_PROPERTY_SELF +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListRelationCatalogResponseLinks { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NEXT = "next"; + private String next; + + public static final String JSON_PROPERTY_PREVIOUS = "previous"; + private String previous; + + public static final String JSON_PROPERTY_SELF = "self"; + private String self; + + public ListRelationCatalogResponseLinks next(String next) { + this.next = next; + return this; + } + + /** + * Next link. + * + * @return next + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNext() { + return next; + } + + public void setNext(String next) { + this.next = next; + } + + public ListRelationCatalogResponseLinks previous(String previous) { + this.previous = previous; + return this; + } + + /** + * Previous link. + * + * @return previous + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREVIOUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrevious() { + return previous; + } + + public void setPrevious(String previous) { + this.previous = previous; + } + + public ListRelationCatalogResponseLinks self(String self) { + this.self = self; + return this; + } + + /** + * Current link. + * + * @return self + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SELF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSelf() { + return self; + } + + public void setSelf(String self) { + this.self = self; + } + + /** + * 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 ListRelationCatalogResponseLinks + */ + @JsonAnySetter + public ListRelationCatalogResponseLinks 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 ListRelationCatalogResponseLinks object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListRelationCatalogResponseLinks listRelationCatalogResponseLinks = + (ListRelationCatalogResponseLinks) o; + return Objects.equals(this.next, listRelationCatalogResponseLinks.next) + && Objects.equals(this.previous, listRelationCatalogResponseLinks.previous) + && Objects.equals(this.self, listRelationCatalogResponseLinks.self) + && Objects.equals( + this.additionalProperties, listRelationCatalogResponseLinks.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(next, previous, self, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListRelationCatalogResponseLinks {\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" previous: ").append(toIndentedString(previous)).append("\n"); + sb.append(" self: ").append(toIndentedString(self)).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/RelationAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RelationAttributes.java new file mode 100644 index 00000000000..74de7a8a1f0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationAttributes.java @@ -0,0 +1,197 @@ +/* + * 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; + +/** Relation attributes. */ +@JsonPropertyOrder({ + RelationAttributes.JSON_PROPERTY_FROM, + RelationAttributes.JSON_PROPERTY_TO, + RelationAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private RelationEntity from; + + public static final String JSON_PROPERTY_TO = "to"; + private RelationEntity to; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RelationType type; + + public RelationAttributes from(RelationEntity from) { + this.from = from; + this.unparsed |= from.unparsed; + return this; + } + + /** + * Relation entity reference. + * + * @return from + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationEntity getFrom() { + return from; + } + + public void setFrom(RelationEntity from) { + this.from = from; + } + + public RelationAttributes to(RelationEntity to) { + this.to = to; + this.unparsed |= to.unparsed; + return this; + } + + /** + * Relation entity reference. + * + * @return to + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationEntity getTo() { + return to; + } + + public void setTo(RelationEntity to) { + this.to = to; + } + + public RelationAttributes type(RelationType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Supported relation types. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationType getType() { + return type; + } + + public void setType(RelationType 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 RelationAttributes + */ + @JsonAnySetter + public RelationAttributes 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 RelationAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationAttributes relationAttributes = (RelationAttributes) o; + return Objects.equals(this.from, relationAttributes.from) + && Objects.equals(this.to, relationAttributes.to) + && Objects.equals(this.type, relationAttributes.type) + && Objects.equals(this.additionalProperties, relationAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, to, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationAttributes {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).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/RelationEntity.java b/src/main/java/com/datadog/api/client/v2/model/RelationEntity.java new file mode 100644 index 00000000000..1e55d265fa0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationEntity.java @@ -0,0 +1,191 @@ +/* + * 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; + +/** Relation entity reference. */ +@JsonPropertyOrder({ + RelationEntity.JSON_PROPERTY_KIND, + RelationEntity.JSON_PROPERTY_NAME, + RelationEntity.JSON_PROPERTY_NAMESPACE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationEntity { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_KIND = "kind"; + private String kind; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_NAMESPACE = "namespace"; + private String namespace; + + public RelationEntity kind(String kind) { + this.kind = kind; + return this; + } + + /** + * Entity kind. + * + * @return kind + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public RelationEntity name(String name) { + this.name = name; + return this; + } + + /** + * Entity name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RelationEntity namespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Entity namespace. + * + * @return namespace + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMESPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespace() { + return namespace; + } + + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + /** + * 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 RelationEntity + */ + @JsonAnySetter + public RelationEntity 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 RelationEntity object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationEntity relationEntity = (RelationEntity) o; + return Objects.equals(this.kind, relationEntity.kind) + && Objects.equals(this.name, relationEntity.name) + && Objects.equals(this.namespace, relationEntity.namespace) + && Objects.equals(this.additionalProperties, relationEntity.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(kind, name, namespace, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationEntity {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).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/RelationIncludeType.java b/src/main/java/com/datadog/api/client/v2/model/RelationIncludeType.java new file mode 100644 index 00000000000..c37bf4a80ec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationIncludeType.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Supported include types for relations. */ +@JsonSerialize(using = RelationIncludeType.RelationIncludeTypeSerializer.class) +public class RelationIncludeType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("entity", "schema")); + + public static final RelationIncludeType ENTITY = new RelationIncludeType("entity"); + public static final RelationIncludeType SCHEMA = new RelationIncludeType("schema"); + + RelationIncludeType(String value) { + super(value, allowedValues); + } + + public static class RelationIncludeTypeSerializer extends StdSerializer { + public RelationIncludeTypeSerializer(Class t) { + super(t); + } + + public RelationIncludeTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RelationIncludeType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RelationIncludeType fromValue(String value) { + return new RelationIncludeType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationMeta.java b/src/main/java/com/datadog/api/client/v2/model/RelationMeta.java new file mode 100644 index 00000000000..98e2d15e954 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationMeta.java @@ -0,0 +1,219 @@ +/* + * 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.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relation metadata. */ +@JsonPropertyOrder({ + RelationMeta.JSON_PROPERTY_CREATED_AT, + RelationMeta.JSON_PROPERTY_DEFINED_BY, + RelationMeta.JSON_PROPERTY_MODIFIED_AT, + RelationMeta.JSON_PROPERTY_SOURCE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DEFINED_BY = "definedBy"; + private String definedBy; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private String source; + + public RelationMeta createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Relation creation time. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public RelationMeta definedBy(String definedBy) { + this.definedBy = definedBy; + return this; + } + + /** + * Relation defined by. + * + * @return definedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFINED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDefinedBy() { + return definedBy; + } + + public void setDefinedBy(String definedBy) { + this.definedBy = definedBy; + } + + public RelationMeta modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Relation modification time. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public RelationMeta source(String source) { + this.source = source; + return this; + } + + /** + * Relation source. + * + * @return source + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + /** + * 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 RelationMeta + */ + @JsonAnySetter + public RelationMeta 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 RelationMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationMeta relationMeta = (RelationMeta) o; + return Objects.equals(this.createdAt, relationMeta.createdAt) + && Objects.equals(this.definedBy, relationMeta.definedBy) + && Objects.equals(this.modifiedAt, relationMeta.modifiedAt) + && Objects.equals(this.source, relationMeta.source) + && Objects.equals(this.additionalProperties, relationMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, definedBy, modifiedAt, source, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationMeta {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" definedBy: ").append(toIndentedString(definedBy)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).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/RelationRelationships.java b/src/main/java/com/datadog/api/client/v2/model/RelationRelationships.java new file mode 100644 index 00000000000..b2b2ea518df --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationRelationships.java @@ -0,0 +1,166 @@ +/* + * 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; + +/** Relation relationships. */ +@JsonPropertyOrder({ + RelationRelationships.JSON_PROPERTY_FROM_ENTITY, + RelationRelationships.JSON_PROPERTY_TO_ENTITY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM_ENTITY = "fromEntity"; + private RelationToEntity fromEntity; + + public static final String JSON_PROPERTY_TO_ENTITY = "toEntity"; + private RelationToEntity toEntity; + + public RelationRelationships fromEntity(RelationToEntity fromEntity) { + this.fromEntity = fromEntity; + this.unparsed |= fromEntity.unparsed; + return this; + } + + /** + * Relation to entity. + * + * @return fromEntity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM_ENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationToEntity getFromEntity() { + return fromEntity; + } + + public void setFromEntity(RelationToEntity fromEntity) { + this.fromEntity = fromEntity; + } + + public RelationRelationships toEntity(RelationToEntity toEntity) { + this.toEntity = toEntity; + this.unparsed |= toEntity.unparsed; + return this; + } + + /** + * Relation to entity. + * + * @return toEntity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO_ENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationToEntity getToEntity() { + return toEntity; + } + + public void setToEntity(RelationToEntity toEntity) { + this.toEntity = toEntity; + } + + /** + * 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 RelationRelationships + */ + @JsonAnySetter + public RelationRelationships 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 RelationRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationRelationships relationRelationships = (RelationRelationships) o; + return Objects.equals(this.fromEntity, relationRelationships.fromEntity) + && Objects.equals(this.toEntity, relationRelationships.toEntity) + && Objects.equals(this.additionalProperties, relationRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fromEntity, toEntity, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationRelationships {\n"); + sb.append(" fromEntity: ").append(toIndentedString(fromEntity)).append("\n"); + sb.append(" toEntity: ").append(toIndentedString(toEntity)).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/RelationResponse.java b/src/main/java/com/datadog/api/client/v2/model/RelationResponse.java new file mode 100644 index 00000000000..9288be95e58 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationResponse.java @@ -0,0 +1,279 @@ +/* + * 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; + +/** Relation response data. */ +@JsonPropertyOrder({ + RelationResponse.JSON_PROPERTY_ATTRIBUTES, + RelationResponse.JSON_PROPERTY_ID, + RelationResponse.JSON_PROPERTY_META, + RelationResponse.JSON_PROPERTY_RELATIONSHIPS, + RelationResponse.JSON_PROPERTY_SUBTYPE, + RelationResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RelationAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_META = "meta"; + private RelationMeta meta; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private RelationRelationships relationships; + + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; + private String subtype; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RelationResponseType type; + + public RelationResponse attributes(RelationAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Relation attributes. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RelationAttributes attributes) { + this.attributes = attributes; + } + + public RelationResponse id(String id) { + this.id = id; + return this; + } + + /** + * Relation ID. + * + * @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 RelationResponse meta(RelationMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Relation metadata. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationMeta getMeta() { + return meta; + } + + public void setMeta(RelationMeta meta) { + this.meta = meta; + } + + public RelationResponse relationships(RelationRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relation relationships. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationRelationships getRelationships() { + return relationships; + } + + public void setRelationships(RelationRelationships relationships) { + this.relationships = relationships; + } + + public RelationResponse subtype(String subtype) { + this.subtype = subtype; + return this; + } + + /** + * Relation subtype. + * + * @return subtype + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubtype() { + return subtype; + } + + public void setSubtype(String subtype) { + this.subtype = subtype; + } + + public RelationResponse type(RelationResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Relation type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationResponseType getType() { + return type; + } + + public void setType(RelationResponseType 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 RelationResponse + */ + @JsonAnySetter + public RelationResponse 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 RelationResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationResponse relationResponse = (RelationResponse) o; + return Objects.equals(this.attributes, relationResponse.attributes) + && Objects.equals(this.id, relationResponse.id) + && Objects.equals(this.meta, relationResponse.meta) + && Objects.equals(this.relationships, relationResponse.relationships) + && Objects.equals(this.subtype, relationResponse.subtype) + && Objects.equals(this.type, relationResponse.type) + && Objects.equals(this.additionalProperties, relationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, meta, relationships, subtype, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationResponse {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" subtype: ").append(toIndentedString(subtype)).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/RelationResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/RelationResponseMeta.java new file mode 100644 index 00000000000..3be7a2eb85a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationResponseMeta.java @@ -0,0 +1,164 @@ +/* + * 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; + +/** Relation response metadata. */ +@JsonPropertyOrder({ + RelationResponseMeta.JSON_PROPERTY_COUNT, + RelationResponseMeta.JSON_PROPERTY_INCLUDE_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_INCLUDE_COUNT = "includeCount"; + private Long includeCount; + + public RelationResponseMeta count(Long count) { + this.count = count; + return this; + } + + /** + * Total relations count. + * + * @return count + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + public RelationResponseMeta includeCount(Long includeCount) { + this.includeCount = includeCount; + return this; + } + + /** + * Total included data count. + * + * @return includeCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getIncludeCount() { + return includeCount; + } + + public void setIncludeCount(Long includeCount) { + this.includeCount = includeCount; + } + + /** + * 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 RelationResponseMeta + */ + @JsonAnySetter + public RelationResponseMeta 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 RelationResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationResponseMeta relationResponseMeta = (RelationResponseMeta) o; + return Objects.equals(this.count, relationResponseMeta.count) + && Objects.equals(this.includeCount, relationResponseMeta.includeCount) + && Objects.equals(this.additionalProperties, relationResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, includeCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationResponseMeta {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" includeCount: ").append(toIndentedString(includeCount)).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/RelationResponseType.java b/src/main/java/com/datadog/api/client/v2/model/RelationResponseType.java new file mode 100644 index 00000000000..ba65e863a86 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationResponseType.java @@ -0,0 +1,54 @@ +/* + * 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; + +/** Relation type. */ +@JsonSerialize(using = RelationResponseType.RelationResponseTypeSerializer.class) +public class RelationResponseType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("relation")); + + public static final RelationResponseType RELATION = new RelationResponseType("relation"); + + RelationResponseType(String value) { + super(value, allowedValues); + } + + public static class RelationResponseTypeSerializer extends StdSerializer { + public RelationResponseTypeSerializer(Class t) { + super(t); + } + + public RelationResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RelationResponseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RelationResponseType fromValue(String value) { + return new RelationResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationToEntity.java b/src/main/java/com/datadog/api/client/v2/model/RelationToEntity.java new file mode 100644 index 00000000000..cce84552c93 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationToEntity.java @@ -0,0 +1,163 @@ +/* + * 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; + +/** Relation to entity. */ +@JsonPropertyOrder({RelationToEntity.JSON_PROPERTY_DATA, RelationToEntity.JSON_PROPERTY_META}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationToEntity { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RelationshipItem data; + + public static final String JSON_PROPERTY_META = "meta"; + private EntityMeta meta; + + public RelationToEntity data(RelationshipItem data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Relationship entry. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipItem getData() { + return data; + } + + public void setData(RelationshipItem data) { + this.data = data; + } + + public RelationToEntity meta(EntityMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Entity metadata. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EntityMeta getMeta() { + return meta; + } + + public void setMeta(EntityMeta meta) { + this.meta = meta; + } + + /** + * 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 RelationToEntity + */ + @JsonAnySetter + public RelationToEntity 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 RelationToEntity object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationToEntity relationToEntity = (RelationToEntity) o; + return Objects.equals(this.data, relationToEntity.data) + && Objects.equals(this.meta, relationToEntity.meta) + && Objects.equals(this.additionalProperties, relationToEntity.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationToEntity {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/software_catalog.feature b/src/test/resources/com/datadog/api/client/v2/api/software_catalog.feature index fd8e62bad35..85d81ea1d24 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/software_catalog.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/software_catalog.feature @@ -78,3 +78,15 @@ Feature: Software Catalog Given new "ListCatalogEntity" request When the request with pagination is sent Then the response status is 200 OK + + @team:DataDog/service-catalog + Scenario: Get a list of entity relations returns "OK" response + Given new "ListCatalogRelation" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/service-catalog @with-pagination + Scenario: Get a list of entity relations returns "OK" response with pagination + Given new "ListCatalogRelation" request + When the request with pagination is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index c1daab38525..f32d6245b92 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 @@ -471,6 +471,12 @@ "type": "idempotent" } }, + "ListCatalogRelation": { + "tag": "Software Catalog", + "undo": { + "type": "safe" + } + }, "CreateCIAppPipelineEvent": { "tag": "CI Visibility Pipelines", "undo": {