From 559607230bfce2710d19161cb281c4f097869612 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 19 Jun 2026 11:48:37 +0000 Subject: [PATCH] Regenerate client from commit 7040bb9 of spec repo --- .generator/schemas/v2/openapi.yaml | 76 +++- .../v2/model/LogsArchiveDestinationS3.java | 4 +- .../v2/model/LogsArchiveIntegrationS3.java | 357 ++++++++++++------ .../LogsArchiveIntegrationS3AccessKey.java | 145 +++++++ .../model/LogsArchiveIntegrationS3Role.java | 174 +++++++++ 5 files changed, 631 insertions(+), 125 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v2/model/LogsArchiveIntegrationS3AccessKey.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/LogsArchiveIntegrationS3Role.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 65d674fb23d..b6eb8423df3 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -56750,19 +56750,35 @@ components: - client_email type: object LogsArchiveIntegrationS3: - description: The S3 Archive's integration destination. + description: >- + The S3 Archive's integration destination. You must provide one of the following: `access_key_id` alone, or both `account_id` and `role_name` together. + oneOf: + - $ref: "#/components/schemas/LogsArchiveIntegrationS3AccessKey" + - $ref: "#/components/schemas/LogsArchiveIntegrationS3Role" + LogsArchiveIntegrationS3AccessKey: + description: The S3 Archive's integration destination using an access key. + properties: + access_key_id: + description: The access key ID for the integration. + example: AKIAIOSFODNN7EXAMPLE + type: string + required: + - access_key_id + type: object + LogsArchiveIntegrationS3Role: + description: The S3 Archive's integration destination using an IAM role. properties: account_id: description: The account ID for the integration. example: "123456789012" type: string role_name: - description: The path of the integration. + description: The name of the role to assume for the integration. example: role-name type: string required: - - role_name - account_id + - role_name type: object LogsArchiveOrder: description: A ordered list of archive IDs. @@ -148590,6 +148606,18 @@ paths: - team:intake - team:app type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + name: Nginx Archive + query: source:nginx + type: archives schema: $ref: "#/components/schemas/LogsArchiveCreateRequest" description: The definition of the new archive. @@ -148615,6 +148643,21 @@ paths: state: WORKING id: 00000000-0000-0000-0000-000000000002 type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + include_tags: false + name: Nginx Archive + query: source:nginx + state: WORKING + id: 00000000-0000-0000-0000-000000000002 + type: archives schema: $ref: "#/components/schemas/LogsArchive" description: OK @@ -148764,6 +148807,18 @@ paths: - team:intake - team:app type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + name: Nginx Archive + query: source:nginx + type: archives schema: $ref: "#/components/schemas/LogsArchiveCreateRequest" description: New definition of the archive. @@ -148789,6 +148844,21 @@ paths: state: WORKING id: 00000000-0000-0000-0000-000000000004 type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + include_tags: false + name: Nginx Archive + query: source:nginx + state: WORKING + id: 00000000-0000-0000-0000-000000000004 + type: archives schema: $ref: "#/components/schemas/LogsArchive" description: OK diff --git a/src/main/java/com/datadog/api/client/v2/model/LogsArchiveDestinationS3.java b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveDestinationS3.java index 4d9cfaa164d..f4db1d90f4a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LogsArchiveDestinationS3.java +++ b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveDestinationS3.java @@ -113,7 +113,9 @@ public LogsArchiveDestinationS3 integration(LogsArchiveIntegrationS3 integration } /** - * The S3 Archive's integration destination. + * The S3 Archive's integration destination. You must provide one of the following: + * access_key_id alone, or both account_id and role_name + * together. * * @return integration */ diff --git a/src/main/java/com/datadog/api/client/v2/model/LogsArchiveIntegrationS3.java b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveIntegrationS3.java index 9de62a8ea17..919d3877fc9 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LogsArchiveIntegrationS3.java +++ b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveIntegrationS3.java @@ -6,168 +6,283 @@ package com.datadog.api.client.v2.model; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.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.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +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.Objects; +import java.util.logging.Level; +import java.util.logging.Logger; -/** The S3 Archive's integration destination. */ -@JsonPropertyOrder({ - LogsArchiveIntegrationS3.JSON_PROPERTY_ACCOUNT_ID, - LogsArchiveIntegrationS3.JSON_PROPERTY_ROLE_NAME -}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class LogsArchiveIntegrationS3 { +@JsonDeserialize(using = LogsArchiveIntegrationS3.LogsArchiveIntegrationS3Deserializer.class) +@JsonSerialize(using = LogsArchiveIntegrationS3.LogsArchiveIntegrationS3Serializer.class) +public class LogsArchiveIntegrationS3 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(LogsArchiveIntegrationS3.class.getName()); + @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - private String accountId; - public static final String JSON_PROPERTY_ROLE_NAME = "role_name"; - private String roleName; + public static class LogsArchiveIntegrationS3Serializer + extends StdSerializer { + public LogsArchiveIntegrationS3Serializer(Class t) { + super(t); + } - public LogsArchiveIntegrationS3() {} + public LogsArchiveIntegrationS3Serializer() { + this(null); + } - @JsonCreator - public LogsArchiveIntegrationS3( - @JsonProperty(required = true, value = JSON_PROPERTY_ACCOUNT_ID) String accountId, - @JsonProperty(required = true, value = JSON_PROPERTY_ROLE_NAME) String roleName) { - this.accountId = accountId; - this.roleName = roleName; + @Override + public void serialize( + LogsArchiveIntegrationS3 value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } } - public LogsArchiveIntegrationS3 accountId(String accountId) { - this.accountId = accountId; - return this; - } + public static class LogsArchiveIntegrationS3Deserializer + extends StdDeserializer { + public LogsArchiveIntegrationS3Deserializer() { + this(LogsArchiveIntegrationS3.class); + } - /** - * The account ID for the integration. - * - * @return accountId - */ - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getAccountId() { - return accountId; + public LogsArchiveIntegrationS3Deserializer(Class vc) { + super(vc); + } + + @Override + public LogsArchiveIntegrationS3 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 LogsArchiveIntegrationS3AccessKey + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (LogsArchiveIntegrationS3AccessKey.class.equals(Integer.class) + || LogsArchiveIntegrationS3AccessKey.class.equals(Long.class) + || LogsArchiveIntegrationS3AccessKey.class.equals(Float.class) + || LogsArchiveIntegrationS3AccessKey.class.equals(Double.class) + || LogsArchiveIntegrationS3AccessKey.class.equals(Boolean.class) + || LogsArchiveIntegrationS3AccessKey.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((LogsArchiveIntegrationS3AccessKey.class.equals(Integer.class) + || LogsArchiveIntegrationS3AccessKey.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((LogsArchiveIntegrationS3AccessKey.class.equals(Float.class) + || LogsArchiveIntegrationS3AccessKey.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (LogsArchiveIntegrationS3AccessKey.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (LogsArchiveIntegrationS3AccessKey.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(LogsArchiveIntegrationS3AccessKey.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 (!((LogsArchiveIntegrationS3AccessKey) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'LogsArchiveIntegrationS3AccessKey'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'LogsArchiveIntegrationS3AccessKey'", e); + } + + // deserialize LogsArchiveIntegrationS3Role + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (LogsArchiveIntegrationS3Role.class.equals(Integer.class) + || LogsArchiveIntegrationS3Role.class.equals(Long.class) + || LogsArchiveIntegrationS3Role.class.equals(Float.class) + || LogsArchiveIntegrationS3Role.class.equals(Double.class) + || LogsArchiveIntegrationS3Role.class.equals(Boolean.class) + || LogsArchiveIntegrationS3Role.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((LogsArchiveIntegrationS3Role.class.equals(Integer.class) + || LogsArchiveIntegrationS3Role.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((LogsArchiveIntegrationS3Role.class.equals(Float.class) + || LogsArchiveIntegrationS3Role.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (LogsArchiveIntegrationS3Role.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (LogsArchiveIntegrationS3Role.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(LogsArchiveIntegrationS3Role.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 (!((LogsArchiveIntegrationS3Role) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'LogsArchiveIntegrationS3Role'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'LogsArchiveIntegrationS3Role'", e); + } + + LogsArchiveIntegrationS3 ret = new LogsArchiveIntegrationS3(); + 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 LogsArchiveIntegrationS3 getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "LogsArchiveIntegrationS3 cannot be null"); + } } - public void setAccountId(String accountId) { - this.accountId = accountId; + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public LogsArchiveIntegrationS3() { + super("oneOf", Boolean.FALSE); } - public LogsArchiveIntegrationS3 roleName(String roleName) { - this.roleName = roleName; - return this; + public LogsArchiveIntegrationS3(LogsArchiveIntegrationS3AccessKey o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); } - /** - * The path of the integration. - * - * @return roleName - */ - @JsonProperty(JSON_PROPERTY_ROLE_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRoleName() { - return roleName; + public LogsArchiveIntegrationS3(LogsArchiveIntegrationS3Role o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); } - public void setRoleName(String roleName) { - this.roleName = roleName; + static { + schemas.put( + "LogsArchiveIntegrationS3AccessKey", + new GenericType() {}); + schemas.put("LogsArchiveIntegrationS3Role", new GenericType() {}); + JSON.registerDescendants(LogsArchiveIntegrationS3.class, Collections.unmodifiableMap(schemas)); } - /** - * 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; + @Override + public Map getSchemas() { + return LogsArchiveIntegrationS3.schemas; + } /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: LogsArchiveIntegrationS3AccessKey, + * LogsArchiveIntegrationS3Role * - * @param key The arbitrary key to set - * @param value The associated value - * @return LogsArchiveIntegrationS3 + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). */ - @JsonAnySetter - public LogsArchiveIntegrationS3 putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + LogsArchiveIntegrationS3AccessKey.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(LogsArchiveIntegrationS3Role.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; } - this.additionalProperties.put(key, value); - return this; + throw new RuntimeException( + "Invalid instance type. Must be LogsArchiveIntegrationS3AccessKey," + + " LogsArchiveIntegrationS3Role"); } /** - * Return the additional (undeclared) property. + * Get the actual instance, which can be the following: LogsArchiveIntegrationS3AccessKey, + * LogsArchiveIntegrationS3Role * - * @return The additional properties + * @return The actual instance (LogsArchiveIntegrationS3AccessKey, LogsArchiveIntegrationS3Role) */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; + @Override + public Object getActualInstance() { + return super.getActualInstance(); } /** - * Return the additional (undeclared) property with the specified name. + * Get the actual instance of `LogsArchiveIntegrationS3AccessKey`. If the actual instance is not + * `LogsArchiveIntegrationS3AccessKey`, the ClassCastException will be thrown. * - * @param key The arbitrary key to get - * @return The specific additional property for the given key + * @return The actual instance of `LogsArchiveIntegrationS3AccessKey` + * @throws ClassCastException if the instance is not `LogsArchiveIntegrationS3AccessKey` */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this LogsArchiveIntegrationS3 object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LogsArchiveIntegrationS3 logsArchiveIntegrationS3 = (LogsArchiveIntegrationS3) o; - return Objects.equals(this.accountId, logsArchiveIntegrationS3.accountId) - && Objects.equals(this.roleName, logsArchiveIntegrationS3.roleName) - && Objects.equals(this.additionalProperties, logsArchiveIntegrationS3.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(accountId, roleName, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class LogsArchiveIntegrationS3 {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); + public LogsArchiveIntegrationS3AccessKey getLogsArchiveIntegrationS3AccessKey() + throws ClassCastException { + return (LogsArchiveIntegrationS3AccessKey) super.getActualInstance(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * Get the actual instance of `LogsArchiveIntegrationS3Role`. If the actual instance is not + * `LogsArchiveIntegrationS3Role`, the ClassCastException will be thrown. + * + * @return The actual instance of `LogsArchiveIntegrationS3Role` + * @throws ClassCastException if the instance is not `LogsArchiveIntegrationS3Role` */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + public LogsArchiveIntegrationS3Role getLogsArchiveIntegrationS3Role() throws ClassCastException { + return (LogsArchiveIntegrationS3Role) super.getActualInstance(); } } diff --git a/src/main/java/com/datadog/api/client/v2/model/LogsArchiveIntegrationS3AccessKey.java b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveIntegrationS3AccessKey.java new file mode 100644 index 00000000000..da81d59e699 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveIntegrationS3AccessKey.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The S3 Archive's integration destination using an access key. */ +@JsonPropertyOrder({LogsArchiveIntegrationS3AccessKey.JSON_PROPERTY_ACCESS_KEY_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LogsArchiveIntegrationS3AccessKey { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCESS_KEY_ID = "access_key_id"; + private String accessKeyId; + + public LogsArchiveIntegrationS3AccessKey() {} + + @JsonCreator + public LogsArchiveIntegrationS3AccessKey( + @JsonProperty(required = true, value = JSON_PROPERTY_ACCESS_KEY_ID) String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + public LogsArchiveIntegrationS3AccessKey accessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + /** + * The access key ID for the integration. + * + * @return accessKeyId + */ + @JsonProperty(JSON_PROPERTY_ACCESS_KEY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccessKeyId() { + return accessKeyId; + } + + public void setAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + /** + * 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 LogsArchiveIntegrationS3AccessKey + */ + @JsonAnySetter + public LogsArchiveIntegrationS3AccessKey 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 LogsArchiveIntegrationS3AccessKey object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveIntegrationS3AccessKey logsArchiveIntegrationS3AccessKey = + (LogsArchiveIntegrationS3AccessKey) o; + return Objects.equals(this.accessKeyId, logsArchiveIntegrationS3AccessKey.accessKeyId) + && Objects.equals( + this.additionalProperties, logsArchiveIntegrationS3AccessKey.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveIntegrationS3AccessKey {\n"); + sb.append(" accessKeyId: ").append(toIndentedString(accessKeyId)).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/LogsArchiveIntegrationS3Role.java b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveIntegrationS3Role.java new file mode 100644 index 00000000000..6cf709a2e1b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveIntegrationS3Role.java @@ -0,0 +1,174 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The S3 Archive's integration destination using an IAM role. */ +@JsonPropertyOrder({ + LogsArchiveIntegrationS3Role.JSON_PROPERTY_ACCOUNT_ID, + LogsArchiveIntegrationS3Role.JSON_PROPERTY_ROLE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LogsArchiveIntegrationS3Role { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_ROLE_NAME = "role_name"; + private String roleName; + + public LogsArchiveIntegrationS3Role() {} + + @JsonCreator + public LogsArchiveIntegrationS3Role( + @JsonProperty(required = true, value = JSON_PROPERTY_ACCOUNT_ID) String accountId, + @JsonProperty(required = true, value = JSON_PROPERTY_ROLE_NAME) String roleName) { + this.accountId = accountId; + this.roleName = roleName; + } + + public LogsArchiveIntegrationS3Role accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The account ID for the integration. + * + * @return accountId + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public LogsArchiveIntegrationS3Role roleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * The name of the role to assume for the integration. + * + * @return roleName + */ + @JsonProperty(JSON_PROPERTY_ROLE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + /** + * 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 LogsArchiveIntegrationS3Role + */ + @JsonAnySetter + public LogsArchiveIntegrationS3Role 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 LogsArchiveIntegrationS3Role object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveIntegrationS3Role logsArchiveIntegrationS3Role = (LogsArchiveIntegrationS3Role) o; + return Objects.equals(this.accountId, logsArchiveIntegrationS3Role.accountId) + && Objects.equals(this.roleName, logsArchiveIntegrationS3Role.roleName) + && Objects.equals( + this.additionalProperties, logsArchiveIntegrationS3Role.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, roleName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveIntegrationS3Role {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" roleName: ").append(toIndentedString(roleName)).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 "); + } +}