diff --git a/.apigentools-info b/.apigentools-info index 10a4e30b257..ec0ec6eb3a1 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-31 15:03:13.227560", - "spec_repo_commit": "b01f90f4" + "regenerated": "2025-02-03 15:48:15.993458", + "spec_repo_commit": "d6014add" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-31 15:03:13.242731", - "spec_repo_commit": "b01f90f4" + "regenerated": "2025-02-03 15:48:16.009612", + "spec_repo_commit": "d6014add" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 53917f83cf4..62f1c571ca5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -10524,6 +10524,99 @@ components: - $ref: '#/components/schemas/EntityV3Datastore' - $ref: '#/components/schemas/EntityV3Queue' - $ref: '#/components/schemas/EntityV3System' + - $ref: '#/components/schemas/EntityV3API' + EntityV3API: + additionalProperties: false + description: Schema for API entities. + properties: + apiVersion: + $ref: '#/components/schemas/EntityV3APIVersion' + datadog: + $ref: '#/components/schemas/EntityV3APIDatadog' + extensions: + additionalProperties: {} + description: Custom extensions. This is the free-formed field to send client-side + metadata. No Datadog features are affected by this field. + type: object + integrations: + $ref: '#/components/schemas/EntityV3Integrations' + kind: + $ref: '#/components/schemas/EntityV3APIKind' + metadata: + $ref: '#/components/schemas/EntityV3Metadata' + spec: + $ref: '#/components/schemas/EntityV3APISpec' + required: + - apiVersion + - kind + - metadata + type: object + EntityV3APIDatadog: + additionalProperties: false + description: Datadog product integrations for the API entity. + properties: + codeLocations: + $ref: '#/components/schemas/EntityV3DatadogCodeLocations' + events: + $ref: '#/components/schemas/EntityV3DatadogEvents' + logs: + $ref: '#/components/schemas/EntityV3DatadogLogs' + performanceData: + $ref: '#/components/schemas/EntityV3DatadogPerformance' + pipelines: + $ref: '#/components/schemas/EntityV3DatadogPipelines' + type: object + EntityV3APIKind: + description: The definition of Entity V3 API Kind object. + enum: + - api + example: api + type: string + x-enum-varnames: + - API + EntityV3APISpec: + additionalProperties: false + description: The definition of Entity V3 API Spec object. + properties: + implementedBy: + description: Services which implemented the API. + items: + type: string + type: array + interface: + $ref: '#/components/schemas/EntityV3APISpecInterface' + lifecycle: + description: The lifecycle state of the component. + minLength: 1 + type: string + tier: + description: The importance of the component. + minLength: 1 + type: string + type: + description: The type of API. + type: string + type: object + EntityV3APISpecInterface: + additionalProperties: false + description: The API definition. + oneOf: + - $ref: '#/components/schemas/EntityV3APISpecInterfaceFileRef' + - $ref: '#/components/schemas/EntityV3APISpecInterfaceDefinition' + EntityV3APISpecInterfaceDefinition: + additionalProperties: false + description: The definition of `EntityV3APISpecInterfaceDefinition` object. + properties: + definition: + description: The API definition. + type: object + EntityV3APISpecInterfaceFileRef: + additionalProperties: false + description: The definition of `EntityV3APISpecInterfaceFileRef` object. + properties: + fileRef: + description: The reference to the API definition file. + type: string EntityV3APIVersion: description: The schema version of entity type. The field is known as schema-version in the previous version. diff --git a/src/main/java/com/datadog/api/client/v2/model/EntityV3.java b/src/main/java/com/datadog/api/client/v2/model/EntityV3.java index 347d597b0d0..c2986f8f996 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EntityV3.java +++ b/src/main/java/com/datadog/api/client/v2/model/EntityV3.java @@ -253,6 +253,48 @@ public EntityV3 deserialize(JsonParser jp, DeserializationContext ctxt) log.log(Level.FINER, "Input data does not match schema 'EntityV3System'", e); } + // deserialize EntityV3API + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (EntityV3API.class.equals(Integer.class) + || EntityV3API.class.equals(Long.class) + || EntityV3API.class.equals(Float.class) + || EntityV3API.class.equals(Double.class) + || EntityV3API.class.equals(Boolean.class) + || EntityV3API.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((EntityV3API.class.equals(Integer.class) || EntityV3API.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((EntityV3API.class.equals(Float.class) || EntityV3API.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (EntityV3API.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (EntityV3API.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(EntityV3API.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((EntityV3API) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'EntityV3API'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'EntityV3API'", e); + } + EntityV3 ret = new EntityV3(); if (match == 1) { ret.setActualInstance(deserialized); @@ -301,11 +343,17 @@ public EntityV3(EntityV3System o) { setActualInstance(o); } + public EntityV3(EntityV3API o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { schemas.put("EntityV3Service", new GenericType() {}); schemas.put("EntityV3Datastore", new GenericType() {}); schemas.put("EntityV3Queue", new GenericType() {}); schemas.put("EntityV3System", new GenericType() {}); + schemas.put("EntityV3API", new GenericType() {}); JSON.registerDescendants(EntityV3.class, Collections.unmodifiableMap(schemas)); } @@ -317,7 +365,7 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid * against the oneOf child schemas: EntityV3Service, EntityV3Datastore, EntityV3Queue, - * EntityV3System + * EntityV3System, EntityV3API * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -340,6 +388,10 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf(EntityV3API.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { super.setActualInstance(instance); @@ -347,14 +399,15 @@ public void setActualInstance(Object instance) { } throw new RuntimeException( "Invalid instance type. Must be EntityV3Service, EntityV3Datastore, EntityV3Queue," - + " EntityV3System"); + + " EntityV3System, EntityV3API"); } /** * Get the actual instance, which can be the following: EntityV3Service, EntityV3Datastore, - * EntityV3Queue, EntityV3System + * EntityV3Queue, EntityV3System, EntityV3API * - * @return The actual instance (EntityV3Service, EntityV3Datastore, EntityV3Queue, EntityV3System) + * @return The actual instance (EntityV3Service, EntityV3Datastore, EntityV3Queue, EntityV3System, + * EntityV3API) */ @Override public Object getActualInstance() { @@ -404,4 +457,15 @@ public EntityV3Queue getEntityV3Queue() throws ClassCastException { public EntityV3System getEntityV3System() throws ClassCastException { return (EntityV3System) super.getActualInstance(); } + + /** + * Get the actual instance of `EntityV3API`. If the actual instance is not `EntityV3API`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `EntityV3API` + * @throws ClassCastException if the instance is not `EntityV3API` + */ + public EntityV3API getEntityV3API() throws ClassCastException { + return (EntityV3API) super.getActualInstance(); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/EntityV3API.java b/src/main/java/com/datadog/api/client/v2/model/EntityV3API.java new file mode 100644 index 00000000000..dad16218a12 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EntityV3API.java @@ -0,0 +1,283 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Schema for API entities. */ +@JsonPropertyOrder({ + EntityV3API.JSON_PROPERTY_API_VERSION, + EntityV3API.JSON_PROPERTY_DATADOG, + EntityV3API.JSON_PROPERTY_EXTENSIONS, + EntityV3API.JSON_PROPERTY_INTEGRATIONS, + EntityV3API.JSON_PROPERTY_KIND, + EntityV3API.JSON_PROPERTY_METADATA, + EntityV3API.JSON_PROPERTY_SPEC +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EntityV3API { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_API_VERSION = "apiVersion"; + private EntityV3APIVersion apiVersion; + + public static final String JSON_PROPERTY_DATADOG = "datadog"; + private EntityV3APIDatadog datadog; + + public static final String JSON_PROPERTY_EXTENSIONS = "extensions"; + private Map extensions = null; + + public static final String JSON_PROPERTY_INTEGRATIONS = "integrations"; + private EntityV3Integrations integrations; + + public static final String JSON_PROPERTY_KIND = "kind"; + private EntityV3APIKind kind; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private EntityV3Metadata metadata; + + public static final String JSON_PROPERTY_SPEC = "spec"; + private EntityV3APISpec spec; + + public EntityV3API() {} + + @JsonCreator + public EntityV3API( + @JsonProperty(required = true, value = JSON_PROPERTY_API_VERSION) + EntityV3APIVersion apiVersion, + @JsonProperty(required = true, value = JSON_PROPERTY_KIND) EntityV3APIKind kind, + @JsonProperty(required = true, value = JSON_PROPERTY_METADATA) EntityV3Metadata metadata) { + this.apiVersion = apiVersion; + this.unparsed |= !apiVersion.isValid(); + this.kind = kind; + this.unparsed |= !kind.isValid(); + this.metadata = metadata; + this.unparsed |= metadata.unparsed; + } + + public EntityV3API apiVersion(EntityV3APIVersion apiVersion) { + this.apiVersion = apiVersion; + this.unparsed |= !apiVersion.isValid(); + return this; + } + + /** + * The schema version of entity type. The field is known as schema-version in the previous + * version. + * + * @return apiVersion + */ + @JsonProperty(JSON_PROPERTY_API_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EntityV3APIVersion getApiVersion() { + return apiVersion; + } + + public void setApiVersion(EntityV3APIVersion apiVersion) { + if (!apiVersion.isValid()) { + this.unparsed = true; + } + this.apiVersion = apiVersion; + } + + public EntityV3API datadog(EntityV3APIDatadog datadog) { + this.datadog = datadog; + this.unparsed |= datadog.unparsed; + return this; + } + + /** + * Datadog product integrations for the API entity. + * + * @return datadog + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATADOG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EntityV3APIDatadog getDatadog() { + return datadog; + } + + public void setDatadog(EntityV3APIDatadog datadog) { + this.datadog = datadog; + } + + public EntityV3API extensions(Map extensions) { + this.extensions = extensions; + return this; + } + + public EntityV3API putExtensionsItem(String key, Object extensionsItem) { + if (this.extensions == null) { + this.extensions = new HashMap<>(); + } + this.extensions.put(key, extensionsItem); + return this; + } + + /** + * Custom extensions. This is the free-formed field to send client-side metadata. No Datadog + * features are affected by this field. + * + * @return extensions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXTENSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getExtensions() { + return extensions; + } + + public void setExtensions(Map extensions) { + this.extensions = extensions; + } + + public EntityV3API integrations(EntityV3Integrations integrations) { + this.integrations = integrations; + this.unparsed |= integrations.unparsed; + return this; + } + + /** + * A base schema for defining third-party integrations. + * + * @return integrations + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTEGRATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EntityV3Integrations getIntegrations() { + return integrations; + } + + public void setIntegrations(EntityV3Integrations integrations) { + this.integrations = integrations; + } + + public EntityV3API kind(EntityV3APIKind kind) { + this.kind = kind; + this.unparsed |= !kind.isValid(); + return this; + } + + /** + * The definition of Entity V3 API Kind object. + * + * @return kind + */ + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EntityV3APIKind getKind() { + return kind; + } + + public void setKind(EntityV3APIKind kind) { + if (!kind.isValid()) { + this.unparsed = true; + } + this.kind = kind; + } + + public EntityV3API metadata(EntityV3Metadata metadata) { + this.metadata = metadata; + this.unparsed |= metadata.unparsed; + return this; + } + + /** + * The definition of Entity V3 Metadata object. + * + * @return metadata + */ + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EntityV3Metadata getMetadata() { + return metadata; + } + + public void setMetadata(EntityV3Metadata metadata) { + this.metadata = metadata; + } + + public EntityV3API spec(EntityV3APISpec spec) { + this.spec = spec; + this.unparsed |= spec.unparsed; + return this; + } + + /** + * The definition of Entity V3 API Spec object. + * + * @return spec + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EntityV3APISpec getSpec() { + return spec; + } + + public void setSpec(EntityV3APISpec spec) { + this.spec = spec; + } + + /** Return true if this EntityV3API object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EntityV3API entityV3Api = (EntityV3API) o; + return Objects.equals(this.apiVersion, entityV3Api.apiVersion) + && Objects.equals(this.datadog, entityV3Api.datadog) + && Objects.equals(this.extensions, entityV3Api.extensions) + && Objects.equals(this.integrations, entityV3Api.integrations) + && Objects.equals(this.kind, entityV3Api.kind) + && Objects.equals(this.metadata, entityV3Api.metadata) + && Objects.equals(this.spec, entityV3Api.spec); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, datadog, extensions, integrations, kind, metadata, spec); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntityV3API {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" datadog: ").append(toIndentedString(datadog)).append("\n"); + sb.append(" extensions: ").append(toIndentedString(extensions)).append("\n"); + sb.append(" integrations: ").append(toIndentedString(integrations)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).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/EntityV3APIDatadog.java b/src/main/java/com/datadog/api/client/v2/model/EntityV3APIDatadog.java new file mode 100644 index 00000000000..9aa881ff00a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EntityV3APIDatadog.java @@ -0,0 +1,232 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Datadog product integrations for the API entity. */ +@JsonPropertyOrder({ + EntityV3APIDatadog.JSON_PROPERTY_CODE_LOCATIONS, + EntityV3APIDatadog.JSON_PROPERTY_EVENTS, + EntityV3APIDatadog.JSON_PROPERTY_LOGS, + EntityV3APIDatadog.JSON_PROPERTY_PERFORMANCE_DATA, + EntityV3APIDatadog.JSON_PROPERTY_PIPELINES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EntityV3APIDatadog { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CODE_LOCATIONS = "codeLocations"; + private List codeLocations = null; + + public static final String JSON_PROPERTY_EVENTS = "events"; + private List events = null; + + public static final String JSON_PROPERTY_LOGS = "logs"; + private List logs = null; + + public static final String JSON_PROPERTY_PERFORMANCE_DATA = "performanceData"; + private EntityV3DatadogPerformance performanceData; + + public static final String JSON_PROPERTY_PIPELINES = "pipelines"; + private EntityV3DatadogPipelines pipelines; + + public EntityV3APIDatadog codeLocations(List codeLocations) { + this.codeLocations = codeLocations; + for (EntityV3DatadogCodeLocationItem item : codeLocations) { + this.unparsed |= item.unparsed; + } + return this; + } + + public EntityV3APIDatadog addCodeLocationsItem( + EntityV3DatadogCodeLocationItem codeLocationsItem) { + if (this.codeLocations == null) { + this.codeLocations = new ArrayList<>(); + } + this.codeLocations.add(codeLocationsItem); + this.unparsed |= codeLocationsItem.unparsed; + return this; + } + + /** + * Schema for mapping source code locations to an entity. + * + * @return codeLocations + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CODE_LOCATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCodeLocations() { + return codeLocations; + } + + public void setCodeLocations(List codeLocations) { + this.codeLocations = codeLocations; + } + + public EntityV3APIDatadog events(List events) { + this.events = events; + for (EntityV3DatadogEventItem item : events) { + this.unparsed |= item.unparsed; + } + return this; + } + + public EntityV3APIDatadog addEventsItem(EntityV3DatadogEventItem eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + this.unparsed |= eventsItem.unparsed; + return this; + } + + /** + * Events associations. + * + * @return events + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEvents() { + return events; + } + + public void setEvents(List events) { + this.events = events; + } + + public EntityV3APIDatadog logs(List logs) { + this.logs = logs; + for (EntityV3DatadogLogItem item : logs) { + this.unparsed |= item.unparsed; + } + return this; + } + + public EntityV3APIDatadog addLogsItem(EntityV3DatadogLogItem logsItem) { + if (this.logs == null) { + this.logs = new ArrayList<>(); + } + this.logs.add(logsItem); + this.unparsed |= logsItem.unparsed; + return this; + } + + /** + * Logs association. + * + * @return logs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLogs() { + return logs; + } + + public void setLogs(List logs) { + this.logs = logs; + } + + public EntityV3APIDatadog performanceData(EntityV3DatadogPerformance performanceData) { + this.performanceData = performanceData; + this.unparsed |= performanceData.unparsed; + return this; + } + + /** + * Performance stats association. + * + * @return performanceData + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PERFORMANCE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EntityV3DatadogPerformance getPerformanceData() { + return performanceData; + } + + public void setPerformanceData(EntityV3DatadogPerformance performanceData) { + this.performanceData = performanceData; + } + + public EntityV3APIDatadog pipelines(EntityV3DatadogPipelines pipelines) { + this.pipelines = pipelines; + this.unparsed |= pipelines.unparsed; + return this; + } + + /** + * CI Pipelines association. + * + * @return pipelines + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PIPELINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EntityV3DatadogPipelines getPipelines() { + return pipelines; + } + + public void setPipelines(EntityV3DatadogPipelines pipelines) { + this.pipelines = pipelines; + } + + /** Return true if this EntityV3APIDatadog object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EntityV3APIDatadog entityV3ApiDatadog = (EntityV3APIDatadog) o; + return Objects.equals(this.codeLocations, entityV3ApiDatadog.codeLocations) + && Objects.equals(this.events, entityV3ApiDatadog.events) + && Objects.equals(this.logs, entityV3ApiDatadog.logs) + && Objects.equals(this.performanceData, entityV3ApiDatadog.performanceData) + && Objects.equals(this.pipelines, entityV3ApiDatadog.pipelines); + } + + @Override + public int hashCode() { + return Objects.hash(codeLocations, events, logs, performanceData, pipelines); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntityV3APIDatadog {\n"); + sb.append(" codeLocations: ").append(toIndentedString(codeLocations)).append("\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); + sb.append(" performanceData: ").append(toIndentedString(performanceData)).append("\n"); + sb.append(" pipelines: ").append(toIndentedString(pipelines)).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/EntityV3APIKind.java b/src/main/java/com/datadog/api/client/v2/model/EntityV3APIKind.java new file mode 100644 index 00000000000..8fc4f1d843b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EntityV3APIKind.java @@ -0,0 +1,53 @@ +/* + * 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 definition of Entity V3 API Kind object. */ +@JsonSerialize(using = EntityV3APIKind.EntityV3APIKindSerializer.class) +public class EntityV3APIKind extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("api")); + + public static final EntityV3APIKind API = new EntityV3APIKind("api"); + + EntityV3APIKind(String value) { + super(value, allowedValues); + } + + public static class EntityV3APIKindSerializer extends StdSerializer { + public EntityV3APIKindSerializer(Class t) { + super(t); + } + + public EntityV3APIKindSerializer() { + this(null); + } + + @Override + public void serialize(EntityV3APIKind value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static EntityV3APIKind fromValue(String value) { + return new EntityV3APIKind(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/EntityV3APISpec.java b/src/main/java/com/datadog/api/client/v2/model/EntityV3APISpec.java new file mode 100644 index 00000000000..55fbf6352fc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EntityV3APISpec.java @@ -0,0 +1,202 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** The definition of Entity V3 API Spec object. */ +@JsonPropertyOrder({ + EntityV3APISpec.JSON_PROPERTY_IMPLEMENTED_BY, + EntityV3APISpec.JSON_PROPERTY_INTERFACE, + EntityV3APISpec.JSON_PROPERTY_LIFECYCLE, + EntityV3APISpec.JSON_PROPERTY_TIER, + EntityV3APISpec.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EntityV3APISpec { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_IMPLEMENTED_BY = "implementedBy"; + private List implementedBy = null; + + public static final String JSON_PROPERTY_INTERFACE = "interface"; + private EntityV3APISpecInterface _interface; + + public static final String JSON_PROPERTY_LIFECYCLE = "lifecycle"; + private String lifecycle; + + public static final String JSON_PROPERTY_TIER = "tier"; + private String tier; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public EntityV3APISpec implementedBy(List implementedBy) { + this.implementedBy = implementedBy; + return this; + } + + public EntityV3APISpec addImplementedByItem(String implementedByItem) { + if (this.implementedBy == null) { + this.implementedBy = new ArrayList<>(); + } + this.implementedBy.add(implementedByItem); + return this; + } + + /** + * Services which implemented the API. + * + * @return implementedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IMPLEMENTED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImplementedBy() { + return implementedBy; + } + + public void setImplementedBy(List implementedBy) { + this.implementedBy = implementedBy; + } + + public EntityV3APISpec _interface(EntityV3APISpecInterface _interface) { + this._interface = _interface; + this.unparsed |= _interface.unparsed; + return this; + } + + /** + * The API definition. + * + * @return _interface + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTERFACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EntityV3APISpecInterface getInterface() { + return _interface; + } + + public void setInterface(EntityV3APISpecInterface _interface) { + this._interface = _interface; + } + + public EntityV3APISpec lifecycle(String lifecycle) { + this.lifecycle = lifecycle; + return this; + } + + /** + * The lifecycle state of the component. + * + * @return lifecycle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIFECYCLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLifecycle() { + return lifecycle; + } + + public void setLifecycle(String lifecycle) { + this.lifecycle = lifecycle; + } + + public EntityV3APISpec tier(String tier) { + this.tier = tier; + return this; + } + + /** + * The importance of the component. + * + * @return tier + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTier() { + return tier; + } + + public void setTier(String tier) { + this.tier = tier; + } + + public EntityV3APISpec type(String type) { + this.type = type; + return this; + } + + /** + * The type of API. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** Return true if this EntityV3APISpec object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EntityV3APISpec entityV3ApiSpec = (EntityV3APISpec) o; + return Objects.equals(this.implementedBy, entityV3ApiSpec.implementedBy) + && Objects.equals(this._interface, entityV3ApiSpec._interface) + && Objects.equals(this.lifecycle, entityV3ApiSpec.lifecycle) + && Objects.equals(this.tier, entityV3ApiSpec.tier) + && Objects.equals(this.type, entityV3ApiSpec.type); + } + + @Override + public int hashCode() { + return Objects.hash(implementedBy, _interface, lifecycle, tier, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntityV3APISpec {\n"); + sb.append(" implementedBy: ").append(toIndentedString(implementedBy)).append("\n"); + sb.append(" _interface: ").append(toIndentedString(_interface)).append("\n"); + sb.append(" lifecycle: ").append(toIndentedString(lifecycle)).append("\n"); + sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/EntityV3APISpecInterface.java b/src/main/java/com/datadog/api/client/v2/model/EntityV3APISpecInterface.java new file mode 100644 index 00000000000..22ac472f917 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EntityV3APISpecInterface.java @@ -0,0 +1,295 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = EntityV3APISpecInterface.EntityV3APISpecInterfaceDeserializer.class) +@JsonSerialize(using = EntityV3APISpecInterface.EntityV3APISpecInterfaceSerializer.class) +public class EntityV3APISpecInterface extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(EntityV3APISpecInterface.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class EntityV3APISpecInterfaceSerializer + extends StdSerializer { + public EntityV3APISpecInterfaceSerializer(Class t) { + super(t); + } + + public EntityV3APISpecInterfaceSerializer() { + this(null); + } + + @Override + public void serialize( + EntityV3APISpecInterface value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class EntityV3APISpecInterfaceDeserializer + extends StdDeserializer { + public EntityV3APISpecInterfaceDeserializer() { + this(EntityV3APISpecInterface.class); + } + + public EntityV3APISpecInterfaceDeserializer(Class vc) { + super(vc); + } + + @Override + public EntityV3APISpecInterface deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize EntityV3APISpecInterfaceFileRef + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (EntityV3APISpecInterfaceFileRef.class.equals(Integer.class) + || EntityV3APISpecInterfaceFileRef.class.equals(Long.class) + || EntityV3APISpecInterfaceFileRef.class.equals(Float.class) + || EntityV3APISpecInterfaceFileRef.class.equals(Double.class) + || EntityV3APISpecInterfaceFileRef.class.equals(Boolean.class) + || EntityV3APISpecInterfaceFileRef.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((EntityV3APISpecInterfaceFileRef.class.equals(Integer.class) + || EntityV3APISpecInterfaceFileRef.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((EntityV3APISpecInterfaceFileRef.class.equals(Float.class) + || EntityV3APISpecInterfaceFileRef.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (EntityV3APISpecInterfaceFileRef.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (EntityV3APISpecInterfaceFileRef.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(EntityV3APISpecInterfaceFileRef.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((EntityV3APISpecInterfaceFileRef) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'EntityV3APISpecInterfaceFileRef'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'EntityV3APISpecInterfaceFileRef'", e); + } + + // deserialize EntityV3APISpecInterfaceDefinition + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (EntityV3APISpecInterfaceDefinition.class.equals(Integer.class) + || EntityV3APISpecInterfaceDefinition.class.equals(Long.class) + || EntityV3APISpecInterfaceDefinition.class.equals(Float.class) + || EntityV3APISpecInterfaceDefinition.class.equals(Double.class) + || EntityV3APISpecInterfaceDefinition.class.equals(Boolean.class) + || EntityV3APISpecInterfaceDefinition.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((EntityV3APISpecInterfaceDefinition.class.equals(Integer.class) + || EntityV3APISpecInterfaceDefinition.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((EntityV3APISpecInterfaceDefinition.class.equals(Float.class) + || EntityV3APISpecInterfaceDefinition.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (EntityV3APISpecInterfaceDefinition.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (EntityV3APISpecInterfaceDefinition.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(EntityV3APISpecInterfaceDefinition.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((EntityV3APISpecInterfaceDefinition) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'EntityV3APISpecInterfaceDefinition'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'EntityV3APISpecInterfaceDefinition'", + e); + } + + EntityV3APISpecInterface ret = new EntityV3APISpecInterface(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public EntityV3APISpecInterface getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "EntityV3APISpecInterface cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public EntityV3APISpecInterface() { + super("oneOf", Boolean.FALSE); + } + + public EntityV3APISpecInterface(EntityV3APISpecInterfaceFileRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public EntityV3APISpecInterface(EntityV3APISpecInterfaceDefinition o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "EntityV3APISpecInterfaceFileRef", new GenericType() {}); + schemas.put( + "EntityV3APISpecInterfaceDefinition", + new GenericType() {}); + JSON.registerDescendants(EntityV3APISpecInterface.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return EntityV3APISpecInterface.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: EntityV3APISpecInterfaceFileRef, + * EntityV3APISpecInterfaceDefinition + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + EntityV3APISpecInterfaceFileRef.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + EntityV3APISpecInterfaceDefinition.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be EntityV3APISpecInterfaceFileRef," + + " EntityV3APISpecInterfaceDefinition"); + } + + /** + * Get the actual instance, which can be the following: EntityV3APISpecInterfaceFileRef, + * EntityV3APISpecInterfaceDefinition + * + * @return The actual instance (EntityV3APISpecInterfaceFileRef, + * EntityV3APISpecInterfaceDefinition) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `EntityV3APISpecInterfaceFileRef`. If the actual instance is not + * `EntityV3APISpecInterfaceFileRef`, the ClassCastException will be thrown. + * + * @return The actual instance of `EntityV3APISpecInterfaceFileRef` + * @throws ClassCastException if the instance is not `EntityV3APISpecInterfaceFileRef` + */ + public EntityV3APISpecInterfaceFileRef getEntityV3APISpecInterfaceFileRef() + throws ClassCastException { + return (EntityV3APISpecInterfaceFileRef) super.getActualInstance(); + } + + /** + * Get the actual instance of `EntityV3APISpecInterfaceDefinition`. If the actual instance is not + * `EntityV3APISpecInterfaceDefinition`, the ClassCastException will be thrown. + * + * @return The actual instance of `EntityV3APISpecInterfaceDefinition` + * @throws ClassCastException if the instance is not `EntityV3APISpecInterfaceDefinition` + */ + public EntityV3APISpecInterfaceDefinition getEntityV3APISpecInterfaceDefinition() + throws ClassCastException { + return (EntityV3APISpecInterfaceDefinition) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/EntityV3APISpecInterfaceDefinition.java b/src/main/java/com/datadog/api/client/v2/model/EntityV3APISpecInterfaceDefinition.java new file mode 100644 index 00000000000..29871c8ed35 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EntityV3APISpecInterfaceDefinition.java @@ -0,0 +1,82 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** The definition of EntityV3APISpecInterfaceDefinition object. */ +@JsonPropertyOrder({EntityV3APISpecInterfaceDefinition.JSON_PROPERTY_DEFINITION}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EntityV3APISpecInterfaceDefinition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFINITION = "definition"; + private Object definition; + + public EntityV3APISpecInterfaceDefinition definition(Object definition) { + this.definition = definition; + return this; + } + + /** + * The API definition. + * + * @return definition + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFINITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getDefinition() { + return definition; + } + + public void setDefinition(Object definition) { + this.definition = definition; + } + + /** Return true if this EntityV3APISpecInterfaceDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EntityV3APISpecInterfaceDefinition entityV3ApiSpecInterfaceDefinition = + (EntityV3APISpecInterfaceDefinition) o; + return Objects.equals(this.definition, entityV3ApiSpecInterfaceDefinition.definition); + } + + @Override + public int hashCode() { + return Objects.hash(definition); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntityV3APISpecInterfaceDefinition {\n"); + sb.append(" definition: ").append(toIndentedString(definition)).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/EntityV3APISpecInterfaceFileRef.java b/src/main/java/com/datadog/api/client/v2/model/EntityV3APISpecInterfaceFileRef.java new file mode 100644 index 00000000000..e71a67d8b9f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EntityV3APISpecInterfaceFileRef.java @@ -0,0 +1,82 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** The definition of EntityV3APISpecInterfaceFileRef object. */ +@JsonPropertyOrder({EntityV3APISpecInterfaceFileRef.JSON_PROPERTY_FILE_REF}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EntityV3APISpecInterfaceFileRef { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FILE_REF = "fileRef"; + private String fileRef; + + public EntityV3APISpecInterfaceFileRef fileRef(String fileRef) { + this.fileRef = fileRef; + return this; + } + + /** + * The reference to the API definition file. + * + * @return fileRef + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFileRef() { + return fileRef; + } + + public void setFileRef(String fileRef) { + this.fileRef = fileRef; + } + + /** Return true if this EntityV3APISpecInterfaceFileRef object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EntityV3APISpecInterfaceFileRef entityV3ApiSpecInterfaceFileRef = + (EntityV3APISpecInterfaceFileRef) o; + return Objects.equals(this.fileRef, entityV3ApiSpecInterfaceFileRef.fileRef); + } + + @Override + public int hashCode() { + return Objects.hash(fileRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntityV3APISpecInterfaceFileRef {\n"); + sb.append(" fileRef: ").append(toIndentedString(fileRef)).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 "); + } +}