Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark usage fields as nullable #1764

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2023-04-27 20:42:54.686234",
"spec_repo_commit": "a3f3bc16"
"regenerated": "2023-04-28 13:28:21.708597",
"spec_repo_commit": "d013809f"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-04-27 20:42:54.701061",
"spec_repo_commit": "a3f3bc16"
"regenerated": "2023-04-28 13:28:21.726547",
"spec_repo_commit": "d013809f"
}
}
}
5 changes: 5 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16978,12 +16978,14 @@ components:
usage types by the Sensitive Data Scanner from the start of the given
hour\u2019s month until the given hour."
format: int64
nullable: true
type: integer
events_scanned_bytes:
description: "The total number of bytes scanned of Events usage across all
usage types by the Sensitive Data Scanner from the start of the given
hour\u2019s month until the given hour."
format: int64
nullable: true
type: integer
hour:
description: The hour for the usage.
Expand All @@ -16994,6 +16996,7 @@ components:
Data Scanner from the start of the given hour\u2019s month until the given
hour."
format: int64
nullable: true
type: integer
org_name:
description: The organization name.
Expand All @@ -17006,12 +17009,14 @@ components:
usage types by the Sensitive Data Scanner from the start of the given
hour\u2019s month until the given hour."
format: int64
nullable: true
type: integer
total_scanned_bytes:
description: "The total number of bytes scanned across all usage types by
the Sensitive Data Scanner from the start of the given hour\u2019s month
until the given hour."
format: int64
nullable: true
type: integer
type: object
UsageSDSResponse:
Expand Down
91 changes: 71 additions & 20 deletions src/main/java/com/datadog/api/client/v1/model/UsageSDSHour.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.time.OffsetDateTime;
import java.util.Objects;
import org.openapitools.jackson.nullable.JsonNullable;

/** Sensitive Data Scanner usage for a given organization for a given hour. */
@JsonPropertyOrder({
Expand All @@ -31,18 +32,18 @@
public class UsageSDSHour {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_APM_SCANNED_BYTES = "apm_scanned_bytes";
private Long apmScannedBytes;
private JsonNullable<Long> apmScannedBytes = JsonNullable.<Long>undefined();

public static final String JSON_PROPERTY_EVENTS_SCANNED_BYTES = "events_scanned_bytes";
private Long eventsScannedBytes;
private JsonNullable<Long> eventsScannedBytes = JsonNullable.<Long>undefined();

public static final String JSON_PROPERTY_HOUR = "hour";

@JsonSerialize(using = JsonTimeSerializer.class)
private OffsetDateTime hour;

public static final String JSON_PROPERTY_LOGS_SCANNED_BYTES = "logs_scanned_bytes";
private Long logsScannedBytes;
private JsonNullable<Long> logsScannedBytes = JsonNullable.<Long>undefined();

public static final String JSON_PROPERTY_ORG_NAME = "org_name";
private String orgName;
Expand All @@ -51,13 +52,13 @@ public class UsageSDSHour {
private String publicId;

public static final String JSON_PROPERTY_RUM_SCANNED_BYTES = "rum_scanned_bytes";
private Long rumScannedBytes;
private JsonNullable<Long> rumScannedBytes = JsonNullable.<Long>undefined();

public static final String JSON_PROPERTY_TOTAL_SCANNED_BYTES = "total_scanned_bytes";
private Long totalScannedBytes;
private JsonNullable<Long> totalScannedBytes = JsonNullable.<Long>undefined();

public UsageSDSHour apmScannedBytes(Long apmScannedBytes) {
this.apmScannedBytes = apmScannedBytes;
this.apmScannedBytes = JsonNullable.<Long>of(apmScannedBytes);
return this;
}

Expand All @@ -68,18 +69,28 @@ public UsageSDSHour apmScannedBytes(Long apmScannedBytes) {
* @return apmScannedBytes
*/
@jakarta.annotation.Nullable
@JsonIgnore
public Long getApmScannedBytes() {
return apmScannedBytes.orElse(null);
}

@JsonProperty(JSON_PROPERTY_APM_SCANNED_BYTES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getApmScannedBytes() {
public JsonNullable<Long> getApmScannedBytes_JsonNullable() {
return apmScannedBytes;
}

public void setApmScannedBytes(Long apmScannedBytes) {
@JsonProperty(JSON_PROPERTY_APM_SCANNED_BYTES)
public void setApmScannedBytes_JsonNullable(JsonNullable<Long> apmScannedBytes) {
this.apmScannedBytes = apmScannedBytes;
}

public void setApmScannedBytes(Long apmScannedBytes) {
this.apmScannedBytes = JsonNullable.<Long>of(apmScannedBytes);
}

public UsageSDSHour eventsScannedBytes(Long eventsScannedBytes) {
this.eventsScannedBytes = eventsScannedBytes;
this.eventsScannedBytes = JsonNullable.<Long>of(eventsScannedBytes);
return this;
}

Expand All @@ -90,16 +101,26 @@ public UsageSDSHour eventsScannedBytes(Long eventsScannedBytes) {
* @return eventsScannedBytes
*/
@jakarta.annotation.Nullable
@JsonIgnore
public Long getEventsScannedBytes() {
return eventsScannedBytes.orElse(null);
}

@JsonProperty(JSON_PROPERTY_EVENTS_SCANNED_BYTES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getEventsScannedBytes() {
public JsonNullable<Long> getEventsScannedBytes_JsonNullable() {
return eventsScannedBytes;
}

public void setEventsScannedBytes(Long eventsScannedBytes) {
@JsonProperty(JSON_PROPERTY_EVENTS_SCANNED_BYTES)
public void setEventsScannedBytes_JsonNullable(JsonNullable<Long> eventsScannedBytes) {
this.eventsScannedBytes = eventsScannedBytes;
}

public void setEventsScannedBytes(Long eventsScannedBytes) {
this.eventsScannedBytes = JsonNullable.<Long>of(eventsScannedBytes);
}

public UsageSDSHour hour(OffsetDateTime hour) {
this.hour = hour;
return this;
Expand All @@ -122,7 +143,7 @@ public void setHour(OffsetDateTime hour) {
}

public UsageSDSHour logsScannedBytes(Long logsScannedBytes) {
this.logsScannedBytes = logsScannedBytes;
this.logsScannedBytes = JsonNullable.<Long>of(logsScannedBytes);
return this;
}

Expand All @@ -133,16 +154,26 @@ public UsageSDSHour logsScannedBytes(Long logsScannedBytes) {
* @return logsScannedBytes
*/
@jakarta.annotation.Nullable
@JsonIgnore
public Long getLogsScannedBytes() {
return logsScannedBytes.orElse(null);
}

@JsonProperty(JSON_PROPERTY_LOGS_SCANNED_BYTES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getLogsScannedBytes() {
public JsonNullable<Long> getLogsScannedBytes_JsonNullable() {
return logsScannedBytes;
}

public void setLogsScannedBytes(Long logsScannedBytes) {
@JsonProperty(JSON_PROPERTY_LOGS_SCANNED_BYTES)
public void setLogsScannedBytes_JsonNullable(JsonNullable<Long> logsScannedBytes) {
this.logsScannedBytes = logsScannedBytes;
}

public void setLogsScannedBytes(Long logsScannedBytes) {
this.logsScannedBytes = JsonNullable.<Long>of(logsScannedBytes);
}

public UsageSDSHour orgName(String orgName) {
this.orgName = orgName;
return this;
Expand Down Expand Up @@ -186,7 +217,7 @@ public void setPublicId(String publicId) {
}

public UsageSDSHour rumScannedBytes(Long rumScannedBytes) {
this.rumScannedBytes = rumScannedBytes;
this.rumScannedBytes = JsonNullable.<Long>of(rumScannedBytes);
return this;
}

Expand All @@ -197,18 +228,28 @@ public UsageSDSHour rumScannedBytes(Long rumScannedBytes) {
* @return rumScannedBytes
*/
@jakarta.annotation.Nullable
@JsonIgnore
public Long getRumScannedBytes() {
return rumScannedBytes.orElse(null);
}

@JsonProperty(JSON_PROPERTY_RUM_SCANNED_BYTES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getRumScannedBytes() {
public JsonNullable<Long> getRumScannedBytes_JsonNullable() {
return rumScannedBytes;
}

public void setRumScannedBytes(Long rumScannedBytes) {
@JsonProperty(JSON_PROPERTY_RUM_SCANNED_BYTES)
public void setRumScannedBytes_JsonNullable(JsonNullable<Long> rumScannedBytes) {
this.rumScannedBytes = rumScannedBytes;
}

public void setRumScannedBytes(Long rumScannedBytes) {
this.rumScannedBytes = JsonNullable.<Long>of(rumScannedBytes);
}

public UsageSDSHour totalScannedBytes(Long totalScannedBytes) {
this.totalScannedBytes = totalScannedBytes;
this.totalScannedBytes = JsonNullable.<Long>of(totalScannedBytes);
return this;
}

Expand All @@ -219,16 +260,26 @@ public UsageSDSHour totalScannedBytes(Long totalScannedBytes) {
* @return totalScannedBytes
*/
@jakarta.annotation.Nullable
@JsonIgnore
public Long getTotalScannedBytes() {
return totalScannedBytes.orElse(null);
}

@JsonProperty(JSON_PROPERTY_TOTAL_SCANNED_BYTES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getTotalScannedBytes() {
public JsonNullable<Long> getTotalScannedBytes_JsonNullable() {
return totalScannedBytes;
}

public void setTotalScannedBytes(Long totalScannedBytes) {
@JsonProperty(JSON_PROPERTY_TOTAL_SCANNED_BYTES)
public void setTotalScannedBytes_JsonNullable(JsonNullable<Long> totalScannedBytes) {
this.totalScannedBytes = totalScannedBytes;
}

public void setTotalScannedBytes(Long totalScannedBytes) {
this.totalScannedBytes = JsonNullable.<Long>of(totalScannedBytes);
}

/** Return true if this UsageSDSHour object is equal to o. */
@Override
public boolean equals(Object o) {
Expand Down