Commit 3c4d4a3d authored by Anastasios Poimenidis's avatar Anastasios Poimenidis
Browse files

feat: introduce ResourceDTO and ResourceResponse

parent c5f2ad90
Loading
Loading
Loading
Loading
+59
Changes for src/main/java/org/etsi/osl/hypo/api/tmf/common/model/AttachmentRefOrValue.java: 59 added lines, 0 removed lines.
Original line number Diff line number Diff line
package org.etsi.osl.hypo.api.tmf.common.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.etsi.osl.hypo.api.tmf.common.schema.ValidFor;
import org.etsi.osl.hypo.api.tmf.common.schema.validations.CheckDateFormat;

@Getter
@Setter
@EqualsAndHashCode
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
    "id",
    "name",
    "description",
    "href",
    "url",
    "attachmentType",
    "mimeType",
    "isRef",
    "content",
    "size",
    "validFor",
    "referredType"
})
public class AttachmentRefOrValue {
    private String name;
    private String id;

    @JsonProperty("@referredType")
    private String referredType;

    @JsonProperty("@baseType")
    private String baseType;

    @JsonProperty("@schemaLocation")
    private String schemaLocation;

    @JsonProperty("@type")
    private String type;

    private String description;
    private String href;
    private String url;
    private String attachmentType;
    private String mimeType;
    private Boolean isRef;
    private String content;
    private String size;

    @CheckDateFormat(message = "startDateTime must be before endDateTime")
    private ValidFor validFor;
}
+33
Changes for src/main/java/org/etsi/osl/hypo/api/tmf/common/model/Characteristic.java: 33 added lines, 0 removed lines.
Original line number Diff line number Diff line
package org.etsi.osl.hypo.api.tmf.common.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.etsi.osl.hypo.api.tmf.common.schema.ValueEntity;

@Getter
@Setter
@EqualsAndHashCode
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"id", "name", "value", "valueType"})
public class Characteristic {
    private String id;
    private String name;

    @JsonProperty("@baseType")
    private String baseType;

    @JsonProperty("@schemaLocation")
    private String schemaLocation;

    @JsonProperty("@type")
    private String type;

    private ValueEntity value;
    private String valueType;
}
+36
Changes for src/main/java/org/etsi/osl/hypo/api/tmf/common/model/RelatedPlaceRefOrValue.java: 36 added lines, 0 removed lines.
Original line number Diff line number Diff line
package org.etsi.osl.hypo.api.tmf.common.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@EqualsAndHashCode
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"id", "name", "href", "role", "referredType"})
public class RelatedPlaceRefOrValue {
    private String id;
    private String name;

    @JsonProperty("@referredType")
    private String referredType;

    private String href;

    @JsonProperty("@baseType")
    private String baseType;

    @JsonProperty("@schemaLocation")
    private String schemaLocation;

    @JsonProperty("@type")
    private String type;

    private String role;
}
+79
Changes for src/main/java/org/etsi/osl/hypo/api/tmf/common/model/ResourceRefOrValue.java: 79 added lines, 0 removed lines.
Original line number Diff line number Diff line
package org.etsi.osl.hypo.api.tmf.common.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import jakarta.persistence.Column;
import java.time.OffsetDateTime;
import java.util.Set;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.etsi.osl.hypo.api.tmf.services.order.schema.deserializers.OffsetDateTimeCustomDeserializer;
import org.etsi.osl.hypo.api.tmf.services.order.schema.serializers.OffsetDateTimeCustomSerializer;

@Getter
@Setter
@EqualsAndHashCode
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
    "id",
    "name",
    "description",
    "href",
    "category",
    "endOperatingDate",
    "resourceVersion",
    "startOperatingDate",
    "administrativeState",
    "operationalState",
    "resourceStatus",
    "usageState",
    "note",
    "activationFeature",
    "attachment",
    "place",
    "relatedParty",
    "resourceCharacteristic",
    "resourceSpecification"
})
public class ResourceRefOrValue {
    private String id;

    @JsonProperty("@referredType")
    private String referredType;

    @Column(name = "href", updatable = false)
    private String href;

    @JsonProperty("@baseType")
    @Column(name = "baseType", updatable = false)
    private String baseType;

    @JsonProperty("@schemaLocation")
    private String schemaLocation;

    @JsonProperty("@type")
    @Column(name = "type", updatable = false)
    private String type;

    private String name;
    private String category;
    private String description;

    @JsonDeserialize(using = OffsetDateTimeCustomDeserializer.class)
    @JsonSerialize(using = OffsetDateTimeCustomSerializer.class)
    private OffsetDateTime endOperatingDate;

    private String resourceVersion;

    @JsonDeserialize(using = OffsetDateTimeCustomDeserializer.class)
    @JsonSerialize(using = OffsetDateTimeCustomSerializer.class)
    private OffsetDateTime startOperatingDate;

    private Set<Feature> activationFeature;
}
+31
Changes for src/main/java/org/etsi/osl/hypo/api/tmf/common/model/ResourceRelationship.java: 31 added lines, 0 removed lines.
Original line number Diff line number Diff line
package org.etsi.osl.hypo.api.tmf.common.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@EqualsAndHashCode
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"id", "relationshipType", "resource"})
public class ResourceRelationship {
    private String id;

    @JsonProperty("@baseType")
    private String baseType;

    @JsonProperty("@schemaLocation")
    private String schemaLocation;

    @JsonProperty("@type")
    private String type;

    private String relationshipType;
    private ResourceRefOrValue resource;
}
Loading