diff --git a/.apigentools-info b/.apigentools-info index 6651f283767..4ef880dc8f0 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-09 02:41:26.674771", - "spec_repo_commit": "39adb7c0" + "regenerated": "2025-05-09 14:41:37.329090", + "spec_repo_commit": "f0e5e32f" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-09 02:41:26.695479", - "spec_repo_commit": "39adb7c0" + "regenerated": "2025-05-09 14:41:37.345392", + "spec_repo_commit": "f0e5e32f" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 976fac306b3..e1a404d9a74 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -18663,7 +18663,7 @@ components: description: An optional list of time restrictions for when this layer is in effect. items: - $ref: '#/components/schemas/LayerAttributesRestrictionsItems' + $ref: '#/components/schemas/TimeRestriction' type: array rotation_start: description: The date/time when the rotation starts (ISO 8601). @@ -18687,63 +18687,6 @@ components: maximum: 2592000 type: integer type: object - LayerAttributesRestrictionsItems: - description: 'Represents a time restriction within a layer, specifying the days - and times - - when this layer is active or inactive.' - properties: - end_day: - $ref: '#/components/schemas/LayerAttributesRestrictionsItemsEndDay' - end_time: - description: The time of day the restriction ends (hh:mm:ss). - example: '17:00:00' - type: string - start_day: - $ref: '#/components/schemas/LayerAttributesRestrictionsItemsStartDay' - start_time: - description: The time of day the restriction begins (hh:mm:ss). - example: 09:00:00 - type: string - type: object - LayerAttributesRestrictionsItemsEndDay: - description: Defines the end day of the restriction within a Layer. - enum: - - monday - - tuesday - - wednesday - - thursday - - friday - - saturday - - sunday - type: string - x-enum-varnames: - - MONDAY - - TUESDAY - - WEDNESDAY - - THURSDAY - - FRIDAY - - SATURDAY - - SUNDAY - LayerAttributesRestrictionsItemsStartDay: - description: Defines the start day of the restriction within a Layer. - enum: - - monday - - tuesday - - wednesday - - thursday - - friday - - saturday - - sunday - type: string - x-enum-varnames: - - MONDAY - - TUESDAY - - WEDNESDAY - - THURSDAY - - FRIDAY - - SATURDAY - - SUNDAY LayerRelationships: description: Holds references to objects related to the Layer entity, such as its members. @@ -31120,7 +31063,7 @@ components: description: Zero or more time-based restrictions (for example, only weekdays, during business hours). items: - $ref: '#/components/schemas/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems' + $ref: '#/components/schemas/TimeRestriction' type: array rotation_start: description: The date/time when the rotation for this layer starts (in ISO @@ -31169,62 +31112,6 @@ components: example: 00000000-aba1-0000-0000-000000000000 type: string type: object - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems: - description: 'Defines a time restriction for a schedule layer, including which - day of the week - - it starts and ends, along with start/end times.' - properties: - end_day: - $ref: '#/components/schemas/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay' - end_time: - description: The time of day when the restriction ends (hh:mm:ss). - type: string - start_day: - $ref: '#/components/schemas/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay' - start_time: - description: The time of day when the restriction begins (hh:mm:ss). - type: string - type: object - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay: - description: The weekday when the restriction period ends (Monday through Sunday). - enum: - - monday - - tuesday - - wednesday - - thursday - - friday - - saturday - - sunday - type: string - x-enum-varnames: - - MONDAY - - TUESDAY - - WEDNESDAY - - THURSDAY - - FRIDAY - - SATURDAY - - SUNDAY - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay: - description: The weekday when the restriction period starts (Monday through - Sunday). - enum: - - monday - - tuesday - - wednesday - - thursday - - friday - - saturday - - sunday - type: string - x-enum-varnames: - - MONDAY - - TUESDAY - - WEDNESDAY - - THURSDAY - - FRIDAY - - SATURDAY - - SUNDAY ScheduleCreateRequestDataRelationships: description: Gathers relationship objects for the schedule creation request, including the teams to associate. @@ -31628,7 +31515,7 @@ components: restrictions: description: Any time restrictions that define when this layer is active. items: - $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems' + $ref: '#/components/schemas/TimeRestriction' type: array rotation_start: description: The date/time at which the rotation begins (ISO 8601 format). @@ -31678,63 +31565,6 @@ components: example: 00000000-aba1-0000-0000-000000000000 type: string type: object - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems: - description: 'Defines a time restriction object for a layer within a schedule - update, including - - start and end days, as well as times.' - properties: - end_day: - $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay' - end_time: - description: The time at which this restriction ends (hh:mm:ss). - example: '17:00:00' - type: string - start_day: - $ref: '#/components/schemas/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay' - start_time: - description: The time at which this restriction starts (hh:mm:ss). - example: 09:00:00 - type: string - type: object - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay: - description: Defines the day of the week on which the time restriction ends. - enum: - - monday - - tuesday - - wednesday - - thursday - - friday - - saturday - - sunday - type: string - x-enum-varnames: - - MONDAY - - TUESDAY - - WEDNESDAY - - THURSDAY - - FRIDAY - - SATURDAY - - SUNDAY - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay: - description: Defines the day of the week on which the time restriction starts. - enum: - - monday - - tuesday - - wednesday - - thursday - - friday - - saturday - - sunday - type: string - x-enum-varnames: - - MONDAY - - TUESDAY - - WEDNESDAY - - THURSDAY - - FRIDAY - - SATURDAY - - SUNDAY ScheduleUpdateRequestDataRelationships: description: Houses relationships for the schedule update, typically referencing teams. diff --git a/examples/v2/on-call/CreateOnCallSchedule.java b/examples/v2/on-call/CreateOnCallSchedule.java index d5734a6e637..50b0966192a 100644 --- a/examples/v2/on-call/CreateOnCallSchedule.java +++ b/examples/v2/on-call/CreateOnCallSchedule.java @@ -10,14 +10,13 @@ import com.datadog.api.client.v2.model.ScheduleCreateRequestDataAttributesLayersItemsInterval; import com.datadog.api.client.v2.model.ScheduleCreateRequestDataAttributesLayersItemsMembersItems; import com.datadog.api.client.v2.model.ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser; -import com.datadog.api.client.v2.model.ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems; -import com.datadog.api.client.v2.model.ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay; -import com.datadog.api.client.v2.model.ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay; import com.datadog.api.client.v2.model.ScheduleCreateRequestDataRelationships; import com.datadog.api.client.v2.model.ScheduleCreateRequestDataRelationshipsTeams; import com.datadog.api.client.v2.model.ScheduleCreateRequestDataRelationshipsTeamsDataItems; import com.datadog.api.client.v2.model.ScheduleCreateRequestDataRelationshipsTeamsDataItemsType; import com.datadog.api.client.v2.model.ScheduleCreateRequestDataType; +import com.datadog.api.client.v2.model.TimeRestriction; +import com.datadog.api.client.v2.model.Weekday; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.Collections; @@ -56,14 +55,10 @@ public static void main(String[] args) { .name("Layer 1") .restrictions( Collections.singletonList( - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems() - .endDay( - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - .FRIDAY) + new TimeRestriction() + .endDay(Weekday.FRIDAY) .endTime("17:00:00") - .startDay( - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - .MONDAY) + .startDay(Weekday.MONDAY) .startTime("09:00:00"))) .rotationStart(OffsetDateTime.now().plusDays(-5)))) .name("Example-On-Call") diff --git a/examples/v2/on-call/UpdateOnCallSchedule.java b/examples/v2/on-call/UpdateOnCallSchedule.java index 5aa6685a0f8..06f9ef90a8d 100644 --- a/examples/v2/on-call/UpdateOnCallSchedule.java +++ b/examples/v2/on-call/UpdateOnCallSchedule.java @@ -10,14 +10,13 @@ import com.datadog.api.client.v2.model.ScheduleUpdateRequestDataAttributesLayersItemsInterval; import com.datadog.api.client.v2.model.ScheduleUpdateRequestDataAttributesLayersItemsMembersItems; import com.datadog.api.client.v2.model.ScheduleUpdateRequestDataAttributesLayersItemsMembersItemsUser; -import com.datadog.api.client.v2.model.ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems; -import com.datadog.api.client.v2.model.ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay; -import com.datadog.api.client.v2.model.ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay; import com.datadog.api.client.v2.model.ScheduleUpdateRequestDataRelationships; import com.datadog.api.client.v2.model.ScheduleUpdateRequestDataRelationshipsTeams; import com.datadog.api.client.v2.model.ScheduleUpdateRequestDataRelationshipsTeamsDataItems; import com.datadog.api.client.v2.model.ScheduleUpdateRequestDataRelationshipsTeamsDataItemsType; import com.datadog.api.client.v2.model.ScheduleUpdateRequestDataType; +import com.datadog.api.client.v2.model.TimeRestriction; +import com.datadog.api.client.v2.model.Weekday; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.Collections; @@ -63,14 +62,10 @@ public static void main(String[] args) { .name("Layer 1") .restrictions( Collections.singletonList( - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems() - .endDay( - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - .FRIDAY) + new TimeRestriction() + .endDay(Weekday.FRIDAY) .endTime("17:00:00") - .startDay( - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - .MONDAY) + .startDay(Weekday.MONDAY) .startTime("09:00:00"))) .rotationStart(OffsetDateTime.now().plusDays(-5)))) .name("Example-On-Call") diff --git a/src/main/java/com/datadog/api/client/v2/model/LayerAttributes.java b/src/main/java/com/datadog/api/client/v2/model/LayerAttributes.java index 035699355ac..2c9f1783481 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LayerAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/LayerAttributes.java @@ -48,7 +48,7 @@ public class LayerAttributes { private String name; public static final String JSON_PROPERTY_RESTRICTIONS = "restrictions"; - private List restrictions = null; + private List restrictions = null; public static final String JSON_PROPERTY_ROTATION_START = "rotation_start"; private OffsetDateTime rotationStart; @@ -138,15 +138,15 @@ public void setName(String name) { this.name = name; } - public LayerAttributes restrictions(List restrictions) { + public LayerAttributes restrictions(List restrictions) { this.restrictions = restrictions; - for (LayerAttributesRestrictionsItems item : restrictions) { + for (TimeRestriction item : restrictions) { this.unparsed |= item.unparsed; } return this; } - public LayerAttributes addRestrictionsItem(LayerAttributesRestrictionsItems restrictionsItem) { + public LayerAttributes addRestrictionsItem(TimeRestriction restrictionsItem) { if (this.restrictions == null) { this.restrictions = new ArrayList<>(); } @@ -163,11 +163,11 @@ public LayerAttributes addRestrictionsItem(LayerAttributesRestrictionsItems rest @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_RESTRICTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getRestrictions() { + public List getRestrictions() { return restrictions; } - public void setRestrictions(List restrictions) { + public void setRestrictions(List restrictions) { this.restrictions = restrictions; } diff --git a/src/main/java/com/datadog/api/client/v2/model/LayerAttributesRestrictionsItems.java b/src/main/java/com/datadog/api/client/v2/model/LayerAttributesRestrictionsItems.java deleted file mode 100644 index 19864b30986..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/LayerAttributesRestrictionsItems.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * 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; - -/** - * Represents a time restriction within a layer, specifying the days and times when this layer is - * active or inactive. - */ -@JsonPropertyOrder({ - LayerAttributesRestrictionsItems.JSON_PROPERTY_END_DAY, - LayerAttributesRestrictionsItems.JSON_PROPERTY_END_TIME, - LayerAttributesRestrictionsItems.JSON_PROPERTY_START_DAY, - LayerAttributesRestrictionsItems.JSON_PROPERTY_START_TIME -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class LayerAttributesRestrictionsItems { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_END_DAY = "end_day"; - private LayerAttributesRestrictionsItemsEndDay endDay; - - public static final String JSON_PROPERTY_END_TIME = "end_time"; - private String endTime; - - public static final String JSON_PROPERTY_START_DAY = "start_day"; - private LayerAttributesRestrictionsItemsStartDay startDay; - - public static final String JSON_PROPERTY_START_TIME = "start_time"; - private String startTime; - - public LayerAttributesRestrictionsItems endDay(LayerAttributesRestrictionsItemsEndDay endDay) { - this.endDay = endDay; - this.unparsed |= !endDay.isValid(); - return this; - } - - /** - * Defines the end day of the restriction within a Layer. - * - * @return endDay - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_END_DAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public LayerAttributesRestrictionsItemsEndDay getEndDay() { - return endDay; - } - - public void setEndDay(LayerAttributesRestrictionsItemsEndDay endDay) { - if (!endDay.isValid()) { - this.unparsed = true; - } - this.endDay = endDay; - } - - public LayerAttributesRestrictionsItems endTime(String endTime) { - this.endTime = endTime; - return this; - } - - /** - * The time of day the restriction ends (hh:mm:ss). - * - * @return endTime - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_END_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public LayerAttributesRestrictionsItems startDay( - LayerAttributesRestrictionsItemsStartDay startDay) { - this.startDay = startDay; - this.unparsed |= !startDay.isValid(); - return this; - } - - /** - * Defines the start day of the restriction within a Layer. - * - * @return startDay - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_START_DAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public LayerAttributesRestrictionsItemsStartDay getStartDay() { - return startDay; - } - - public void setStartDay(LayerAttributesRestrictionsItemsStartDay startDay) { - if (!startDay.isValid()) { - this.unparsed = true; - } - this.startDay = startDay; - } - - public LayerAttributesRestrictionsItems startTime(String startTime) { - this.startTime = startTime; - return this; - } - - /** - * The time of day the restriction begins (hh:mm:ss). - * - * @return startTime - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_START_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - /** - * 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 LayerAttributesRestrictionsItems - */ - @JsonAnySetter - public LayerAttributesRestrictionsItems 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 LayerAttributesRestrictionsItems object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LayerAttributesRestrictionsItems layerAttributesRestrictionsItems = - (LayerAttributesRestrictionsItems) o; - return Objects.equals(this.endDay, layerAttributesRestrictionsItems.endDay) - && Objects.equals(this.endTime, layerAttributesRestrictionsItems.endTime) - && Objects.equals(this.startDay, layerAttributesRestrictionsItems.startDay) - && Objects.equals(this.startTime, layerAttributesRestrictionsItems.startTime) - && Objects.equals( - this.additionalProperties, layerAttributesRestrictionsItems.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(endDay, endTime, startDay, startTime, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class LayerAttributesRestrictionsItems {\n"); - sb.append(" endDay: ").append(toIndentedString(endDay)).append("\n"); - sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); - sb.append(" startDay: ").append(toIndentedString(startDay)).append("\n"); - sb.append(" startTime: ").append(toIndentedString(startTime)).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/LayerAttributesRestrictionsItemsEndDay.java b/src/main/java/com/datadog/api/client/v2/model/LayerAttributesRestrictionsItemsEndDay.java deleted file mode 100644 index 648280a053f..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/LayerAttributesRestrictionsItemsEndDay.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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; - -/** Defines the end day of the restriction within a Layer. */ -@JsonSerialize( - using = - LayerAttributesRestrictionsItemsEndDay.LayerAttributesRestrictionsItemsEndDaySerializer - .class) -public class LayerAttributesRestrictionsItemsEndDay extends ModelEnum { - - private static final Set allowedValues = - new HashSet( - Arrays.asList( - "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday")); - - public static final LayerAttributesRestrictionsItemsEndDay MONDAY = - new LayerAttributesRestrictionsItemsEndDay("monday"); - public static final LayerAttributesRestrictionsItemsEndDay TUESDAY = - new LayerAttributesRestrictionsItemsEndDay("tuesday"); - public static final LayerAttributesRestrictionsItemsEndDay WEDNESDAY = - new LayerAttributesRestrictionsItemsEndDay("wednesday"); - public static final LayerAttributesRestrictionsItemsEndDay THURSDAY = - new LayerAttributesRestrictionsItemsEndDay("thursday"); - public static final LayerAttributesRestrictionsItemsEndDay FRIDAY = - new LayerAttributesRestrictionsItemsEndDay("friday"); - public static final LayerAttributesRestrictionsItemsEndDay SATURDAY = - new LayerAttributesRestrictionsItemsEndDay("saturday"); - public static final LayerAttributesRestrictionsItemsEndDay SUNDAY = - new LayerAttributesRestrictionsItemsEndDay("sunday"); - - LayerAttributesRestrictionsItemsEndDay(String value) { - super(value, allowedValues); - } - - public static class LayerAttributesRestrictionsItemsEndDaySerializer - extends StdSerializer { - public LayerAttributesRestrictionsItemsEndDaySerializer( - Class t) { - super(t); - } - - public LayerAttributesRestrictionsItemsEndDaySerializer() { - this(null); - } - - @Override - public void serialize( - LayerAttributesRestrictionsItemsEndDay value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static LayerAttributesRestrictionsItemsEndDay fromValue(String value) { - return new LayerAttributesRestrictionsItemsEndDay(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/LayerAttributesRestrictionsItemsStartDay.java b/src/main/java/com/datadog/api/client/v2/model/LayerAttributesRestrictionsItemsStartDay.java deleted file mode 100644 index a6a89149674..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/LayerAttributesRestrictionsItemsStartDay.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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; - -/** Defines the start day of the restriction within a Layer. */ -@JsonSerialize( - using = - LayerAttributesRestrictionsItemsStartDay.LayerAttributesRestrictionsItemsStartDaySerializer - .class) -public class LayerAttributesRestrictionsItemsStartDay extends ModelEnum { - - private static final Set allowedValues = - new HashSet( - Arrays.asList( - "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday")); - - public static final LayerAttributesRestrictionsItemsStartDay MONDAY = - new LayerAttributesRestrictionsItemsStartDay("monday"); - public static final LayerAttributesRestrictionsItemsStartDay TUESDAY = - new LayerAttributesRestrictionsItemsStartDay("tuesday"); - public static final LayerAttributesRestrictionsItemsStartDay WEDNESDAY = - new LayerAttributesRestrictionsItemsStartDay("wednesday"); - public static final LayerAttributesRestrictionsItemsStartDay THURSDAY = - new LayerAttributesRestrictionsItemsStartDay("thursday"); - public static final LayerAttributesRestrictionsItemsStartDay FRIDAY = - new LayerAttributesRestrictionsItemsStartDay("friday"); - public static final LayerAttributesRestrictionsItemsStartDay SATURDAY = - new LayerAttributesRestrictionsItemsStartDay("saturday"); - public static final LayerAttributesRestrictionsItemsStartDay SUNDAY = - new LayerAttributesRestrictionsItemsStartDay("sunday"); - - LayerAttributesRestrictionsItemsStartDay(String value) { - super(value, allowedValues); - } - - public static class LayerAttributesRestrictionsItemsStartDaySerializer - extends StdSerializer { - public LayerAttributesRestrictionsItemsStartDaySerializer( - Class t) { - super(t); - } - - public LayerAttributesRestrictionsItemsStartDaySerializer() { - this(null); - } - - @Override - public void serialize( - LayerAttributesRestrictionsItemsStartDay value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static LayerAttributesRestrictionsItemsStartDay fromValue(String value) { - return new LayerAttributesRestrictionsItemsStartDay(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItems.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItems.java index dc4f365926a..2cf72502d24 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItems.java @@ -54,7 +54,7 @@ public class ScheduleCreateRequestDataAttributesLayersItems { private String name; public static final String JSON_PROPERTY_RESTRICTIONS = "restrictions"; - private List restrictions = null; + private List restrictions = null; public static final String JSON_PROPERTY_ROTATION_START = "rotation_start"; private OffsetDateTime rotationStart; @@ -196,16 +196,16 @@ public void setName(String name) { } public ScheduleCreateRequestDataAttributesLayersItems restrictions( - List restrictions) { + List restrictions) { this.restrictions = restrictions; - for (ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems item : restrictions) { + for (TimeRestriction item : restrictions) { this.unparsed |= item.unparsed; } return this; } public ScheduleCreateRequestDataAttributesLayersItems addRestrictionsItem( - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems restrictionsItem) { + TimeRestriction restrictionsItem) { if (this.restrictions == null) { this.restrictions = new ArrayList<>(); } @@ -222,12 +222,11 @@ public ScheduleCreateRequestDataAttributesLayersItems addRestrictionsItem( @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_RESTRICTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getRestrictions() { + public List getRestrictions() { return restrictions; } - public void setRestrictions( - List restrictions) { + public void setRestrictions(List restrictions) { this.restrictions = restrictions; } diff --git a/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.java deleted file mode 100644 index aa7bdf66c2c..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * 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; - -/** - * Defines a time restriction for a schedule layer, including which day of the week it starts and - * ends, along with start/end times. - */ -@JsonPropertyOrder({ - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.JSON_PROPERTY_END_DAY, - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.JSON_PROPERTY_END_TIME, - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.JSON_PROPERTY_START_DAY, - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.JSON_PROPERTY_START_TIME -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_END_DAY = "end_day"; - private ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay endDay; - - public static final String JSON_PROPERTY_END_TIME = "end_time"; - private String endTime; - - public static final String JSON_PROPERTY_START_DAY = "start_day"; - private ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay startDay; - - public static final String JSON_PROPERTY_START_TIME = "start_time"; - private String startTime; - - public ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems endDay( - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay endDay) { - this.endDay = endDay; - this.unparsed |= !endDay.isValid(); - return this; - } - - /** - * The weekday when the restriction period ends (Monday through Sunday). - * - * @return endDay - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_END_DAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay getEndDay() { - return endDay; - } - - public void setEndDay( - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay endDay) { - if (!endDay.isValid()) { - this.unparsed = true; - } - this.endDay = endDay; - } - - public ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems endTime(String endTime) { - this.endTime = endTime; - return this; - } - - /** - * The time of day when the restriction ends (hh:mm:ss). - * - * @return endTime - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_END_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems startDay( - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay startDay) { - this.startDay = startDay; - this.unparsed |= !startDay.isValid(); - return this; - } - - /** - * The weekday when the restriction period starts (Monday through Sunday). - * - * @return startDay - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_START_DAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay getStartDay() { - return startDay; - } - - public void setStartDay( - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay startDay) { - if (!startDay.isValid()) { - this.unparsed = true; - } - this.startDay = startDay; - } - - public ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems startTime( - String startTime) { - this.startTime = startTime; - return this; - } - - /** - * The time of day when the restriction begins (hh:mm:ss). - * - * @return startTime - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_START_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - /** - * 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 ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems - */ - @JsonAnySetter - public ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems 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 ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems object is - * equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems - scheduleCreateRequestDataAttributesLayersItemsRestrictionsItems = - (ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems) o; - return Objects.equals( - this.endDay, scheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.endDay) - && Objects.equals( - this.endTime, scheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.endTime) - && Objects.equals( - this.startDay, scheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.startDay) - && Objects.equals( - this.startTime, - scheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.startTime) - && Objects.equals( - this.additionalProperties, - scheduleCreateRequestDataAttributesLayersItemsRestrictionsItems.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(endDay, endTime, startDay, startTime, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItems {\n"); - sb.append(" endDay: ").append(toIndentedString(endDay)).append("\n"); - sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); - sb.append(" startDay: ").append(toIndentedString(startDay)).append("\n"); - sb.append(" startTime: ").append(toIndentedString(startTime)).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/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.java deleted file mode 100644 index d932ed87091..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 weekday when the restriction period ends (Monday through Sunday). */ -@JsonSerialize( - using = - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - .ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDaySerializer.class) -public class ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - extends ModelEnum { - - private static final Set allowedValues = - new HashSet( - Arrays.asList( - "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday")); - - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay MONDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("monday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - TUESDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("tuesday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - WEDNESDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("wednesday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - THURSDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("thursday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay FRIDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("friday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - SATURDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("saturday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay SUNDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("sunday"); - - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay(String value) { - super(value, allowedValues); - } - - public static - class ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDaySerializer - extends StdSerializer { - public ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDaySerializer( - Class t) { - super(t); - } - - public ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDaySerializer() { - this(null); - } - - @Override - public void serialize( - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay fromValue( - String value) { - return new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsEndDay(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.java deleted file mode 100644 index 0f8e84c8744..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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 weekday when the restriction period starts (Monday through Sunday). */ -@JsonSerialize( - using = - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - .ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDaySerializer - .class) -public class ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - extends ModelEnum { - - private static final Set allowedValues = - new HashSet( - Arrays.asList( - "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday")); - - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - MONDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("monday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - TUESDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("tuesday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - WEDNESDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("wednesday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - THURSDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("thursday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - FRIDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("friday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - SATURDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("saturday"); - public static final ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - SUNDAY = - new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("sunday"); - - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay(String value) { - super(value, allowedValues); - } - - public static - class ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDaySerializer - extends StdSerializer< - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay> { - public ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDaySerializer( - Class t) { - super(t); - } - - public ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDaySerializer() { - this(null); - } - - @Override - public void serialize( - ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay fromValue( - String value) { - return new ScheduleCreateRequestDataAttributesLayersItemsRestrictionsItemsStartDay(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItems.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItems.java index 8609d2a13df..fcc8c72dc80 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItems.java @@ -58,7 +58,7 @@ public class ScheduleUpdateRequestDataAttributesLayersItems { private String name; public static final String JSON_PROPERTY_RESTRICTIONS = "restrictions"; - private List restrictions = null; + private List restrictions = null; public static final String JSON_PROPERTY_ROTATION_START = "rotation_start"; private OffsetDateTime rotationStart; @@ -222,16 +222,16 @@ public void setName(String name) { } public ScheduleUpdateRequestDataAttributesLayersItems restrictions( - List restrictions) { + List restrictions) { this.restrictions = restrictions; - for (ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems item : restrictions) { + for (TimeRestriction item : restrictions) { this.unparsed |= item.unparsed; } return this; } public ScheduleUpdateRequestDataAttributesLayersItems addRestrictionsItem( - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems restrictionsItem) { + TimeRestriction restrictionsItem) { if (this.restrictions == null) { this.restrictions = new ArrayList<>(); } @@ -248,12 +248,11 @@ public ScheduleUpdateRequestDataAttributesLayersItems addRestrictionsItem( @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_RESTRICTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getRestrictions() { + public List getRestrictions() { return restrictions; } - public void setRestrictions( - List restrictions) { + public void setRestrictions(List restrictions) { this.restrictions = restrictions; } diff --git a/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.java deleted file mode 100644 index 798f3fbf32a..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * 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; - -/** - * Defines a time restriction object for a layer within a schedule update, including start and end - * days, as well as times. - */ -@JsonPropertyOrder({ - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.JSON_PROPERTY_END_DAY, - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.JSON_PROPERTY_END_TIME, - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.JSON_PROPERTY_START_DAY, - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.JSON_PROPERTY_START_TIME -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_END_DAY = "end_day"; - private ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay endDay; - - public static final String JSON_PROPERTY_END_TIME = "end_time"; - private String endTime; - - public static final String JSON_PROPERTY_START_DAY = "start_day"; - private ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay startDay; - - public static final String JSON_PROPERTY_START_TIME = "start_time"; - private String startTime; - - public ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems endDay( - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay endDay) { - this.endDay = endDay; - this.unparsed |= !endDay.isValid(); - return this; - } - - /** - * Defines the day of the week on which the time restriction ends. - * - * @return endDay - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_END_DAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay getEndDay() { - return endDay; - } - - public void setEndDay( - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay endDay) { - if (!endDay.isValid()) { - this.unparsed = true; - } - this.endDay = endDay; - } - - public ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems endTime(String endTime) { - this.endTime = endTime; - return this; - } - - /** - * The time at which this restriction ends (hh:mm:ss). - * - * @return endTime - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_END_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems startDay( - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay startDay) { - this.startDay = startDay; - this.unparsed |= !startDay.isValid(); - return this; - } - - /** - * Defines the day of the week on which the time restriction starts. - * - * @return startDay - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_START_DAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay getStartDay() { - return startDay; - } - - public void setStartDay( - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay startDay) { - if (!startDay.isValid()) { - this.unparsed = true; - } - this.startDay = startDay; - } - - public ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems startTime( - String startTime) { - this.startTime = startTime; - return this; - } - - /** - * The time at which this restriction starts (hh:mm:ss). - * - * @return startTime - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_START_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - /** - * 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 ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems - */ - @JsonAnySetter - public ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems 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 ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems object is - * equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems - scheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems = - (ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems) o; - return Objects.equals( - this.endDay, scheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.endDay) - && Objects.equals( - this.endTime, scheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.endTime) - && Objects.equals( - this.startDay, scheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.startDay) - && Objects.equals( - this.startTime, - scheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.startTime) - && Objects.equals( - this.additionalProperties, - scheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(endDay, endTime, startDay, startTime, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItems {\n"); - sb.append(" endDay: ").append(toIndentedString(endDay)).append("\n"); - sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); - sb.append(" startDay: ").append(toIndentedString(startDay)).append("\n"); - sb.append(" startTime: ").append(toIndentedString(startTime)).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/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.java deleted file mode 100644 index 3968cb01a04..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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; - -/** Defines the day of the week on which the time restriction ends. */ -@JsonSerialize( - using = - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - .ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDaySerializer.class) -public class ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - extends ModelEnum { - - private static final Set allowedValues = - new HashSet( - Arrays.asList( - "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday")); - - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay MONDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("monday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - TUESDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("tuesday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - WEDNESDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("wednesday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - THURSDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("thursday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay FRIDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("friday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay - SATURDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("saturday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay SUNDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay("sunday"); - - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay(String value) { - super(value, allowedValues); - } - - public static - class ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDaySerializer - extends StdSerializer { - public ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDaySerializer( - Class t) { - super(t); - } - - public ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDaySerializer() { - this(null); - } - - @Override - public void serialize( - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay fromValue( - String value) { - return new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsEndDay(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.java deleted file mode 100644 index b1f73ffcd12..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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; - -/** Defines the day of the week on which the time restriction starts. */ -@JsonSerialize( - using = - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - .ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDaySerializer - .class) -public class ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - extends ModelEnum { - - private static final Set allowedValues = - new HashSet( - Arrays.asList( - "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday")); - - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - MONDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("monday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - TUESDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("tuesday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - WEDNESDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("wednesday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - THURSDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("thursday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - FRIDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("friday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - SATURDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("saturday"); - public static final ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay - SUNDAY = - new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay("sunday"); - - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay(String value) { - super(value, allowedValues); - } - - public static - class ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDaySerializer - extends StdSerializer< - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay> { - public ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDaySerializer( - Class t) { - super(t); - } - - public ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDaySerializer() { - this(null); - } - - @Override - public void serialize( - ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay fromValue( - String value) { - return new ScheduleUpdateRequestDataAttributesLayersItemsRestrictionsItemsStartDay(value); - } -}