Commit 2afba05a authored by Kostis Trantzas's avatar Kostis Trantzas
Browse files

Merge branch 'tmf-674-feature' into 'develop'

Tmf 674 feature

See merge request !8
parents f7c7cb8e bc173ac0
Loading
Loading
Loading
Loading
Loading
+112 −0
Original line number Diff line number Diff line
package org.etsi.osl.tmf.gsm674.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;


/**
 * Base schema for adressable entities
 */

@Schema(name = "Addressable", description = "Base schema for adressable entities")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-04-24T14:24:54.867613034Z[Etc/UTC]", comments = "Generator version: 7.6.0-SNAPSHOT")
public class Addressable {

  @JsonProperty("href")
  private String href;

  @JsonProperty("id")
  private String id;

  public Addressable() {
    super();
  }

  /**
   * Constructor with only required parameters
   */
  public Addressable(String href, String id) {
    this.href = href;
    this.id = id;
  }

  public Addressable href(String href) {
    this.href = href;
    return this;
  }

  /**
   * Hyperlink reference
   * @return href
  */
  @NotNull
  @Schema(name = "href", description = "Hyperlink reference", requiredMode = Schema.RequiredMode.REQUIRED)
  public String getHref() {
    return href;
  }

  public void setHref(String href) {
    this.href = href;
  }

  public Addressable id(String id) {
    this.id = id;
    return this;
  }

  /**
   * unique identifier
   * @return id
  */
  @NotNull 
  @Schema(name = "id", description = "unique identifier", requiredMode = Schema.RequiredMode.REQUIRED)
  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Addressable addressable = (Addressable) o;
    return Objects.equals(this.href, addressable.href) &&
        Objects.equals(this.id, addressable.id);
  }

  @Override
  public int hashCode() {
    return Objects.hash(href, id);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Addressable {\n");
    sb.append("    href: ").append(toIndentedString(href)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).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    ");
  }
}
+337 −0
Original line number Diff line number Diff line
package org.etsi.osl.tmf.gsm674.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import java.time.OffsetDateTime;

import jakarta.validation.Valid;
import org.springframework.format.annotation.DateTimeFormat;

import io.swagger.v3.oas.annotations.media.Schema;


/**
 * BaseEvent
 */

@JsonIgnoreProperties(
  value = "@type", // ignore manually set @type, it will be automatically generated by Jackson during serialization
  allowSetters = true // allows the @type to be set during deserialization
)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type", visible = true)
@JsonSubTypes({
  @JsonSubTypes.Type(value = BaseEvent.class, name = "BaseEvent"),
  @JsonSubTypes.Type(value = GeographicSiteAttributeValueChangeEvent.class, name = "GeographicSiteAttributeValueChangeEvent"),
  @JsonSubTypes.Type(value = GeographicSiteCreateEvent.class, name = "GeographicSiteCreateEvent"),
  @JsonSubTypes.Type(value = GeographicSiteDeleteEvent.class, name = "GeographicSiteDeleteEvent"),
  @JsonSubTypes.Type(value = GeographicSiteStateChangeEvent.class, name = "GeographicSiteStateChangeEvent")
})

@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-04-24T14:24:54.867613034Z[Etc/UTC]", comments = "Generator version: 7.6.0-SNAPSHOT")
public class BaseEvent extends Entity {

  @JsonProperty("event")
  private Object event;
  @JsonProperty("eventId")
  private String eventId;

  @JsonProperty("eventTime")
  @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
  private OffsetDateTime eventTime;
  @JsonProperty("eventType")
  private String eventType;

  @JsonProperty("correlationId")
  private String correlationId;
  @JsonProperty("domain")
  private String domain;

  @JsonProperty("title")
  private String title;
  @JsonProperty("description")
  private String description;
  @JsonProperty("priority")
  private String priority;
  @JsonProperty("timeOcurred")
  @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
  private OffsetDateTime timeOcurred;

  public BaseEvent() {
    super();
  }

  /**
   * Constructor with only required parameters
   */
  public BaseEvent(String href, String id, String atType) {
    super(href, id, atType);
  }

  public BaseEvent event(Object event) {
    this.event = event;
    return this;
  }

  /**
   * Get event
   * @return event
  */
  
  @Schema(name = "event", requiredMode = Schema.RequiredMode.NOT_REQUIRED)

  public Object getEvent() {
    return event;
  }

  public void setEvent(Object event) {
    this.event = event;
  }

  public BaseEvent eventId(String eventId) {
    this.eventId = eventId;
    return this;
  }

  /**
   * The identifier of the notification.
   * @return eventId
  */
  
  @Schema(name = "eventId", description = "The identifier of the notification.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  public String getEventId() {
    return eventId;
  }

  public void setEventId(String eventId) {
    this.eventId = eventId;
  }

  public BaseEvent eventTime(OffsetDateTime eventTime) {
    this.eventTime = eventTime;
    return this;
  }

  /**
   * Time of the event occurrence.
   * @return eventTime
  */
  @Valid 
  @Schema(name = "eventTime", description = "Time of the event occurrence.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)

  public OffsetDateTime getEventTime() {
    return eventTime;
  }

  public void setEventTime(OffsetDateTime eventTime) {
    this.eventTime = eventTime;
  }

  public BaseEvent eventType(String eventType) {
    this.eventType = eventType;
    return this;
  }

  /**
   * The type of the notification.
   * @return eventType
  */
  
  @Schema(name = "eventType", description = "The type of the notification.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  public String getEventType() {
    return eventType;
  }

  public void setEventType(String eventType) {
    this.eventType = eventType;
  }

  public BaseEvent correlationId(String correlationId) {
    this.correlationId = correlationId;
    return this;
  }

  /**
   * The correlation id for this event.
   * @return correlationId
  */
  
  @Schema(name = "correlationId", description = "The correlation id for this event.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  public String getCorrelationId() {
    return correlationId;
  }

  public void setCorrelationId(String correlationId) {
    this.correlationId = correlationId;
  }

  public BaseEvent domain(String domain) {
    this.domain = domain;
    return this;
  }

  /**
   * The domain of the event.
   * @return domain
  */
  
  @Schema(name = "domain", description = "The domain of the event.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  public String getDomain() {
    return domain;
  }

  public void setDomain(String domain) {
    this.domain = domain;
  }

  public BaseEvent title(String title) {
    this.title = title;
    return this;
  }

  /**
   * The title of the event.
   * @return title
  */
  
  @Schema(name = "title", description = "The title of the event.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public BaseEvent description(String description) {
    this.description = description;
    return this;
  }

  /**
   * An explanatory of the event.
   * @return description
  */
  
  @Schema(name = "description", description = "An explanatory of the event.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public BaseEvent priority(String priority) {
    this.priority = priority;
    return this;
  }

  /**
   * A priority.
   * @return priority
  */
  
  @Schema(name = "priority", description = "A priority.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)

  public String getPriority() {
    return priority;
  }

  public void setPriority(String priority) {
    this.priority = priority;
  }

  public BaseEvent timeOcurred(OffsetDateTime timeOcurred) {
    this.timeOcurred = timeOcurred;
    return this;
  }

  /**
   * The time the event occured.
   * @return timeOcurred
  */
  @Valid
  @Schema(name = "timeOcurred", description = "The time the event occured.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)

  public OffsetDateTime getTimeOcurred() {
    return timeOcurred;
  }

  public void setTimeOcurred(OffsetDateTime timeOcurred) {
    this.timeOcurred = timeOcurred;
  }


  public BaseEvent href(String href) {
    super.href(href);
    return this;
  }

  public BaseEvent id(String id) {
    super.id(id);
    return this;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    BaseEvent baseEvent = (BaseEvent) o;
    return Objects.equals(this.event, baseEvent.event) &&
        Objects.equals(this.eventId, baseEvent.eventId) &&
        Objects.equals(this.eventTime, baseEvent.eventTime) &&
        Objects.equals(this.eventType, baseEvent.eventType) &&
        Objects.equals(this.correlationId, baseEvent.correlationId) &&
        Objects.equals(this.domain, baseEvent.domain) &&
        Objects.equals(this.title, baseEvent.title) &&
        Objects.equals(this.description, baseEvent.description) &&
        Objects.equals(this.priority, baseEvent.priority) &&
        Objects.equals(this.timeOcurred, baseEvent.timeOcurred) &&
        super.equals(o);
  }

  @Override
  public int hashCode() {
    return Objects.hash(event, eventId, eventTime, eventType, correlationId, domain, title, description, priority, timeOcurred, super.hashCode());
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class BaseEvent {\n");
    sb.append("    ").append(toIndentedString(super.toString())).append("\n");
    sb.append("    event: ").append(toIndentedString(event)).append("\n");
    sb.append("    eventId: ").append(toIndentedString(eventId)).append("\n");
    sb.append("    eventTime: ").append(toIndentedString(eventTime)).append("\n");
    sb.append("    eventType: ").append(toIndentedString(eventType)).append("\n");
    sb.append("    correlationId: ").append(toIndentedString(correlationId)).append("\n");
    sb.append("    domain: ").append(toIndentedString(domain)).append("\n");
    sb.append("    title: ").append(toIndentedString(title)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    priority: ").append(toIndentedString(priority)).append("\n");
    sb.append("    timeOcurred: ").append(toIndentedString(timeOcurred)).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    ");
  }
}
+202 −0
Original line number Diff line number Diff line
package org.etsi.osl.tmf.gsm674.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Entity;
import jakarta.persistence.OneToMany;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import org.etsi.osl.tmf.common.model.BaseRootEntity;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

@Entity(name="CalendarPeriod")
public class CalendarPeriod extends BaseRootEntity {
    @JsonProperty("day")
    private String day;
    @JsonProperty("status")
    private String status;
    @JsonProperty("timeZone")
    private String timeZone;
    @JsonProperty("id")
    private String id;
    @Valid
    @JsonProperty("hourPeriod")
    @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH })
    List<HourPeriod> hourPeriod  = new ArrayList<>();

    public CalendarPeriod() {
        super();
    }

    /**
     * Constructor with only required parameters
     */
    public CalendarPeriod(String status) {
        this.status = status;
    }

    public CalendarPeriod id(String id) {
        this.id = id;
        return this;
    }

    /**
     * unique identifier of the calendar period
     * @return id
     */

    @Schema(name = "id", description = "unique identifier of the calendar period", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonProperty("id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public CalendarPeriod day(String day) {
        this.day = day;
        return this;
    }

    /**
     * Day where the calendar status applies (e.g.: monday, mon-to-fri, weekdays, weekend, all week, ...)
     * @return day
     */

    @Schema(name = "day", description = "Day where the calendar status applies (e.g.: monday, mon-to-fri, weekdays, weekend, all week, ...)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonProperty("day")
    public String getDay() {
        return day;
    }

    public void setDay(String day) {
        this.day = day;
    }

    public CalendarPeriod timeZone(String timeZone) {
        this.timeZone = timeZone;
        return this;
    }

    /**
     * Indication of the timezone applicable to the calendar information (e.g.: Paris, GMT+1)
     * @return timeZone
     */

    @Schema(name = "timeZone", description = "Indication of the timezone applicable to the calendar information (e.g.: Paris, GMT+1)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonProperty("timeZone")
    public String getTimeZone() {
        return timeZone;
    }

    public void setTimeZone(String timeZone) {
        this.timeZone = timeZone;
    }

    public CalendarPeriod hourPeriod(List<HourPeriod> hourPeriod) {
        this.hourPeriod = hourPeriod;
        return this;
    }

    public CalendarPeriod addHourPeriodItem(HourPeriod hourPeriodItem) {
        if (this.hourPeriod == null) {
            this.hourPeriod = new ArrayList<>();
        }
        this.hourPeriod.add(hourPeriodItem);
        return this;
    }

    /**
     * Get hourPeriod
     * @return hourPeriod
     */
    @Valid
    @Schema(name = "hourPeriod", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonProperty("hourPeriod")
    public List<HourPeriod> getHourPeriod() {
        return hourPeriod;
    }

    public void setHourPeriod(List<HourPeriod> hourPeriod) {
        this.hourPeriod = hourPeriod;
    }

    public CalendarPeriod status(String status) {
        this.status = status;
        return this;
    }

    /**
     * Indication of the availability of the caledar period (e.g.: available, booked, etc.)
     * @return status
     */
    @NotNull
    @Schema(name = "status", description = "Indication of the availability of the caledar period (e.g.: available, booked, etc.)", requiredMode = Schema.RequiredMode.REQUIRED)
    @JsonProperty("status")
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CalendarPeriod calendarPeriod = (CalendarPeriod) o;
        return Objects.equals(this.schemaLocation, calendarPeriod.schemaLocation) &&
                Objects.equals(this.baseType, calendarPeriod.baseType) &&
                Objects.equals(this.type, calendarPeriod.type) &&
                Objects.equals(this.href, calendarPeriod.href) &&
                Objects.equals(this.id, calendarPeriod.id) &&
                Objects.equals(this.day, calendarPeriod.day) &&
                Objects.equals(this.timeZone, calendarPeriod.timeZone) &&
                Objects.equals(this.hourPeriod, calendarPeriod.hourPeriod) &&
                Objects.equals(this.status, calendarPeriod.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(schemaLocation, baseType, type, href, id, day, timeZone, hourPeriod, status);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class CalendarPeriod {\n");
        sb.append("    atSchemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
        sb.append("    atBaseType: ").append(toIndentedString(baseType)).append("\n");
        sb.append("    atType: ").append(toIndentedString(type)).append("\n");
        sb.append("    href: ").append(toIndentedString(href)).append("\n");
        sb.append("    id: ").append(toIndentedString(id)).append("\n");
        sb.append("    day: ").append(toIndentedString(day)).append("\n");
        sb.append("    timeZone: ").append(toIndentedString(timeZone)).append("\n");
        sb.append("    hourPeriod: ").append(toIndentedString(hourPeriod)).append("\n");
        sb.append("    status: ").append(toIndentedString(status)).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    ");
    }
}
+197 −0
Original line number Diff line number Diff line
package org.etsi.osl.tmf.gsm674.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import org.etsi.osl.tmf.common.model.BaseRootEntity;

/**
 * Entity
 */

@JsonIgnoreProperties(
  value = "@type", // ignore manually set @type, it will be automatically generated by Jackson during serialization
  allowSetters = true // allows the @type to be set during deserialization
)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type", visible = true)
@JsonSubTypes({
  @JsonSubTypes.Type(value = Entity.class, name = "Entity"),
  @JsonSubTypes.Type(value = BaseEvent.class, name = "BaseEvent"),
  @JsonSubTypes.Type(value = GeographicSite.class, name = "GeographicSite"),
  @JsonSubTypes.Type(value = GeographicSiteAttributeValueChangeEvent.class, name = "GeographicSiteAttributeValueChangeEvent"),
  @JsonSubTypes.Type(value = GeographicSiteCreateEvent.class, name = "GeographicSiteCreateEvent"),
  @JsonSubTypes.Type(value = GeographicSiteDeleteEvent.class, name = "GeographicSiteDeleteEvent"),
  @JsonSubTypes.Type(value = GeographicSiteStateChangeEvent.class, name = "GeographicSiteStateChangeEvent")
})

@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-04-24T14:24:54.867613034Z[Etc/UTC]", comments = "Generator version: 7.6.0-SNAPSHOT")
public class Entity {
  @JsonProperty("href")
  private String href;
  @JsonProperty("id")
  private String id;
  @JsonProperty("@type")
  private String atType;
  @JsonProperty("@baseType")
  private String atBaseType;
  @JsonProperty("@schemaLocation")
  private String atSchemaLocation;

  public Entity() {
    super();
  }

  /**
   * Constructor with only required parameters
   */
  public Entity(String href, String id, String atType) {
    this.href = href;
    this.id = id;
    this.atType = atType;
  }

  public Entity href(String href) {
    this.href = href;
    return this;
  }

  /**
   * Hyperlink reference
   * @return href
  */
  @NotNull
  @Schema(name = "href", description = "Hyperlink reference", requiredMode = Schema.RequiredMode.REQUIRED)
  public String getHref() {
    return href;
  }

  public void setHref(String href) {
    this.href = href;
  }

  public Entity id(String id) {
    this.id = id;
    return this;
  }

  /**
   * unique identifier
   * @return id
  */
  @NotNull 
  @Schema(name = "id", description = "unique identifier", requiredMode = Schema.RequiredMode.REQUIRED)
  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public Entity atType(String atType) {
    this.atType = atType;
    return this;
  }

  /**
   * When sub-classing, this defines the sub-class Extensible name
   * @return atType
  */
  @NotNull
  @Schema(name = "@type", description = "When sub-classing, this defines the sub-class Extensible name", requiredMode = Schema.RequiredMode.REQUIRED)
  public String getAtType() {
    return atType;
  }

  public void setAtType(String atType) {
    this.atType = atType;
  }

  public Entity atBaseType(String atBaseType) {
    this.atBaseType = atBaseType;
    return this;
  }

  /**
   * When sub-classing, this defines the super-class
   * @return atBaseType
  */

  @Schema(name = "@baseType", description = "When sub-classing, this defines the super-class", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  public String getAtBaseType() {
    return atBaseType;
  }

  public void setAtBaseType(String atBaseType) {
    this.atBaseType = atBaseType;
  }

  public Entity atSchemaLocation(String atSchemaLocation) {
    this.atSchemaLocation = atSchemaLocation;
    return this;
  }

  /**
   * A URI to a JSON-Schema file that defines additional attributes and relationships
   * @return atSchemaLocation
  */

  @Schema(name = "@schemaLocation", description = "A URI to a JSON-Schema file that defines additional attributes and relationships", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  public String getAtSchemaLocation() {
    return atSchemaLocation;
  }

  public void setAtSchemaLocation(String atSchemaLocation) {
    this.atSchemaLocation = atSchemaLocation;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Entity entity = (Entity) o;
    return Objects.equals(this.href, entity.href) &&
        Objects.equals(this.id, entity.id) &&
        Objects.equals(this.atType, entity.atType) &&
        Objects.equals(this.atBaseType, entity.atBaseType) &&
        Objects.equals(this.atSchemaLocation, entity.atSchemaLocation);
  }

  @Override
  public int hashCode() {
    return Objects.hash(href, id, atType, atBaseType, atSchemaLocation);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Entity {\n");
    sb.append("    href: ").append(toIndentedString(href)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    atType: ").append(toIndentedString(atType)).append("\n");
    sb.append("    atBaseType: ").append(toIndentedString(atBaseType)).append("\n");
    sb.append("    atSchemaLocation: ").append(toIndentedString(atSchemaLocation)).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    ");
  }
}
+74 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading