diff --git a/README.md b/README.md index c89970778f4675c76df99f80248db352493b3a4e..53bcdba495e00ccc2ebadfa8453f574763e04eb4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # org.etsi.osl.model.tmf - - ## Getting started To make it easy for you to get started with GitLab, here's a list of recommended next steps. @@ -44,6 +42,7 @@ Use the built-in continuous integration in GitLab. *** + # Editing this README When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. diff --git a/pom.xml b/pom.xml index 0ca636c8e85b8635233762bd71f256cad3257bcd..3f39a7a5c70a4b09d7051a18c8390507eae40916 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,7 @@ ../org.etsi.osl.main + org.etsi.osl.model.tmf ${org.etsi.osl.model.tmf.version} @@ -18,6 +19,7 @@ ${springdoc-version} 1.5.3.Final + diff --git a/src/main/java/org/etsi/osl/tmf/am651/model/Agreement.java b/src/main/java/org/etsi/osl/tmf/am651/model/Agreement.java index 9dd3e97092120a576b480efaa8957f9c4a42f9d2..113259c06b764c6cc3e1083ca718d826e01e2987 100644 --- a/src/main/java/org/etsi/osl/tmf/am651/model/Agreement.java +++ b/src/main/java/org/etsi/osl/tmf/am651/model/Agreement.java @@ -26,6 +26,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import org.etsi.osl.tmf.common.model.TimePeriod; +import org.etsi.osl.tmf.common.model.service.Characteristic; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/am651/model/AgreementCreate.java b/src/main/java/org/etsi/osl/tmf/am651/model/AgreementCreate.java index 841688a9cf84e16e3c7756af5644b1dfbfe28c3c..02f5906d63b5dda4c31c6fc826bf320766ebd146 100644 --- a/src/main/java/org/etsi/osl/tmf/am651/model/AgreementCreate.java +++ b/src/main/java/org/etsi/osl/tmf/am651/model/AgreementCreate.java @@ -26,6 +26,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import org.etsi.osl.tmf.common.model.TimePeriod; +import org.etsi.osl.tmf.common.model.service.Characteristic; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/am651/model/AgreementItem.java b/src/main/java/org/etsi/osl/tmf/am651/model/AgreementItem.java index a07440a16ef1a71e1628f7fc55ad6674544411e9..17a37426d8c3180b245ec3a201c9bb952244be86 100644 --- a/src/main/java/org/etsi/osl/tmf/am651/model/AgreementItem.java +++ b/src/main/java/org/etsi/osl/tmf/am651/model/AgreementItem.java @@ -24,7 +24,7 @@ import java.util.List; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/src/main/java/org/etsi/osl/tmf/am651/model/AgreementUpdate.java b/src/main/java/org/etsi/osl/tmf/am651/model/AgreementUpdate.java index b98ce9b6f5106c869a2bf53c4ecd93fdb5a0f813..c3a349813d041a6a425896a9d7ba3a9b20496286 100644 --- a/src/main/java/org/etsi/osl/tmf/am651/model/AgreementUpdate.java +++ b/src/main/java/org/etsi/osl/tmf/am651/model/AgreementUpdate.java @@ -26,6 +26,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import org.etsi.osl.tmf.common.model.TimePeriod; +import org.etsi.osl.tmf.common.model.service.Characteristic; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/am651/model/Characteristic.java b/src/main/java/org/etsi/osl/tmf/am651/model/Characteristic.java deleted file mode 100644 index b00b36d00f59c54925af803122ee4bf98a09f6ff..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/am651/model/Characteristic.java +++ /dev/null @@ -1,175 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.am651.model; - -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.springframework.validation.annotation.Validated; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * Describes a given characteristic of an object or entity through a name/value pair. - */ -@Schema(description = "Describes a given characteristic of an object or entity through a name/value pair.") -@Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-19T23:51:58.660+03:00") - -public class Characteristic { - @JsonProperty("name") - private String name = null; - - @JsonProperty("value") - private String value = null; - - @JsonProperty("@type") - private String type = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - public Characteristic name(String name) { - this.name = name; - return this; - } - - /** - * Name of the characteristic - * @return name - **/ - @Schema(description = "Name of the characteristic") - - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Characteristic value(String value) { - this.value = value; - return this; - } - - /** - * Value of the characteristic - * @return value - **/ - @Schema(description = "Value of the characteristic") - - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public Characteristic type(String type) { - this.type = type; - return this; - } - - /** - * The class type of the actual resource (for type extension). - * @return type - **/ - @Schema(description = "The class type of the actual resource (for type extension).") - - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Characteristic schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A link to the schema describing a resource (for type extension). - * @return schemaLocation - **/ - @Schema(description = "A link to the schema describing a resource (for type extension).") - - - public String getSchemaLocation() { - return schemaLocation; - } - - public void setSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Characteristic characteristic = (Characteristic) o; - return Objects.equals(this.name, characteristic.name) && - Objects.equals(this.value, characteristic.value) && - Objects.equals(this.type, characteristic.type) && - Objects.equals(this.schemaLocation, characteristic.schemaLocation); - } - - @Override - public int hashCode() { - return Objects.hash(name, value, type, schemaLocation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Characteristic {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/src/main/java/org/etsi/osl/tmf/am651/model/ProductOfferingRef.java b/src/main/java/org/etsi/osl/tmf/am651/model/ProductOfferingRef.java deleted file mode 100644 index 07b20c4d6cf69676c23c1c73aefcbaccb6f11d62..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/am651/model/ProductOfferingRef.java +++ /dev/null @@ -1,175 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.am651.model; - -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.springframework.validation.annotation.Validated; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * ProductOffering reference. A product offering represents entities that are orderable from the provider of the catalog, this resource includes pricing information. - */ -@Schema(description = "ProductOffering reference. A product offering represents entities that are orderable from the provider of the catalog, this resource includes pricing information.") -@Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-19T23:51:58.660+03:00") - -public class ProductOfferingRef { - @JsonProperty("href") - private String href = null; - - @JsonProperty("id") - private String id = null; - - @JsonProperty("name") - private String name = null; - - @JsonProperty("@referredType") - private String referredType = null; - - public ProductOfferingRef href(String href) { - this.href = href; - return this; - } - - /** - * Reference of the product offering - * @return href - **/ - @Schema(description = "Reference of the product offering") - - - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - public ProductOfferingRef id(String id) { - this.id = id; - return this; - } - - /** - * Unique identifier of the product offering - * @return id - **/ - @Schema(description = "Unique identifier of the product offering") - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ProductOfferingRef name(String name) { - this.name = name; - return this; - } - - /** - * Name of the product offering - * @return name - **/ - @Schema(description = "Name of the product offering") - - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public ProductOfferingRef referredType(String referredType) { - this.referredType = referredType; - return this; - } - - /** - * The actual type of the target instance when needed for disambiguation. - * @return referredType - **/ - @Schema(description = "The actual type of the target instance when needed for disambiguation.") - - - public String getReferredType() { - return referredType; - } - - public void setReferredType(String referredType) { - this.referredType = referredType; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProductOfferingRef productOfferingRef = (ProductOfferingRef) o; - return Objects.equals(this.href, productOfferingRef.href) && - Objects.equals(this.id, productOfferingRef.id) && - Objects.equals(this.name, productOfferingRef.name) && - Objects.equals(this.referredType, productOfferingRef.referredType); - } - - @Override - public int hashCode() { - return Objects.hash(href, id, name, referredType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProductOfferingRef {\n"); - - sb.append(" href: ").append(toIndentedString(href)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" referredType: ").append(toIndentedString(referredType)).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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductOffering.java b/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductOffering.java index 1efa62fc6e8035777bc63d69cdf43c779505608e..8abd61749c0450f44b8887d167c6b48a24ab4766 100644 --- a/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductOffering.java +++ b/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductOffering.java @@ -111,22 +111,22 @@ public class ProductOffering extends BaseEntity { private Set productOfferingTerm = new HashSet<>(); @JsonProperty("productSpecification") - @OneToOne( cascade = {CascadeType.MERGE, CascadeType.DETACH} ) + @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) @JoinColumn(referencedColumnName = "uuid") private ProductSpecificationRef productSpecification = null; @JsonProperty("resourceCandidate") - @OneToOne( cascade = {CascadeType.MERGE, CascadeType.DETACH} ) + @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) @JoinColumn(referencedColumnName = "uuid") private ResourceCandidateRef resourceCandidate = null; @JsonProperty("serviceCandidate") - @OneToOne( cascade = {CascadeType.MERGE, CascadeType.DETACH} ) + @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) @JoinColumn(referencedColumnName = "uuid") private ServiceCandidateRef serviceCandidate = null; @JsonProperty("serviceLevelAgreement") - @OneToOne( cascade = {CascadeType.MERGE, CascadeType.DETACH} ) + @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) @JoinColumn(referencedColumnName = "uuid") private SLARef serviceLevelAgreement = null; @@ -734,5 +734,14 @@ public class ProductOffering extends BaseEntity { return o.toString().replace("\n", "\n "); } + public Object findCharacteristicByName(String aname) { + for (ProductSpecificationCharacteristicValueUse ssci : this.prodSpecCharValueUse ) { + if (ssci.getName()!=null && ssci.getName().equals(aname)) { + return ssci; + } + } + return null; + } + } diff --git a/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductOfferingRef.java b/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductOfferingRef.java index dd47df1336aa92cf9a7754785c0a7872e7706f21..616d8c31c7e284da215529090555918c9b528982 100644 --- a/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductOfferingRef.java +++ b/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductOfferingRef.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -35,6 +36,7 @@ import jakarta.validation.constraints.NotNull; @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-19T00:15:57.249+03:00") @JsonIgnoreProperties( {"uuid"} ) +@Entity(name = "ProdOffref620") public class ProductOfferingRef extends BaseRootNamedEntity { diff --git a/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductSpecification.java b/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductSpecification.java index 3e0944658e7bd296b23d4b802a440dc86cdb3f44..9260c44ac2ef7e2cf3e8e5849a4327bbed49ceab 100644 --- a/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductSpecification.java +++ b/src/main/java/org/etsi/osl/tmf/pcm620/model/ProductSpecification.java @@ -29,6 +29,7 @@ import org.etsi.osl.tmf.common.model.BaseEntity; import org.etsi.osl.tmf.common.model.service.ServiceSpecificationRef; import org.etsi.osl.tmf.prm669.model.RelatedParty; import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationRef; +import org.etsi.osl.tmf.scm633.model.ServiceSpecCharacteristic; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.persistence.CascadeType; @@ -521,4 +522,13 @@ public class ProductSpecification extends BaseEntity { } return o.toString().replace("\n", "\n "); } + + public ProductSpecificationCharacteristic findProdCharacteristicByName(String an) { + for (ProductSpecificationCharacteristic ssci : this.getProductSpecCharacteristic()) { + if (ssci.getName()!=null && ssci.getName().equals(an)) { + return ssci; + } + } + return null; + } } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/BillingAccountRef.java b/src/main/java/org/etsi/osl/tmf/pim637/model/BillingAccountRef.java similarity index 94% rename from src/main/java/org/etsi/osl/tmf/po622/model/BillingAccountRef.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/BillingAccountRef.java index 5dd0323895b435b2590568adc6f58f171b212a1d..0a30fb73c42490c5181986f3d0d1065d39dec6a1 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/BillingAccountRef.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/BillingAccountRef.java @@ -17,15 +17,14 @@ * limitations under the License. * =========================LICENSE_END================================== */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -34,24 +33,12 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "BillingAccount reference. A BillingAccount is a detailed description of a bill structure.") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class BillingAccountRef { - @JsonProperty("id") - private String id = null; - @JsonProperty("href") - private String href = null; - @JsonProperty("name") - private String name = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; +@Entity(name = "BillingAccRef622") +public class BillingAccountRef extends BaseRootNamedEntity { + @JsonProperty("id") + private String id = null; @JsonProperty("@referredType") private String _atReferredType = null; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/EntityRef.java b/src/main/java/org/etsi/osl/tmf/pim637/model/EntityRef.java similarity index 64% rename from src/main/java/org/etsi/osl/tmf/po622/model/EntityRef.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/EntityRef.java index 97784a5b973ec5087a7b4fcf740e23cc2e9af79d..600dbe9af461bc4c3d5379dfe2960c5369f7a0c4 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/EntityRef.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/EntityRef.java @@ -1,30 +1,8 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; @@ -33,7 +11,9 @@ import jakarta.validation.constraints.NotNull; */ @Schema(description = "Entity reference schema to be use for all entityRef class.") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + public class EntityRef { @JsonProperty("id") private String id = null; @@ -45,13 +25,13 @@ public class EntityRef { private String name = null; @JsonProperty("@baseType") - private String baseType = null; + private String _atBaseType = null; @JsonProperty("@schemaLocation") - private String schemaLocation = null; + private String _atSchemaLocation = null; @JsonProperty("@type") - private String type = null; + private String _atType = null; @JsonProperty("@referredType") private String _atReferredType = null; @@ -64,8 +44,8 @@ public class EntityRef { /** * Unique identifier of a related entity. * @return id - **/ - @Schema(description = "Unique identifier of a related entity.") + **/ + @Schema(required = true, description = "Unique identifier of a related entity.") @NotNull public String getId() { @@ -84,9 +64,10 @@ public class EntityRef { /** * Reference of the related entity. * @return href - **/ + **/ @Schema(description = "Reference of the related entity.") - + @NotNull + public String getHref() { return href; } @@ -103,9 +84,10 @@ public class EntityRef { /** * Name of the related entity. * @return name - **/ + **/ @Schema(description = "Name of the related entity.") - + @NotNull + public String getName() { return name; } @@ -114,61 +96,64 @@ public class EntityRef { this.name = name; } - public EntityRef baseType(String baseType) { - this.baseType = baseType; + public EntityRef _atBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; return this; } /** * When sub-classing, this defines the super-class - * @return baseType - **/ + * @return _atBaseType + **/ @Schema(description = "When sub-classing, this defines the super-class") - + @NotNull + public String getAtBaseType() { - return baseType; + return _atBaseType; } - public void setAtBaseType(String baseType) { - this.baseType = baseType; + public void setAtBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; } - public EntityRef schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; + public EntityRef _atSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; return this; } /** * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ + * @return _atSchemaLocation + **/ @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - + @NotNull + public String getAtSchemaLocation() { - return schemaLocation; + return _atSchemaLocation; } - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; + public void setAtSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; } - public EntityRef type(String type) { - this.type = type; + public EntityRef _atType(String _atType) { + this._atType = _atType; return this; } /** * When sub-classing, this defines the sub-class entity name - * @return type - **/ + * @return _atType + **/ @Schema(description = "When sub-classing, this defines the sub-class entity name") - + @NotNull + public String getAtType() { - return type; + return _atType; } - public void setAtType(String type) { - this.type = type; + public void setAtType(String _atType) { + this._atType = _atType; } public EntityRef _atReferredType(String _atReferredType) { @@ -179,9 +164,10 @@ public class EntityRef { /** * The actual type of the target instance when needed for disambiguation. * @return _atReferredType - **/ + **/ @Schema(description = "The actual type of the target instance when needed for disambiguation.") - + @NotNull + public String getAtReferredType() { return _atReferredType; } @@ -203,15 +189,15 @@ public class EntityRef { return Objects.equals(this.id, entityRef.id) && Objects.equals(this.href, entityRef.href) && Objects.equals(this.name, entityRef.name) && - Objects.equals(this.baseType, entityRef.baseType) && - Objects.equals(this.schemaLocation, entityRef.schemaLocation) && - Objects.equals(this.type, entityRef.type) && + Objects.equals(this._atBaseType, entityRef._atBaseType) && + Objects.equals(this._atSchemaLocation, entityRef._atSchemaLocation) && + Objects.equals(this._atType, entityRef._atType) && Objects.equals(this._atReferredType, entityRef._atReferredType); } @Override public int hashCode() { - return Objects.hash(id, href, name, baseType, schemaLocation, type, _atReferredType); + return Objects.hash(id, href, name, _atBaseType, _atSchemaLocation, _atType, _atReferredType); } @Override @@ -222,9 +208,9 @@ public class EntityRef { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" href: ").append(toIndentedString(href)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(_atBaseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(_atSchemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(_atType)).append("\n"); sb.append(" _atReferredType: ").append(toIndentedString(_atReferredType)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/Error.java b/src/main/java/org/etsi/osl/tmf/pim637/model/Error.java new file mode 100644 index 0000000000000000000000000000000000000000..e13ea9a4bec6ec5f7dc740f16212dfa2b1134ece --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/Error.java @@ -0,0 +1,254 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +/** + * Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx) + */ +@Schema(description = "Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class Error { + @JsonProperty("code") + private String code = null; + + @JsonProperty("reason") + private String reason = null; + + @JsonProperty("message") + private String message = null; + + @JsonProperty("status") + private String status = null; + + @JsonProperty("referenceError") + private String referenceError = null; + + @JsonProperty("@baseType") + private String _atBaseType = null; + + @JsonProperty("@schemaLocation") + private String _atSchemaLocation = null; + + @JsonProperty("@type") + private String _atType = null; + + public Error code(String code) { + this.code = code; + return this; + } + + /** + * Application relevant detail, defined in the API or a common list. + * @return code + **/ + @Schema(required = true, description = "Application relevant detail, defined in the API or a common list.") + @NotNull + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Error reason(String reason) { + this.reason = reason; + return this; + } + + /** + * Explanation of the reason for the error which can be shown to a client user. + * @return reason + **/ + @Schema(required = true, description = "Explanation of the reason for the error which can be shown to a client user.") + @NotNull + + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public Error message(String message) { + this.message = message; + return this; + } + + /** + * More details and corrective actions related to the error which can be shown to a client user. + * @return message + **/ + @Schema(description = "More details and corrective actions related to the error which can be shown to a client user.") + @NotNull + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public Error status(String status) { + this.status = status; + return this; + } + + /** + * HTTP Error code extension + * @return status + **/ + @Schema(description = "HTTP Error code extension") + @NotNull + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Error referenceError(String referenceError) { + this.referenceError = referenceError; + return this; + } + + /** + * URI of documentation describing the error. + * @return referenceError + **/ + @Schema(description = "URI of documentation describing the error.") + @NotNull + + public String getReferenceError() { + return referenceError; + } + + public void setReferenceError(String referenceError) { + this.referenceError = referenceError; + } + + public Error _atBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; + return this; + } + + /** + * When sub-classing, this defines the super-class. + * @return _atBaseType + **/ + @Schema(description = "When sub-classing, this defines the super-class.") + @NotNull + + public String getAtBaseType() { + return _atBaseType; + } + + public void setAtBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; + } + + public Error _atSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; + return this; + } + + /** + * A URI to a JSON-Schema file that defines additional attributes and relationships + * @return _atSchemaLocation + **/ + @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") + @NotNull + + public String getAtSchemaLocation() { + return _atSchemaLocation; + } + + public void setAtSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; + } + + public Error _atType(String _atType) { + this._atType = _atType; + return this; + } + + /** + * When sub-classing, this defines the sub-class entity name. + * @return _atType + **/ + @Schema(description = "When sub-classing, this defines the sub-class entity name.") + @NotNull + + public String getAtType() { + return _atType; + } + + public void setAtType(String _atType) { + this._atType = _atType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Error error = (Error) o; + return Objects.equals(this.code, error.code) && + Objects.equals(this.reason, error.reason) && + Objects.equals(this.message, error.message) && + Objects.equals(this.status, error.status) && + Objects.equals(this.referenceError, error.referenceError) && + Objects.equals(this._atBaseType, error._atBaseType) && + Objects.equals(this._atSchemaLocation, error._atSchemaLocation) && + Objects.equals(this._atType, error._atType); + } + + @Override + public int hashCode() { + return Objects.hash(code, reason, message, status, referenceError, _atBaseType, _atSchemaLocation, _atType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Error {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" referenceError: ").append(toIndentedString(referenceError)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(_atBaseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(_atSchemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(_atType)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/EventSubscription.java b/src/main/java/org/etsi/osl/tmf/pim637/model/EventSubscription.java new file mode 100644 index 0000000000000000000000000000000000000000..1d272920e640fe22b0834c4f176dca7aa4516c5a --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/EventSubscription.java @@ -0,0 +1,129 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +/** + * Sets the communication endpoint address the service instance must use to deliver notification information + */ +@Schema(description = "Sets the communication endpoint address the service instance must use to deliver notification information") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class EventSubscription { + @JsonProperty("id") + private String id = null; + + @JsonProperty("callback") + private String callback = null; + + @JsonProperty("query") + private String query = null; + + public EventSubscription id(String id) { + this.id = id; + return this; + } + + /** + * Id of the listener + * @return id + **/ + @Schema(required = true, description = "Id of the listener") + @NotNull + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public EventSubscription callback(String callback) { + this.callback = callback; + return this; + } + + /** + * The callback being registered. + * @return callback + **/ + @Schema(required = true, description = "The callback being registered.") + @NotNull + + public String getCallback() { + return callback; + } + + public void setCallback(String callback) { + this.callback = callback; + } + + public EventSubscription query(String query) { + this.query = query; + return this; + } + + /** + * additional data to be passed + * @return query + **/ + @Schema(description = "additional data to be passed") + @NotNull + + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventSubscription eventSubscription = (EventSubscription) o; + return Objects.equals(this.id, eventSubscription.id) && + Objects.equals(this.callback, eventSubscription.callback) && + Objects.equals(this.query, eventSubscription.query); + } + + @Override + public int hashCode() { + return Objects.hash(id, callback, query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventSubscription {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" callback: ").append(toIndentedString(callback)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/EventSubscriptionInput.java b/src/main/java/org/etsi/osl/tmf/pim637/model/EventSubscriptionInput.java new file mode 100644 index 0000000000000000000000000000000000000000..2561f945670ca1178b490e411fbdf41c6132bf85 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/EventSubscriptionInput.java @@ -0,0 +1,104 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +/** + * Sets the communication endpoint address the service instance must use to deliver notification information + */ +@Schema(description = "Sets the communication endpoint address the service instance must use to deliver notification information") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class EventSubscriptionInput { + @JsonProperty("callback") + private String callback = null; + + @JsonProperty("query") + private String query = null; + + public EventSubscriptionInput callback(String callback) { + this.callback = callback; + return this; + } + + /** + * The callback being registered. + * @return callback + **/ + @Schema(required = true, description = "The callback being registered.") + @NotNull + + public String getCallback() { + return callback; + } + + public void setCallback(String callback) { + this.callback = callback; + } + + public EventSubscriptionInput query(String query) { + this.query = query; + return this; + } + + /** + * additional data to be passed + * @return query + **/ + @Schema(description = "additional data to be passed") + @NotNull + + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventSubscriptionInput eventSubscriptionInput = (EventSubscriptionInput) o; + return Objects.equals(this.callback, eventSubscriptionInput.callback) && + Objects.equals(this.query, eventSubscriptionInput.query); + } + + @Override + public int hashCode() { + return Objects.hash(callback, query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventSubscriptionInput {\n"); + + sb.append(" callback: ").append(toIndentedString(callback)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/Money.java b/src/main/java/org/etsi/osl/tmf/pim637/model/Money.java similarity index 69% rename from src/main/java/org/etsi/osl/tmf/po622/model/Money.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/Money.java index 3e92fbf16c72573df5d511163adbff235dbf4777..446fa97b97d827175fc593aeae9d32ed30fb271f 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/Money.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/Money.java @@ -1,39 +1,22 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; +import jakarta.validation.constraints.NotNull; /** * A base / value business entity used to represent money */ @Schema(description = "A base / value business entity used to represent money") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class Money { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + +@Entity(name = "Money637") +public class Money extends BaseRootEntity { @JsonProperty("unit") private String unit = null; @@ -48,9 +31,10 @@ public class Money { /** * Currency (ISO4217 norm uses 3 letters to define the currency) * @return unit - **/ + **/ @Schema(description = "Currency (ISO4217 norm uses 3 letters to define the currency)") - + @NotNull + public String getUnit() { return unit; } @@ -67,9 +51,10 @@ public class Money { /** * A positive floating point number * @return value - **/ + **/ @Schema(description = "A positive floating point number") - + @NotNull + public Float getValue() { return value; } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/Place.java b/src/main/java/org/etsi/osl/tmf/pim637/model/Place.java similarity index 62% rename from src/main/java/org/etsi/osl/tmf/po622/model/Place.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/Place.java index 62c96891b445614dd888083ee2f247ec50e55b39..7b98f7dc6bd27f8ae12d0a109cb5efc14cdba467 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/Place.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/Place.java @@ -1,38 +1,19 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; /** * Place reference. Place defines the places where the products are sold or delivered. */ @Schema(description = "Place reference. Place defines the places where the products are sold or delivered.") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + public class Place { @JsonProperty("id") private String id = null; @@ -44,13 +25,13 @@ public class Place { private String name = null; @JsonProperty("@baseType") - private String baseType = null; + private String _atBaseType = null; @JsonProperty("@schemaLocation") - private String schemaLocation = null; + private String _atSchemaLocation = null; @JsonProperty("@type") - private String type = null; + private String _atType = null; public Place id(String id) { this.id = id; @@ -60,9 +41,10 @@ public class Place { /** * Unique identifier of the place * @return id - **/ + **/ @Schema(description = "Unique identifier of the place") - + @NotNull + public String getId() { return id; } @@ -79,9 +61,10 @@ public class Place { /** * Unique reference of the place * @return href - **/ + **/ @Schema(description = "Unique reference of the place") - + @NotNull + public String getHref() { return href; } @@ -98,9 +81,10 @@ public class Place { /** * A user-friendly name for the place, such as [Paris Store], [London Store], [Main Home] * @return name - **/ + **/ @Schema(description = "A user-friendly name for the place, such as [Paris Store], [London Store], [Main Home]") - + @NotNull + public String getName() { return name; } @@ -109,61 +93,64 @@ public class Place { this.name = name; } - public Place baseType(String baseType) { - this.baseType = baseType; + public Place _atBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; return this; } /** * When sub-classing, this defines the super-class - * @return baseType - **/ + * @return _atBaseType + **/ @Schema(description = "When sub-classing, this defines the super-class") - + @NotNull + public String getAtBaseType() { - return baseType; + return _atBaseType; } - public void setAtBaseType(String baseType) { - this.baseType = baseType; + public void setAtBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; } - public Place schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; + public Place _atSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; return this; } /** * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ + * @return _atSchemaLocation + **/ @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - + @NotNull + public String getAtSchemaLocation() { - return schemaLocation; + return _atSchemaLocation; } - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; + public void setAtSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; } - public Place type(String type) { - this.type = type; + public Place _atType(String _atType) { + this._atType = _atType; return this; } /** * When sub-classing, this defines the sub-class entity name - * @return type - **/ + * @return _atType + **/ @Schema(description = "When sub-classing, this defines the sub-class entity name") - + @NotNull + public String getAtType() { - return type; + return _atType; } - public void setAtType(String type) { - this.type = type; + public void setAtType(String _atType) { + this._atType = _atType; } @@ -179,14 +166,14 @@ public class Place { return Objects.equals(this.id, place.id) && Objects.equals(this.href, place.href) && Objects.equals(this.name, place.name) && - Objects.equals(this.baseType, place.baseType) && - Objects.equals(this.schemaLocation, place.schemaLocation) && - Objects.equals(this.type, place.type); + Objects.equals(this._atBaseType, place._atBaseType) && + Objects.equals(this._atSchemaLocation, place._atSchemaLocation) && + Objects.equals(this._atType, place._atType); } @Override public int hashCode() { - return Objects.hash(id, href, name, baseType, schemaLocation, type); + return Objects.hash(id, href, name, _atBaseType, _atSchemaLocation, _atType); } @Override @@ -197,9 +184,9 @@ public class Place { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" href: ").append(toIndentedString(href)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(_atBaseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(_atSchemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(_atType)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/Price.java b/src/main/java/org/etsi/osl/tmf/pim637/model/Price.java similarity index 67% rename from src/main/java/org/etsi/osl/tmf/po622/model/Price.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/Price.java index e1c950d7cbaa6eebc0234078bbe7542faf8a3605..c4f2d69eb4c3f56aac92d57d37aa9216ed129ec6 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/Price.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/Price.java @@ -1,40 +1,26 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToOne; import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; /** * Provides all amounts (tax included, duty free, tax rate), used currency and percentage to apply for Price Alteration. */ @Schema(description = "Provides all amounts (tax included, duty free, tax rate), used currency and percentage to apply for Price Alteration.") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class Price { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +@Entity(name = "Price637") +public class Price extends BaseRootEntity { @JsonProperty("percentage") private Float percentage = null; @@ -42,19 +28,21 @@ public class Price { private Float taxRate = null; @JsonProperty("dutyFreeAmount") + @OneToOne(cascade = CascadeType.ALL) private Money dutyFreeAmount = null; @JsonProperty("taxIncludedAmount") + @OneToOne(cascade = CascadeType.ALL) private Money taxIncludedAmount = null; @JsonProperty("@baseType") - private String baseType = null; + private String _atBaseType = null; @JsonProperty("@schemaLocation") - private String schemaLocation = null; + private String _atSchemaLocation = null; @JsonProperty("@type") - private String type = null; + private String _atType = null; public Price percentage(Float percentage) { this.percentage = percentage; @@ -64,9 +52,10 @@ public class Price { /** * Percentage to apply for ProdOfferPriceAlteration * @return percentage - **/ + **/ @Schema(description = "Percentage to apply for ProdOfferPriceAlteration") - + @NotNull + public Float getPercentage() { return percentage; } @@ -83,9 +72,10 @@ public class Price { /** * Tax rate * @return taxRate - **/ + **/ @Schema(description = "Tax rate") - + @NotNull + public Float getTaxRate() { return taxRate; } @@ -102,9 +92,10 @@ public class Price { /** * Get dutyFreeAmount * @return dutyFreeAmount - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public Money getDutyFreeAmount() { return dutyFreeAmount; @@ -122,9 +113,10 @@ public class Price { /** * Get taxIncludedAmount * @return taxIncludedAmount - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public Money getTaxIncludedAmount() { return taxIncludedAmount; @@ -134,61 +126,64 @@ public class Price { this.taxIncludedAmount = taxIncludedAmount; } - public Price baseType(String baseType) { - this.baseType = baseType; + public Price _atBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; return this; } /** * When sub-classing, this defines the super-class - * @return baseType - **/ + * @return _atBaseType + **/ @Schema(description = "When sub-classing, this defines the super-class") - + @NotNull + public String getAtBaseType() { - return baseType; + return _atBaseType; } - public void setAtBaseType(String baseType) { - this.baseType = baseType; + public void setAtBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; } - public Price schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; + public Price _atSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; return this; } /** * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ + * @return _atSchemaLocation + **/ @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - + @NotNull + public String getAtSchemaLocation() { - return schemaLocation; + return _atSchemaLocation; } - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; + public void setAtSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; } - public Price type(String type) { - this.type = type; + public Price _atType(String _atType) { + this._atType = _atType; return this; } /** * When sub-classing, this defines the sub-class entity name - * @return type - **/ + * @return _atType + **/ @Schema(description = "When sub-classing, this defines the sub-class entity name") - + @NotNull + public String getAtType() { - return type; + return _atType; } - public void setAtType(String type) { - this.type = type; + public void setAtType(String _atType) { + this._atType = _atType; } @@ -205,14 +200,14 @@ public class Price { Objects.equals(this.taxRate, price.taxRate) && Objects.equals(this.dutyFreeAmount, price.dutyFreeAmount) && Objects.equals(this.taxIncludedAmount, price.taxIncludedAmount) && - Objects.equals(this.baseType, price.baseType) && - Objects.equals(this.schemaLocation, price.schemaLocation) && - Objects.equals(this.type, price.type); + Objects.equals(this._atBaseType, price._atBaseType) && + Objects.equals(this._atSchemaLocation, price._atSchemaLocation) && + Objects.equals(this._atType, price._atType); } @Override public int hashCode() { - return Objects.hash(percentage, taxRate, dutyFreeAmount, taxIncludedAmount, baseType, schemaLocation, type); + return Objects.hash(percentage, taxRate, dutyFreeAmount, taxIncludedAmount, _atBaseType, _atSchemaLocation, _atType); } @Override @@ -224,9 +219,9 @@ public class Price { sb.append(" taxRate: ").append(toIndentedString(taxRate)).append("\n"); sb.append(" dutyFreeAmount: ").append(toIndentedString(dutyFreeAmount)).append("\n"); sb.append(" taxIncludedAmount: ").append(toIndentedString(taxIncludedAmount)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(_atBaseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(_atSchemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(_atType)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/PriceAlteration.java b/src/main/java/org/etsi/osl/tmf/pim637/model/PriceAlteration.java similarity index 72% rename from src/main/java/org/etsi/osl/tmf/po622/model/PriceAlteration.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/PriceAlteration.java index 5efe9e755634b6d00bca3967c6ceb0d023b74e86..75c3805993c5572b7d3123deea5f94c5f844f0a3 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/PriceAlteration.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/PriceAlteration.java @@ -1,31 +1,15 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootEntity; +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; +import org.etsi.osl.tmf.pcm620.model.ProductOfferingPriceRef; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToOne; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; @@ -34,17 +18,16 @@ import jakarta.validation.constraints.NotNull; */ @Schema(description = "Is an amount, usually of money, that modifies the price charged for an order item.") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class PriceAlteration { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + +@Entity(name = "PriceAlter637") +public class PriceAlteration extends BaseRootNamedEntity { @JsonProperty("applicationDuration") private Integer applicationDuration = null; @JsonProperty("description") private String description = null; - @JsonProperty("name") - private String name = null; - @JsonProperty("priceType") private String priceType = null; @@ -58,20 +41,13 @@ public class PriceAlteration { private String unitOfMeasure = null; @JsonProperty("price") + @OneToOne(cascade = CascadeType.ALL) private Price price = null; @JsonProperty("productOfferingPrice") + @OneToOne(cascade = CascadeType.ALL) private ProductOfferingPriceRef productOfferingPrice = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; - public PriceAlteration applicationDuration(Integer applicationDuration) { this.applicationDuration = applicationDuration; return this; @@ -80,9 +56,10 @@ public class PriceAlteration { /** * Duration during which the alteration applies on the order item price (for instance 2 months free of charge for the recurring charge) * @return applicationDuration - **/ + **/ @Schema(description = "Duration during which the alteration applies on the order item price (for instance 2 months free of charge for the recurring charge)") - + @NotNull + public Integer getApplicationDuration() { return applicationDuration; } @@ -99,9 +76,10 @@ public class PriceAlteration { /** * A narrative that explains in detail the semantics of this order item price alteration * @return description - **/ + **/ @Schema(description = "A narrative that explains in detail the semantics of this order item price alteration") - + @NotNull + public String getDescription() { return description; } @@ -118,9 +96,10 @@ public class PriceAlteration { /** * Name of the order item price alteration * @return name - **/ + **/ @Schema(description = "Name of the order item price alteration") - + @NotNull + public String getName() { return name; } @@ -137,8 +116,8 @@ public class PriceAlteration { /** * A category that describes the price such as recurring, one time and usage. * @return priceType - **/ - @Schema(description = "A category that describes the price such as recurring, one time and usage.") + **/ + @Schema(required = true, description = "A category that describes the price such as recurring, one time and usage.") @NotNull public String getPriceType() { @@ -157,9 +136,10 @@ public class PriceAlteration { /** * Priority level for applying this alteration among all the defined alterations on the order item price * @return priority - **/ + **/ @Schema(description = "Priority level for applying this alteration among all the defined alterations on the order item price") - + @NotNull + public Integer getPriority() { return priority; } @@ -176,9 +156,10 @@ public class PriceAlteration { /** * Could be month, week... * @return recurringChargePeriod - **/ + **/ @Schema(description = "Could be month, week...") - + @NotNull + public String getRecurringChargePeriod() { return recurringChargePeriod; } @@ -195,9 +176,10 @@ public class PriceAlteration { /** * Could be minutes, GB... * @return unitOfMeasure - **/ + **/ @Schema(description = "Could be minutes, GB...") - + @NotNull + public String getUnitOfMeasure() { return unitOfMeasure; } @@ -214,8 +196,8 @@ public class PriceAlteration { /** * Get price * @return price - **/ - @Schema(description = "") + **/ + @Schema(required = true, description = "") @NotNull @Valid @@ -235,9 +217,10 @@ public class PriceAlteration { /** * Get productOfferingPrice * @return productOfferingPrice - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public ProductOfferingPriceRef getProductOfferingPrice() { return productOfferingPrice; @@ -247,62 +230,6 @@ public class PriceAlteration { this.productOfferingPrice = productOfferingPrice; } - public PriceAlteration baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public PriceAlteration schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public PriceAlteration type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } @Override @@ -347,9 +274,9 @@ public class PriceAlteration { sb.append(" unitOfMeasure: ").append(toIndentedString(unitOfMeasure)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" productOfferingPrice: ").append(toIndentedString(productOfferingPrice)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(baseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/Product.java b/src/main/java/org/etsi/osl/tmf/pim637/model/Product.java similarity index 69% rename from src/main/java/org/etsi/osl/tmf/po622/model/Product.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/Product.java index ee4c02bd2fe8e7b724a442d82d235c4929d458a0..75b40a5ca0d816940ab97f77866a0abb2cf936bc 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/Product.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/Product.java @@ -1,138 +1,138 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; -import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Date; +import java.util.HashSet; import java.util.List; import java.util.Objects; - +import java.util.Set; import com.fasterxml.jackson.annotation.JsonProperty; +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; +import org.etsi.osl.tmf.common.model.service.Characteristic; import org.etsi.osl.tmf.common.model.service.ResourceRef; import org.etsi.osl.tmf.common.model.service.ServiceRef; +import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef; +import org.etsi.osl.tmf.pcm620.model.ProductSpecificationRef; +import org.etsi.osl.tmf.po622.model.AgreementItemRef; +import org.etsi.osl.tmf.po622.model.RelatedProductOrderItem; import org.etsi.osl.tmf.prm669.model.RelatedParty; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; /** * A product offering procured by a customer or other interested party playing a party role. A product is realized as one or more service(s) and / or resource(s). */ @Schema(description = "A product offering procured by a customer or other interested party playing a party role. A product is realized as one or more service(s) and / or resource(s).") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class Product { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + +@Entity(name = "Product637") +public class Product extends BaseRootNamedEntity { @JsonProperty("id") - private String id = null; + protected String id = null; - @JsonProperty("href") - private String href = null; @JsonProperty("description") - private String description = null; + protected String description = null; @JsonProperty("isBundle") - private Boolean isBundle = null; + protected Boolean isBundle = null; @JsonProperty("isCustomerVisible") - private Boolean isCustomerVisible = null; - - @JsonProperty("name") - private String name = null; + protected Boolean isCustomerVisible = null; @JsonProperty("orderDate") - private OffsetDateTime orderDate = null; + protected Date orderDate = null; @JsonProperty("productSerialNumber") - private String productSerialNumber = null; + protected String productSerialNumber = null; @JsonProperty("startDate") - private OffsetDateTime startDate = null; + protected Date startDate = null; @JsonProperty("terminationDate") - private OffsetDateTime terminationDate = null; + protected Date terminationDate = null; @JsonProperty("agreement") @Valid - private List agreement = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + protected Set agreement = new HashSet<>(); @JsonProperty("billingAccount") - private BillingAccountRef billingAccount = null; + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "billing_acc_refuuid", referencedColumnName = "uuid") + protected BillingAccountRef billingAccount = null; @JsonProperty("place") @Valid - private List place = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + protected Set place = new HashSet<>(); @JsonProperty("product") @Valid - private List product = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + protected Set product = new HashSet<>(); @JsonProperty("productCharacteristic") @Valid - private List productCharacteristic = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + protected Set productCharacteristic = new HashSet<>(); @JsonProperty("productOffering") - private ProductOfferingRef productOffering = null; + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "prodoff_refuuid", referencedColumnName = "uuid") + protected ProductOfferingRef productOffering = null; @JsonProperty("productOrderItem") @Valid - private List productOrderItem = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + protected Set productOrderItem = new HashSet<>(); @JsonProperty("productPrice") @Valid - private List productPrice = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + protected Set productPrice = new HashSet<>(); @JsonProperty("productRelationship") @Valid - private List productRelationship = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + protected Set productRelationship = new HashSet<>(); @JsonProperty("productSpecification") - private ProductSpecificationRef productSpecification = null; + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "prodspec_refuuid", referencedColumnName = "uuid") + protected ProductSpecificationRef productSpecification = null; @JsonProperty("productTerm") @Valid - private List productTerm = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + protected Set productTerm = new HashSet<>(); @JsonProperty("realizingResource") @Valid - private List realizingResource = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + protected Set realizingResource = new HashSet<>(); @JsonProperty("realizingService") @Valid - private List realizingService = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + protected Set realizingService = new HashSet<>(); @JsonProperty("relatedParty") @Valid - private List relatedParty = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + protected Set relatedParty = new HashSet<>(); @JsonProperty("status") - private ProductStatusType status = null; + protected ProductStatusType status = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; public Product id(String id) { this.id = id; @@ -142,9 +142,10 @@ public class Product { /** * Unique identifier of the product * @return id - **/ + **/ @Schema(description = "Unique identifier of the product") - + @NotNull + public String getId() { return id; } @@ -161,9 +162,10 @@ public class Product { /** * Reference of the product * @return href - **/ + **/ @Schema(description = "Reference of the product") - + @NotNull + public String getHref() { return href; } @@ -180,9 +182,10 @@ public class Product { /** * Is the description of the product. It could be copied from the description of the Product Offering. * @return description - **/ + **/ @Schema(description = "Is the description of the product. It could be copied from the description of the Product Offering.") - + @NotNull + public String getDescription() { return description; } @@ -199,9 +202,10 @@ public class Product { /** * If true, the product is a ProductBundle which is an instantiation of a BundledProductOffering. If false, the product is a ProductComponent which is an instantiation of a SimpleProductOffering. * @return isBundle - **/ + **/ @Schema(description = "If true, the product is a ProductBundle which is an instantiation of a BundledProductOffering. If false, the product is a ProductComponent which is an instantiation of a SimpleProductOffering.") - + @NotNull + public Boolean isIsBundle() { return isBundle; } @@ -218,9 +222,10 @@ public class Product { /** * If true, the product is visible by the customer. * @return isCustomerVisible - **/ + **/ @Schema(description = "If true, the product is visible by the customer.") - + @NotNull + public Boolean isIsCustomerVisible() { return isCustomerVisible; } @@ -237,9 +242,10 @@ public class Product { /** * Name of the product. It could be the same as the name of the product offering * @return name - **/ + **/ @Schema(description = "Name of the product. It could be the same as the name of the product offering") - + @NotNull + public String getName() { return name; } @@ -248,7 +254,7 @@ public class Product { this.name = name; } - public Product orderDate(OffsetDateTime orderDate) { + public Product orderDate(Date orderDate) { this.orderDate = orderDate; return this; } @@ -256,15 +262,16 @@ public class Product { /** * Is the date when the product was ordered * @return orderDate - **/ + **/ @Schema(description = "Is the date when the product was ordered") - + @NotNull + @Valid - public OffsetDateTime getOrderDate() { + public Date getOrderDate() { return orderDate; } - public void setOrderDate(OffsetDateTime orderDate) { + public void setOrderDate(Date orderDate) { this.orderDate = orderDate; } @@ -276,9 +283,10 @@ public class Product { /** * Is the serial number for the product. This is typically applicable to tangible products e.g. Broadband Router. * @return productSerialNumber - **/ + **/ @Schema(description = "Is the serial number for the product. This is typically applicable to tangible products e.g. Broadband Router.") - + @NotNull + public String getProductSerialNumber() { return productSerialNumber; } @@ -287,7 +295,7 @@ public class Product { this.productSerialNumber = productSerialNumber; } - public Product startDate(OffsetDateTime startDate) { + public Product startDate(Date startDate) { this.startDate = startDate; return this; } @@ -295,19 +303,20 @@ public class Product { /** * Is the date from which the product starts * @return startDate - **/ + **/ @Schema(description = "Is the date from which the product starts") - + @NotNull + @Valid - public OffsetDateTime getStartDate() { + public Date getStartDate() { return startDate; } - public void setStartDate(OffsetDateTime startDate) { + public void setStartDate(Date startDate) { this.startDate = startDate; } - public Product terminationDate(OffsetDateTime terminationDate) { + public Product terminationDate(Date terminationDate) { this.terminationDate = terminationDate; return this; } @@ -315,26 +324,27 @@ public class Product { /** * Is the date when the product was terminated * @return terminationDate - **/ + **/ @Schema(description = "Is the date when the product was terminated") - + @NotNull + @Valid - public OffsetDateTime getTerminationDate() { + public Date getTerminationDate() { return terminationDate; } - public void setTerminationDate(OffsetDateTime terminationDate) { + public void setTerminationDate(Date terminationDate) { this.terminationDate = terminationDate; } - public Product agreement(List agreement) { + public Product agreement(Set agreement) { this.agreement = agreement; return this; } public Product addAgreementItem(AgreementItemRef agreementItem) { if (this.agreement == null) { - this.agreement = new ArrayList<>(); + this.agreement = new HashSet(); } this.agreement.add(agreementItem); return this; @@ -343,14 +353,15 @@ public class Product { /** * Get agreement * @return agreement - **/ + **/ @Schema(description = "") - @Valid - public List getAgreement() { + @NotNull + @Valid + public Set getAgreement() { return agreement; } - public void setAgreement(List agreement) { + public void setAgreement(Set agreement) { this.agreement = agreement; } @@ -362,9 +373,10 @@ public class Product { /** * Get billingAccount * @return billingAccount - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public BillingAccountRef getBillingAccount() { return billingAccount; @@ -374,14 +386,14 @@ public class Product { this.billingAccount = billingAccount; } - public Product place(List place) { + public Product place(Set place) { this.place = place; return this; } public Product addPlaceItem(RelatedPlaceRefOrValue placeItem) { if (this.place == null) { - this.place = new ArrayList<>(); + this.place = new HashSet(); } this.place.add(placeItem); return this; @@ -390,25 +402,26 @@ public class Product { /** * Get place * @return place - **/ + **/ @Schema(description = "") - @Valid - public List getPlace() { + @NotNull + @Valid + public Set getPlace() { return place; } - public void setPlace(List place) { + public void setPlace(Set place) { this.place = place; } - public Product product(List product) { + public Product product(Set product) { this.product = product; return this; } public Product addProductItem(ProductRefOrValue productItem) { if (this.product == null) { - this.product = new ArrayList<>(); + this.product = new HashSet(); } this.product.add(productItem); return this; @@ -417,25 +430,26 @@ public class Product { /** * Get product * @return product - **/ + **/ @Schema(description = "") - @Valid - public List getProduct() { + @NotNull + @Valid + public Set getProduct() { return product; } - public void setProduct(List product) { + public void setProduct(Set product) { this.product = product; } - public Product productCharacteristic(List productCharacteristic) { + public Product productCharacteristic(Set productCharacteristic) { this.productCharacteristic = productCharacteristic; return this; } public Product addProductCharacteristicItem(Characteristic productCharacteristicItem) { if (this.productCharacteristic == null) { - this.productCharacteristic = new ArrayList<>(); + this.productCharacteristic = new HashSet(); } this.productCharacteristic.add(productCharacteristicItem); return this; @@ -444,14 +458,15 @@ public class Product { /** * Get productCharacteristic * @return productCharacteristic - **/ + **/ @Schema(description = "") - @Valid - public List getProductCharacteristic() { + @NotNull + @Valid + public Set getProductCharacteristic() { return productCharacteristic; } - public void setProductCharacteristic(List productCharacteristic) { + public void setProductCharacteristic(Set productCharacteristic) { this.productCharacteristic = productCharacteristic; } @@ -463,9 +478,10 @@ public class Product { /** * Get productOffering * @return productOffering - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public ProductOfferingRef getProductOffering() { return productOffering; @@ -475,14 +491,14 @@ public class Product { this.productOffering = productOffering; } - public Product productOrderItem(List productOrderItem) { + public Product productOrderItem(Set productOrderItem) { this.productOrderItem = productOrderItem; return this; } public Product addProductOrderItemItem(RelatedProductOrderItem productOrderItemItem) { if (this.productOrderItem == null) { - this.productOrderItem = new ArrayList<>(); + this.productOrderItem = new HashSet(); } this.productOrderItem.add(productOrderItemItem); return this; @@ -491,25 +507,26 @@ public class Product { /** * Get productOrderItem * @return productOrderItem - **/ + **/ @Schema(description = "") - @Valid - public List getProductOrderItem() { + @NotNull + @Valid + public Set getProductOrderItem() { return productOrderItem; } - public void setProductOrderItem(List productOrderItem) { + public void setProductOrderItem(Set productOrderItem) { this.productOrderItem = productOrderItem; } - public Product productPrice(List productPrice) { + public Product productPrice(Set productPrice) { this.productPrice = productPrice; return this; } public Product addProductPriceItem(ProductPrice productPriceItem) { if (this.productPrice == null) { - this.productPrice = new ArrayList<>(); + this.productPrice = new HashSet(); } this.productPrice.add(productPriceItem); return this; @@ -518,25 +535,26 @@ public class Product { /** * Get productPrice * @return productPrice - **/ + **/ @Schema(description = "") - @Valid - public List getProductPrice() { + @NotNull + @Valid + public Set getProductPrice() { return productPrice; } - public void setProductPrice(List productPrice) { + public void setProductPrice(Set productPrice) { this.productPrice = productPrice; } - public Product productRelationship(List productRelationship) { + public Product productRelationship(Set productRelationship) { this.productRelationship = productRelationship; return this; } public Product addProductRelationshipItem(ProductRelationship productRelationshipItem) { if (this.productRelationship == null) { - this.productRelationship = new ArrayList<>(); + this.productRelationship = new HashSet(); } this.productRelationship.add(productRelationshipItem); return this; @@ -545,14 +563,15 @@ public class Product { /** * Get productRelationship * @return productRelationship - **/ + **/ @Schema(description = "") - @Valid - public List getProductRelationship() { + @NotNull + @Valid + public Set getProductRelationship() { return productRelationship; } - public void setProductRelationship(List productRelationship) { + public void setProductRelationship(Set productRelationship) { this.productRelationship = productRelationship; } @@ -564,9 +583,10 @@ public class Product { /** * Get productSpecification * @return productSpecification - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public ProductSpecificationRef getProductSpecification() { return productSpecification; @@ -576,14 +596,14 @@ public class Product { this.productSpecification = productSpecification; } - public Product productTerm(List productTerm) { + public Product productTerm(Set productTerm) { this.productTerm = productTerm; return this; } public Product addProductTermItem(ProductTerm productTermItem) { if (this.productTerm == null) { - this.productTerm = new ArrayList<>(); + this.productTerm = new HashSet(); } this.productTerm.add(productTermItem); return this; @@ -592,25 +612,26 @@ public class Product { /** * Get productTerm * @return productTerm - **/ + **/ @Schema(description = "") - @Valid - public List getProductTerm() { + @NotNull + @Valid + public Set getProductTerm() { return productTerm; } - public void setProductTerm(List productTerm) { + public void setProductTerm(Set productTerm) { this.productTerm = productTerm; } - public Product realizingResource(List realizingResource) { + public Product realizingResource(Set realizingResource) { this.realizingResource = realizingResource; return this; } public Product addRealizingResourceItem(ResourceRef realizingResourceItem) { if (this.realizingResource == null) { - this.realizingResource = new ArrayList<>(); + this.realizingResource = new HashSet(); } this.realizingResource.add(realizingResourceItem); return this; @@ -619,25 +640,26 @@ public class Product { /** * Get realizingResource * @return realizingResource - **/ + **/ @Schema(description = "") - @Valid - public List getRealizingResource() { + @NotNull + @Valid + public Set getRealizingResource() { return realizingResource; } - public void setRealizingResource(List realizingResource) { + public void setRealizingResource(Set realizingResource) { this.realizingResource = realizingResource; } - public Product realizingService(List realizingService) { + public Product realizingService(Set realizingService) { this.realizingService = realizingService; return this; } public Product addRealizingServiceItem(ServiceRef realizingServiceItem) { if (this.realizingService == null) { - this.realizingService = new ArrayList<>(); + this.realizingService = new HashSet(); } this.realizingService.add(realizingServiceItem); return this; @@ -646,25 +668,26 @@ public class Product { /** * Get realizingService * @return realizingService - **/ + **/ @Schema(description = "") - @Valid - public List getRealizingService() { + @NotNull + @Valid + public Set getRealizingService() { return realizingService; } - public void setRealizingService(List realizingService) { + public void setRealizingService(Set realizingService) { this.realizingService = realizingService; } - public Product relatedParty(List relatedParty) { + public Product relatedParty(Set relatedParty) { this.relatedParty = relatedParty; return this; } public Product addRelatedPartyItem(RelatedParty relatedPartyItem) { if (this.relatedParty == null) { - this.relatedParty = new ArrayList<>(); + this.relatedParty = new HashSet(); } this.relatedParty.add(relatedPartyItem); return this; @@ -673,14 +696,15 @@ public class Product { /** * Get relatedParty * @return relatedParty - **/ + **/ @Schema(description = "") - @Valid - public List getRelatedParty() { + @NotNull + @Valid + public Set getRelatedParty() { return relatedParty; } - public void setRelatedParty(List relatedParty) { + public void setRelatedParty(Set relatedParty) { this.relatedParty = relatedParty; } @@ -692,9 +716,10 @@ public class Product { /** * Get status * @return status - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public ProductStatusType getStatus() { return status; @@ -704,62 +729,9 @@ public class Product { this.status = status; } - public Product baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } + - public Product schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public Product type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } + @Override @@ -801,10 +773,11 @@ public class Product { Objects.equals(this.type, product.type); } - @Override - public int hashCode() { - return Objects.hash(id, href, description, isBundle, isCustomerVisible, name, orderDate, productSerialNumber, startDate, terminationDate, agreement, billingAccount, place, product, productCharacteristic, productOffering, productOrderItem, productPrice, productRelationship, productSpecification, productTerm, realizingResource, realizingService, relatedParty, status, baseType, schemaLocation, type); - } +// @Override +// public int hashCode() { +// return Objects.hash(id, href, description, isBundle, isCustomerVisible, name, orderDate, +// productSerialNumber, startDate, terminationDate, agreement, billingAccount, place, product, productCharacteristic, productOffering, productOrderItem, productPrice, productRelationship, productSpecification, productTerm, realizingResource, realizingService, relatedParty, status, baseType, _atSchemaLocation, _atType); +// } @Override public String toString() { diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductAttributeValueChangeEvent.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductAttributeValueChangeEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..3511cd102a2deaba2a14284dcce462b629004f37 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductAttributeValueChangeEvent.java @@ -0,0 +1,334 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Date; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * The notification data structure + */ +@Schema(description = "The notification data structure") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class ProductAttributeValueChangeEvent { + @JsonProperty("eventId") + private String eventId = null; + + @JsonProperty("eventTime") + private Date eventTime = null; + + @JsonProperty("eventType") + private String eventType = null; + + @JsonProperty("correlationId") + private String correlationId = null; + + @JsonProperty("domain") + private String domain = null; + + @JsonProperty("title") + private String title = null; + + @JsonProperty("description") + private String description = null; + + @JsonProperty("priority") + private String priority = null; + + @JsonProperty("timeOcurred") + private Date timeOcurred = null; + + @JsonProperty("fieldPath") + private String fieldPath = null; + + @JsonProperty("event") + private ProductAttributeValueChangeEventPayload event = null; + + public ProductAttributeValueChangeEvent eventId(String eventId) { + this.eventId = eventId; + return this; + } + + /** + * The identifier of the notification. + * @return eventId + **/ + @Schema(description = "The identifier of the notification.") + @NotNull + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public ProductAttributeValueChangeEvent eventTime(Date eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Time of the event occurrence. + * @return eventTime + **/ + @Schema(description = "Time of the event occurrence.") + @NotNull + + @Valid + public Date getEventTime() { + return eventTime; + } + + public void setEventTime(Date eventTime) { + this.eventTime = eventTime; + } + + public ProductAttributeValueChangeEvent eventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * The type of the notification. + * @return eventType + **/ + @Schema(description = "The type of the notification.") + @NotNull + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public ProductAttributeValueChangeEvent correlationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * The correlation id for this event. + * @return correlationId + **/ + @Schema(description = "The correlation id for this event.") + @NotNull + + public String getCorrelationId() { + return correlationId; + } + + public void setCorrelationId(String correlationId) { + this.correlationId = correlationId; + } + + public ProductAttributeValueChangeEvent domain(String domain) { + this.domain = domain; + return this; + } + + /** + * The domain of the event. + * @return domain + **/ + @Schema(description = "The domain of the event.") + @NotNull + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } + + public ProductAttributeValueChangeEvent title(String title) { + this.title = title; + return this; + } + + /** + * The title of the event. + * @return title + **/ + @Schema(description = "The title of the event.") + @NotNull + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public ProductAttributeValueChangeEvent description(String description) { + this.description = description; + return this; + } + + /** + * An explnatory of the event. + * @return description + **/ + @Schema(description = "An explnatory of the event.") + @NotNull + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ProductAttributeValueChangeEvent priority(String priority) { + this.priority = priority; + return this; + } + + /** + * A priority. + * @return priority + **/ + @Schema(description = "A priority.") + @NotNull + + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public ProductAttributeValueChangeEvent timeOcurred(Date timeOcurred) { + this.timeOcurred = timeOcurred; + return this; + } + + /** + * The time the event occured. + * @return timeOcurred + **/ + @Schema(description = "The time the event occured.") + @NotNull + + @Valid + public Date getTimeOcurred() { + return timeOcurred; + } + + public void setTimeOcurred(Date timeOcurred) { + this.timeOcurred = timeOcurred; + } + + public ProductAttributeValueChangeEvent fieldPath(String fieldPath) { + this.fieldPath = fieldPath; + return this; + } + + /** + * The path identifying the object field concerned by this notification. + * @return fieldPath + **/ + @Schema(description = "The path identifying the object field concerned by this notification.") + @NotNull + + public String getFieldPath() { + return fieldPath; + } + + public void setFieldPath(String fieldPath) { + this.fieldPath = fieldPath; + } + + public ProductAttributeValueChangeEvent event(ProductAttributeValueChangeEventPayload event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + **/ + @Schema(description = "") + @NotNull + + @Valid + public ProductAttributeValueChangeEventPayload getEvent() { + return event; + } + + public void setEvent(ProductAttributeValueChangeEventPayload event) { + this.event = event; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAttributeValueChangeEvent productAttributeValueChangeEvent = (ProductAttributeValueChangeEvent) o; + return Objects.equals(this.eventId, productAttributeValueChangeEvent.eventId) && + Objects.equals(this.eventTime, productAttributeValueChangeEvent.eventTime) && + Objects.equals(this.eventType, productAttributeValueChangeEvent.eventType) && + Objects.equals(this.correlationId, productAttributeValueChangeEvent.correlationId) && + Objects.equals(this.domain, productAttributeValueChangeEvent.domain) && + Objects.equals(this.title, productAttributeValueChangeEvent.title) && + Objects.equals(this.description, productAttributeValueChangeEvent.description) && + Objects.equals(this.priority, productAttributeValueChangeEvent.priority) && + Objects.equals(this.timeOcurred, productAttributeValueChangeEvent.timeOcurred) && + Objects.equals(this.fieldPath, productAttributeValueChangeEvent.fieldPath) && + Objects.equals(this.event, productAttributeValueChangeEvent.event); + } + + @Override + public int hashCode() { + return Objects.hash(eventId, eventTime, eventType, correlationId, domain, title, description, priority, timeOcurred, fieldPath, event); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAttributeValueChangeEvent {\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(" fieldPath: ").append(toIndentedString(fieldPath)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductAttributeValueChangeEventPayload.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductAttributeValueChangeEventPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..50b4c3a7e50f08d4d7cfc69eebf07b154b359375 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductAttributeValueChangeEventPayload.java @@ -0,0 +1,81 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * The event data structure + */ +@Schema(description = "The event data structure") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class ProductAttributeValueChangeEventPayload { + @JsonProperty("product") + private Product product = null; + + public ProductAttributeValueChangeEventPayload product(Product product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + **/ + @Schema(description = "") + @NotNull + + @Valid + public Product getProduct() { + return product; + } + + public void setProduct(Product product) { + this.product = product; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAttributeValueChangeEventPayload productAttributeValueChangeEventPayload = (ProductAttributeValueChangeEventPayload) o; + return Objects.equals(this.product, productAttributeValueChangeEventPayload.product); + } + + @Override + public int hashCode() { + return Objects.hash(product); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAttributeValueChangeEventPayload {\n"); + + sb.append(" product: ").append(toIndentedString(product)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductBatchEvent.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductBatchEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..f1a1186c6e1ff9f101236083098a156bd358208b --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductBatchEvent.java @@ -0,0 +1,359 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Date; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * The notification data structure + */ +@Schema(description = "The notification data structure") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class ProductBatchEvent { + @JsonProperty("id") + private String id = null; + + @JsonProperty("href") + private String href = null; + + @JsonProperty("eventId") + private String eventId = null; + + @JsonProperty("eventTime") + private Date eventTime = null; + + @JsonProperty("eventType") + private String eventType = null; + + @JsonProperty("correlationId") + private String correlationId = null; + + @JsonProperty("domain") + private String domain = null; + + @JsonProperty("title") + private String title = null; + + @JsonProperty("description") + private String description = null; + + @JsonProperty("priority") + private String priority = null; + + @JsonProperty("timeOcurred") + private Date timeOcurred = null; + + @JsonProperty("event") + private ProductBatchEventPayload event = null; + + public ProductBatchEvent id(String id) { + this.id = id; + return this; + } + + /** + * Identifier of the Process flow + * @return id + **/ + @Schema(description = "Identifier of the Process flow") + @NotNull + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductBatchEvent href(String href) { + this.href = href; + return this; + } + + /** + * Reference of the ProcessFlow + * @return href + **/ + @Schema(description = "Reference of the ProcessFlow") + @NotNull + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + public ProductBatchEvent eventId(String eventId) { + this.eventId = eventId; + return this; + } + + /** + * The identifier of the notification. + * @return eventId + **/ + @Schema(description = "The identifier of the notification.") + @NotNull + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public ProductBatchEvent eventTime(Date eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Time of the event occurrence. + * @return eventTime + **/ + @Schema(description = "Time of the event occurrence.") + @NotNull + + @Valid + public Date getEventTime() { + return eventTime; + } + + public void setEventTime(Date eventTime) { + this.eventTime = eventTime; + } + + public ProductBatchEvent eventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * The type of the notification. + * @return eventType + **/ + @Schema(description = "The type of the notification.") + @NotNull + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public ProductBatchEvent correlationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * The correlation id for this event. + * @return correlationId + **/ + @Schema(description = "The correlation id for this event.") + @NotNull + + public String getCorrelationId() { + return correlationId; + } + + public void setCorrelationId(String correlationId) { + this.correlationId = correlationId; + } + + public ProductBatchEvent domain(String domain) { + this.domain = domain; + return this; + } + + /** + * The domain of the event. + * @return domain + **/ + @Schema(description = "The domain of the event.") + @NotNull + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } + + public ProductBatchEvent title(String title) { + this.title = title; + return this; + } + + /** + * The title of the event. + * @return title + **/ + @Schema(description = "The title of the event.") + @NotNull + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public ProductBatchEvent description(String description) { + this.description = description; + return this; + } + + /** + * An explnatory of the event. + * @return description + **/ + @Schema(description = "An explnatory of the event.") + @NotNull + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ProductBatchEvent priority(String priority) { + this.priority = priority; + return this; + } + + /** + * A priority. + * @return priority + **/ + @Schema(description = "A priority.") + @NotNull + + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public ProductBatchEvent timeOcurred(Date timeOcurred) { + this.timeOcurred = timeOcurred; + return this; + } + + /** + * The time the event occured. + * @return timeOcurred + **/ + @Schema(description = "The time the event occured.") + @NotNull + + @Valid + public Date getTimeOcurred() { + return timeOcurred; + } + + public void setTimeOcurred(Date timeOcurred) { + this.timeOcurred = timeOcurred; + } + + public ProductBatchEvent event(ProductBatchEventPayload event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + **/ + @Schema(description = "") + @NotNull + + @Valid + public ProductBatchEventPayload getEvent() { + return event; + } + + public void setEvent(ProductBatchEventPayload event) { + this.event = event; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductBatchEvent productBatchEvent = (ProductBatchEvent) o; + return Objects.equals(this.id, productBatchEvent.id) && + Objects.equals(this.href, productBatchEvent.href) && + Objects.equals(this.eventId, productBatchEvent.eventId) && + Objects.equals(this.eventTime, productBatchEvent.eventTime) && + Objects.equals(this.eventType, productBatchEvent.eventType) && + Objects.equals(this.correlationId, productBatchEvent.correlationId) && + Objects.equals(this.domain, productBatchEvent.domain) && + Objects.equals(this.title, productBatchEvent.title) && + Objects.equals(this.description, productBatchEvent.description) && + Objects.equals(this.priority, productBatchEvent.priority) && + Objects.equals(this.timeOcurred, productBatchEvent.timeOcurred) && + Objects.equals(this.event, productBatchEvent.event); + } + + @Override + public int hashCode() { + return Objects.hash(id, href, eventId, eventTime, eventType, correlationId, domain, title, description, priority, timeOcurred, event); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductBatchEvent {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" href: ").append(toIndentedString(href)).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(" event: ").append(toIndentedString(event)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductBatchEventPayload.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductBatchEventPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..e90831cb7692e047a22b32a00dc85deb485e546f --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductBatchEventPayload.java @@ -0,0 +1,81 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * The event data structure + */ +@Schema(description = "The event data structure") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class ProductBatchEventPayload { + @JsonProperty("product") + private Product product = null; + + public ProductBatchEventPayload product(Product product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + **/ + @Schema(description = "") + @NotNull + + @Valid + public Product getProduct() { + return product; + } + + public void setProduct(Product product) { + this.product = product; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductBatchEventPayload productBatchEventPayload = (ProductBatchEventPayload) o; + return Objects.equals(this.product, productBatchEventPayload.product); + } + + @Override + public int hashCode() { + return Objects.hash(product); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductBatchEventPayload {\n"); + + sb.append(" product: ").append(toIndentedString(product)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreate.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreate.java new file mode 100644 index 0000000000000000000000000000000000000000..a9e2e368d8d2a2e7a274efb3fdbfb1358b312cfa --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreate.java @@ -0,0 +1,822 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.etsi.osl.tmf.common.model.service.Characteristic; +import org.etsi.osl.tmf.common.model.service.ResourceRef; +import org.etsi.osl.tmf.common.model.service.ServiceRef; +import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef; +import org.etsi.osl.tmf.pcm620.model.ProductSpecificationRef; +import org.etsi.osl.tmf.po622.model.AgreementItemRef; +import org.etsi.osl.tmf.po622.model.RelatedProductOrderItem; +import org.etsi.osl.tmf.prm669.model.RelatedParty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * A product offering procured by a customer or other interested party playing a party role. A product is realized as one or more service(s) and / or resource(s). Skipped properties: id,href + */ +@Schema(description = "A product offering procured by a customer or other interested party playing a party role. A product is realized as one or more service(s) and / or resource(s). Skipped properties: id,href") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class ProductCreate { + @JsonProperty("description") + private String description = null; + + @JsonProperty("isBundle") + private Boolean isBundle = null; + + @JsonProperty("isCustomerVisible") + private Boolean isCustomerVisible = null; + + @JsonProperty("name") + private String name = null; + + @JsonProperty("orderDate") + private Date orderDate = null; + + @JsonProperty("productSerialNumber") + private String productSerialNumber = null; + + @JsonProperty("startDate") + private Date startDate = null; + + @JsonProperty("terminationDate") + private Date terminationDate = null; + + @JsonProperty("agreement") + @Valid + private List agreement = null; + + @JsonProperty("billingAccount") + private BillingAccountRef billingAccount = null; + + @JsonProperty("place") + @Valid + private List place = null; + + @JsonProperty("product") + @Valid + private List product = null; + + @JsonProperty("productCharacteristic") + @Valid + private List productCharacteristic = null; + + @JsonProperty("productOffering") + private ProductOfferingRef productOffering = null; + + @JsonProperty("productOrderItem") + @Valid + private List productOrderItem = null; + + @JsonProperty("productPrice") + @Valid + private List productPrice = null; + + @JsonProperty("productRelationship") + @Valid + private List productRelationship = null; + + @JsonProperty("productSpecification") + private ProductSpecificationRef productSpecification = null; + + @JsonProperty("productTerm") + @Valid + private List productTerm = null; + + @JsonProperty("realizingResource") + @Valid + private List realizingResource = null; + + @JsonProperty("realizingService") + @Valid + private List realizingService = null; + + @JsonProperty("relatedParty") + @Valid + private List relatedParty = null; + + @JsonProperty("status") + private ProductStatusType status = null; + + @JsonProperty("@baseType") + private String _atBaseType = null; + + @JsonProperty("@schemaLocation") + private String _atSchemaLocation = null; + + @JsonProperty("@type") + private String _atType = null; + + public ProductCreate description(String description) { + this.description = description; + return this; + } + + /** + * Is the description of the product. It could be copied from the description of the Product Offering. + * @return description + **/ + @Schema(description = "Is the description of the product. It could be copied from the description of the Product Offering.") + @NotNull + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ProductCreate isBundle(Boolean isBundle) { + this.isBundle = isBundle; + return this; + } + + /** + * If true, the product is a ProductBundle which is an instantiation of a BundledProductOffering. If false, the product is a ProductComponent which is an instantiation of a SimpleProductOffering. + * @return isBundle + **/ + @Schema(description = "If true, the product is a ProductBundle which is an instantiation of a BundledProductOffering. If false, the product is a ProductComponent which is an instantiation of a SimpleProductOffering.") + @NotNull + + public Boolean isIsBundle() { + return isBundle; + } + + public void setIsBundle(Boolean isBundle) { + this.isBundle = isBundle; + } + + public ProductCreate isCustomerVisible(Boolean isCustomerVisible) { + this.isCustomerVisible = isCustomerVisible; + return this; + } + + /** + * If true, the product is visible by the customer. + * @return isCustomerVisible + **/ + @Schema(description = "If true, the product is visible by the customer.") + @NotNull + + public Boolean isIsCustomerVisible() { + return isCustomerVisible; + } + + public void setIsCustomerVisible(Boolean isCustomerVisible) { + this.isCustomerVisible = isCustomerVisible; + } + + public ProductCreate name(String name) { + this.name = name; + return this; + } + + /** + * Name of the product. It could be the same as the name of the product offering + * @return name + **/ + @Schema(description = "Name of the product. It could be the same as the name of the product offering") + @NotNull + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ProductCreate orderDate(Date orderDate) { + this.orderDate = orderDate; + return this; + } + + /** + * Is the date when the product was ordered + * @return orderDate + **/ + @Schema(description = "Is the date when the product was ordered") + @NotNull + + @Valid + public Date getOrderDate() { + return orderDate; + } + + public void setOrderDate(Date orderDate) { + this.orderDate = orderDate; + } + + public ProductCreate productSerialNumber(String productSerialNumber) { + this.productSerialNumber = productSerialNumber; + return this; + } + + /** + * Is the serial number for the product. This is typically applicable to tangible products e.g. Broadband Router. + * @return productSerialNumber + **/ + @Schema(description = "Is the serial number for the product. This is typically applicable to tangible products e.g. Broadband Router.") + @NotNull + + public String getProductSerialNumber() { + return productSerialNumber; + } + + public void setProductSerialNumber(String productSerialNumber) { + this.productSerialNumber = productSerialNumber; + } + + public ProductCreate startDate(Date startDate) { + this.startDate = startDate; + return this; + } + + /** + * Is the date from which the product starts + * @return startDate + **/ + @Schema(description = "Is the date from which the product starts") + @NotNull + + @Valid + public Date getStartDate() { + return startDate; + } + + public void setStartDate(Date startDate) { + this.startDate = startDate; + } + + public ProductCreate terminationDate(Date terminationDate) { + this.terminationDate = terminationDate; + return this; + } + + /** + * Is the date when the product was terminated + * @return terminationDate + **/ + @Schema(description = "Is the date when the product was terminated") + @NotNull + + @Valid + public Date getTerminationDate() { + return terminationDate; + } + + public void setTerminationDate(Date terminationDate) { + this.terminationDate = terminationDate; + } + + public ProductCreate agreement(List agreement) { + this.agreement = agreement; + return this; + } + + public ProductCreate addAgreementItem(AgreementItemRef agreementItem) { + if (this.agreement == null) { + this.agreement = new ArrayList(); + } + this.agreement.add(agreementItem); + return this; + } + + /** + * Get agreement + * @return agreement + **/ + @Schema(description = "") + @NotNull + @Valid + public List getAgreement() { + return agreement; + } + + public void setAgreement(List agreement) { + this.agreement = agreement; + } + + public ProductCreate billingAccount(BillingAccountRef billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + /** + * Get billingAccount + * @return billingAccount + **/ + @Schema(description = "") + @NotNull + + @Valid + public BillingAccountRef getBillingAccount() { + return billingAccount; + } + + public void setBillingAccount(BillingAccountRef billingAccount) { + this.billingAccount = billingAccount; + } + + public ProductCreate place(List place) { + this.place = place; + return this; + } + + public ProductCreate addPlaceItem(RelatedPlaceRefOrValue placeItem) { + if (this.place == null) { + this.place = new ArrayList(); + } + this.place.add(placeItem); + return this; + } + + /** + * Get place + * @return place + **/ + @Schema(description = "") + @NotNull + @Valid + public List getPlace() { + return place; + } + + public void setPlace(List place) { + this.place = place; + } + + public ProductCreate product(List product) { + this.product = product; + return this; + } + + public ProductCreate addProductItem(ProductRefOrValue productItem) { + if (this.product == null) { + this.product = new ArrayList(); + } + this.product.add(productItem); + return this; + } + + /** + * Get product + * @return product + **/ + @Schema(description = "") + @NotNull + @Valid + public List getProduct() { + return product; + } + + public void setProduct(List product) { + this.product = product; + } + + public ProductCreate productCharacteristic(List productCharacteristic) { + this.productCharacteristic = productCharacteristic; + return this; + } + + public ProductCreate addProductCharacteristicItem(Characteristic productCharacteristicItem) { + if (this.productCharacteristic == null) { + this.productCharacteristic = new ArrayList(); + } + this.productCharacteristic.add(productCharacteristicItem); + return this; + } + + /** + * Get productCharacteristic + * @return productCharacteristic + **/ + @Schema(description = "") + @NotNull + @Valid + public List getProductCharacteristic() { + return productCharacteristic; + } + + public void setProductCharacteristic(List productCharacteristic) { + this.productCharacteristic = productCharacteristic; + } + + public ProductCreate productOffering(ProductOfferingRef productOffering) { + this.productOffering = productOffering; + return this; + } + + /** + * Get productOffering + * @return productOffering + **/ + @Schema(description = "") + @NotNull + + @Valid + public ProductOfferingRef getProductOffering() { + return productOffering; + } + + public void setProductOffering(ProductOfferingRef productOffering) { + this.productOffering = productOffering; + } + + public ProductCreate productOrderItem(List productOrderItem) { + this.productOrderItem = productOrderItem; + return this; + } + + public ProductCreate addProductOrderItemItem(RelatedProductOrderItem productOrderItemItem) { + if (this.productOrderItem == null) { + this.productOrderItem = new ArrayList(); + } + this.productOrderItem.add(productOrderItemItem); + return this; + } + + /** + * Get productOrderItem + * @return productOrderItem + **/ + @Schema(description = "") + @NotNull + @Valid + public List getProductOrderItem() { + return productOrderItem; + } + + public void setProductOrderItem(List productOrderItem) { + this.productOrderItem = productOrderItem; + } + + public ProductCreate productPrice(List productPrice) { + this.productPrice = productPrice; + return this; + } + + public ProductCreate addProductPriceItem(ProductPrice productPriceItem) { + if (this.productPrice == null) { + this.productPrice = new ArrayList(); + } + this.productPrice.add(productPriceItem); + return this; + } + + /** + * Get productPrice + * @return productPrice + **/ + @Schema(description = "") + @NotNull + @Valid + public List getProductPrice() { + return productPrice; + } + + public void setProductPrice(List productPrice) { + this.productPrice = productPrice; + } + + public ProductCreate productRelationship(List productRelationship) { + this.productRelationship = productRelationship; + return this; + } + + public ProductCreate addProductRelationshipItem(ProductRelationship productRelationshipItem) { + if (this.productRelationship == null) { + this.productRelationship = new ArrayList(); + } + this.productRelationship.add(productRelationshipItem); + return this; + } + + /** + * Get productRelationship + * @return productRelationship + **/ + @Schema(description = "") + @NotNull + @Valid + public List getProductRelationship() { + return productRelationship; + } + + public void setProductRelationship(List productRelationship) { + this.productRelationship = productRelationship; + } + + public ProductCreate productSpecification(ProductSpecificationRef productSpecification) { + this.productSpecification = productSpecification; + return this; + } + + /** + * Get productSpecification + * @return productSpecification + **/ + @Schema(description = "") + @NotNull + + @Valid + public ProductSpecificationRef getProductSpecification() { + return productSpecification; + } + + public void setProductSpecification(ProductSpecificationRef productSpecification) { + this.productSpecification = productSpecification; + } + + public ProductCreate productTerm(List productTerm) { + this.productTerm = productTerm; + return this; + } + + public ProductCreate addProductTermItem(ProductTerm productTermItem) { + if (this.productTerm == null) { + this.productTerm = new ArrayList(); + } + this.productTerm.add(productTermItem); + return this; + } + + /** + * Get productTerm + * @return productTerm + **/ + @Schema(description = "") + @NotNull + @Valid + public List getProductTerm() { + return productTerm; + } + + public void setProductTerm(List productTerm) { + this.productTerm = productTerm; + } + + public ProductCreate realizingResource(List realizingResource) { + this.realizingResource = realizingResource; + return this; + } + + public ProductCreate addRealizingResourceItem(ResourceRef realizingResourceItem) { + if (this.realizingResource == null) { + this.realizingResource = new ArrayList(); + } + this.realizingResource.add(realizingResourceItem); + return this; + } + + /** + * Get realizingResource + * @return realizingResource + **/ + @Schema(description = "") + @NotNull + @Valid + public List getRealizingResource() { + return realizingResource; + } + + public void setRealizingResource(List realizingResource) { + this.realizingResource = realizingResource; + } + + public ProductCreate realizingService(List realizingService) { + this.realizingService = realizingService; + return this; + } + + public ProductCreate addRealizingServiceItem(ServiceRef realizingServiceItem) { + if (this.realizingService == null) { + this.realizingService = new ArrayList(); + } + this.realizingService.add(realizingServiceItem); + return this; + } + + /** + * Get realizingService + * @return realizingService + **/ + @Schema(description = "") + @NotNull + @Valid + public List getRealizingService() { + return realizingService; + } + + public void setRealizingService(List realizingService) { + this.realizingService = realizingService; + } + + public ProductCreate relatedParty(List relatedParty) { + this.relatedParty = relatedParty; + return this; + } + + public ProductCreate addRelatedPartyItem(RelatedParty relatedPartyItem) { + if (this.relatedParty == null) { + this.relatedParty = new ArrayList(); + } + this.relatedParty.add(relatedPartyItem); + return this; + } + + /** + * Get relatedParty + * @return relatedParty + **/ + @Schema(description = "") + @NotNull + @Valid + public List getRelatedParty() { + return relatedParty; + } + + public void setRelatedParty(List relatedParty) { + this.relatedParty = relatedParty; + } + + public ProductCreate status(ProductStatusType status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @Schema(required = true, description = "") + @NotNull + + @Valid + public ProductStatusType getStatus() { + return status; + } + + public void setStatus(ProductStatusType status) { + this.status = status; + } + + public ProductCreate _atBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; + return this; + } + + /** + * When sub-classing, this defines the super-class + * @return _atBaseType + **/ + @Schema(description = "When sub-classing, this defines the super-class") + @NotNull + + public String getAtBaseType() { + return _atBaseType; + } + + public void setAtBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; + } + + public ProductCreate _atSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; + return this; + } + + /** + * A URI to a JSON-Schema file that defines additional attributes and relationships + * @return _atSchemaLocation + **/ + @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") + @NotNull + + public String getAtSchemaLocation() { + return _atSchemaLocation; + } + + public void setAtSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; + } + + public ProductCreate _atType(String _atType) { + this._atType = _atType; + return this; + } + + /** + * When sub-classing, this defines the sub-class entity name + * @return _atType + **/ + @Schema(description = "When sub-classing, this defines the sub-class entity name") + @NotNull + + public String getAtType() { + return _atType; + } + + public void setAtType(String _atType) { + this._atType = _atType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductCreate productCreate = (ProductCreate) o; + return Objects.equals(this.description, productCreate.description) && + Objects.equals(this.isBundle, productCreate.isBundle) && + Objects.equals(this.isCustomerVisible, productCreate.isCustomerVisible) && + Objects.equals(this.name, productCreate.name) && + Objects.equals(this.orderDate, productCreate.orderDate) && + Objects.equals(this.productSerialNumber, productCreate.productSerialNumber) && + Objects.equals(this.startDate, productCreate.startDate) && + Objects.equals(this.terminationDate, productCreate.terminationDate) && + Objects.equals(this.agreement, productCreate.agreement) && + Objects.equals(this.billingAccount, productCreate.billingAccount) && + Objects.equals(this.place, productCreate.place) && + Objects.equals(this.product, productCreate.product) && + Objects.equals(this.productCharacteristic, productCreate.productCharacteristic) && + Objects.equals(this.productOffering, productCreate.productOffering) && + Objects.equals(this.productOrderItem, productCreate.productOrderItem) && + Objects.equals(this.productPrice, productCreate.productPrice) && + Objects.equals(this.productRelationship, productCreate.productRelationship) && + Objects.equals(this.productSpecification, productCreate.productSpecification) && + Objects.equals(this.productTerm, productCreate.productTerm) && + Objects.equals(this.realizingResource, productCreate.realizingResource) && + Objects.equals(this.realizingService, productCreate.realizingService) && + Objects.equals(this.relatedParty, productCreate.relatedParty) && + Objects.equals(this.status, productCreate.status) && + Objects.equals(this._atBaseType, productCreate._atBaseType) && + Objects.equals(this._atSchemaLocation, productCreate._atSchemaLocation) && + Objects.equals(this._atType, productCreate._atType); + } + + @Override + public int hashCode() { + return Objects.hash(description, isBundle, isCustomerVisible, name, orderDate, productSerialNumber, startDate, terminationDate, agreement, billingAccount, place, product, productCharacteristic, productOffering, productOrderItem, productPrice, productRelationship, productSpecification, productTerm, realizingResource, realizingService, relatedParty, status, _atBaseType, _atSchemaLocation, _atType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductCreate {\n"); + + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" isBundle: ").append(toIndentedString(isBundle)).append("\n"); + sb.append(" isCustomerVisible: ").append(toIndentedString(isCustomerVisible)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" orderDate: ").append(toIndentedString(orderDate)).append("\n"); + sb.append(" productSerialNumber: ").append(toIndentedString(productSerialNumber)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" terminationDate: ").append(toIndentedString(terminationDate)).append("\n"); + sb.append(" agreement: ").append(toIndentedString(agreement)).append("\n"); + sb.append(" billingAccount: ").append(toIndentedString(billingAccount)).append("\n"); + sb.append(" place: ").append(toIndentedString(place)).append("\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" productCharacteristic: ").append(toIndentedString(productCharacteristic)).append("\n"); + sb.append(" productOffering: ").append(toIndentedString(productOffering)).append("\n"); + sb.append(" productOrderItem: ").append(toIndentedString(productOrderItem)).append("\n"); + sb.append(" productPrice: ").append(toIndentedString(productPrice)).append("\n"); + sb.append(" productRelationship: ").append(toIndentedString(productRelationship)).append("\n"); + sb.append(" productSpecification: ").append(toIndentedString(productSpecification)).append("\n"); + sb.append(" productTerm: ").append(toIndentedString(productTerm)).append("\n"); + sb.append(" realizingResource: ").append(toIndentedString(realizingResource)).append("\n"); + sb.append(" realizingService: ").append(toIndentedString(realizingService)).append("\n"); + sb.append(" relatedParty: ").append(toIndentedString(relatedParty)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(_atBaseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(_atSchemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(_atType)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreateEvent.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreateEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..74731e4281f8abc8e9f7ffeb892e033f717f09fe --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreateEvent.java @@ -0,0 +1,359 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Date; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * The notification data structure + */ +@Schema(description = "The notification data structure") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class ProductCreateEvent { + @JsonProperty("id") + private String id = null; + + @JsonProperty("href") + private String href = null; + + @JsonProperty("eventId") + private String eventId = null; + + @JsonProperty("eventTime") + private Date eventTime = null; + + @JsonProperty("eventType") + private String eventType = null; + + @JsonProperty("correlationId") + private String correlationId = null; + + @JsonProperty("domain") + private String domain = null; + + @JsonProperty("title") + private String title = null; + + @JsonProperty("description") + private String description = null; + + @JsonProperty("priority") + private String priority = null; + + @JsonProperty("timeOcurred") + private Date timeOcurred = null; + + @JsonProperty("event") + private ProductCreateEventPayload event = null; + + public ProductCreateEvent id(String id) { + this.id = id; + return this; + } + + /** + * Identifier of the Process flow + * @return id + **/ + @Schema(description = "Identifier of the Process flow") + @NotNull + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductCreateEvent href(String href) { + this.href = href; + return this; + } + + /** + * Reference of the ProcessFlow + * @return href + **/ + @Schema(description = "Reference of the ProcessFlow") + @NotNull + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + public ProductCreateEvent eventId(String eventId) { + this.eventId = eventId; + return this; + } + + /** + * The identifier of the notification. + * @return eventId + **/ + @Schema(description = "The identifier of the notification.") + @NotNull + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public ProductCreateEvent eventTime(Date eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Time of the event occurrence. + * @return eventTime + **/ + @Schema(description = "Time of the event occurrence.") + @NotNull + + @Valid + public Date getEventTime() { + return eventTime; + } + + public void setEventTime(Date eventTime) { + this.eventTime = eventTime; + } + + public ProductCreateEvent eventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * The type of the notification. + * @return eventType + **/ + @Schema(description = "The type of the notification.") + @NotNull + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public ProductCreateEvent correlationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * The correlation id for this event. + * @return correlationId + **/ + @Schema(description = "The correlation id for this event.") + @NotNull + + public String getCorrelationId() { + return correlationId; + } + + public void setCorrelationId(String correlationId) { + this.correlationId = correlationId; + } + + public ProductCreateEvent domain(String domain) { + this.domain = domain; + return this; + } + + /** + * The domain of the event. + * @return domain + **/ + @Schema(description = "The domain of the event.") + @NotNull + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } + + public ProductCreateEvent title(String title) { + this.title = title; + return this; + } + + /** + * The title of the event. + * @return title + **/ + @Schema(description = "The title of the event.") + @NotNull + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public ProductCreateEvent description(String description) { + this.description = description; + return this; + } + + /** + * An explnatory of the event. + * @return description + **/ + @Schema(description = "An explnatory of the event.") + @NotNull + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ProductCreateEvent priority(String priority) { + this.priority = priority; + return this; + } + + /** + * A priority. + * @return priority + **/ + @Schema(description = "A priority.") + @NotNull + + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public ProductCreateEvent timeOcurred(Date timeOcurred) { + this.timeOcurred = timeOcurred; + return this; + } + + /** + * The time the event occured. + * @return timeOcurred + **/ + @Schema(description = "The time the event occured.") + @NotNull + + @Valid + public Date getTimeOcurred() { + return timeOcurred; + } + + public void setTimeOcurred(Date timeOcurred) { + this.timeOcurred = timeOcurred; + } + + public ProductCreateEvent event(ProductCreateEventPayload event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + **/ + @Schema(description = "") + @NotNull + + @Valid + public ProductCreateEventPayload getEvent() { + return event; + } + + public void setEvent(ProductCreateEventPayload event) { + this.event = event; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductCreateEvent productCreateEvent = (ProductCreateEvent) o; + return Objects.equals(this.id, productCreateEvent.id) && + Objects.equals(this.href, productCreateEvent.href) && + Objects.equals(this.eventId, productCreateEvent.eventId) && + Objects.equals(this.eventTime, productCreateEvent.eventTime) && + Objects.equals(this.eventType, productCreateEvent.eventType) && + Objects.equals(this.correlationId, productCreateEvent.correlationId) && + Objects.equals(this.domain, productCreateEvent.domain) && + Objects.equals(this.title, productCreateEvent.title) && + Objects.equals(this.description, productCreateEvent.description) && + Objects.equals(this.priority, productCreateEvent.priority) && + Objects.equals(this.timeOcurred, productCreateEvent.timeOcurred) && + Objects.equals(this.event, productCreateEvent.event); + } + + @Override + public int hashCode() { + return Objects.hash(id, href, eventId, eventTime, eventType, correlationId, domain, title, description, priority, timeOcurred, event); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductCreateEvent {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" href: ").append(toIndentedString(href)).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(" event: ").append(toIndentedString(event)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreateEventPayload.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreateEventPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..e292e83fcf4c0212ad78aead0e4f777c28d03d1b --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreateEventPayload.java @@ -0,0 +1,81 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * The event data structure + */ +@Schema(description = "The event data structure") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class ProductCreateEventPayload { + @JsonProperty("product") + private Product product = null; + + public ProductCreateEventPayload product(Product product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + **/ + @Schema(description = "") + @NotNull + + @Valid + public Product getProduct() { + return product; + } + + public void setProduct(Product product) { + this.product = product; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductCreateEventPayload productCreateEventPayload = (ProductCreateEventPayload) o; + return Objects.equals(this.product, productCreateEventPayload.product); + } + + @Override + public int hashCode() { + return Objects.hash(product); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductCreateEventPayload {\n"); + + sb.append(" product: ").append(toIndentedString(product)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductDeleteEvent.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductDeleteEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..6637c5ca12bb718ad4ed99305489bf908f08da8a --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductDeleteEvent.java @@ -0,0 +1,359 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Date; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * The notification data structure + */ +@Schema(description = "The notification data structure") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class ProductDeleteEvent { + @JsonProperty("id") + private String id = null; + + @JsonProperty("href") + private String href = null; + + @JsonProperty("eventId") + private String eventId = null; + + @JsonProperty("eventTime") + private Date eventTime = null; + + @JsonProperty("eventType") + private String eventType = null; + + @JsonProperty("correlationId") + private String correlationId = null; + + @JsonProperty("domain") + private String domain = null; + + @JsonProperty("title") + private String title = null; + + @JsonProperty("description") + private String description = null; + + @JsonProperty("priority") + private String priority = null; + + @JsonProperty("timeOcurred") + private Date timeOcurred = null; + + @JsonProperty("event") + private ProductDeleteEventPayload event = null; + + public ProductDeleteEvent id(String id) { + this.id = id; + return this; + } + + /** + * Identifier of the Process flow + * @return id + **/ + @Schema(description = "Identifier of the Process flow") + @NotNull + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductDeleteEvent href(String href) { + this.href = href; + return this; + } + + /** + * Reference of the ProcessFlow + * @return href + **/ + @Schema(description = "Reference of the ProcessFlow") + @NotNull + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + public ProductDeleteEvent eventId(String eventId) { + this.eventId = eventId; + return this; + } + + /** + * The identifier of the notification. + * @return eventId + **/ + @Schema(description = "The identifier of the notification.") + @NotNull + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public ProductDeleteEvent eventTime(Date eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Time of the event occurrence. + * @return eventTime + **/ + @Schema(description = "Time of the event occurrence.") + @NotNull + + @Valid + public Date getEventTime() { + return eventTime; + } + + public void setEventTime(Date eventTime) { + this.eventTime = eventTime; + } + + public ProductDeleteEvent eventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * The type of the notification. + * @return eventType + **/ + @Schema(description = "The type of the notification.") + @NotNull + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public ProductDeleteEvent correlationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * The correlation id for this event. + * @return correlationId + **/ + @Schema(description = "The correlation id for this event.") + @NotNull + + public String getCorrelationId() { + return correlationId; + } + + public void setCorrelationId(String correlationId) { + this.correlationId = correlationId; + } + + public ProductDeleteEvent domain(String domain) { + this.domain = domain; + return this; + } + + /** + * The domain of the event. + * @return domain + **/ + @Schema(description = "The domain of the event.") + @NotNull + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } + + public ProductDeleteEvent title(String title) { + this.title = title; + return this; + } + + /** + * The title of the event. + * @return title + **/ + @Schema(description = "The title of the event.") + @NotNull + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public ProductDeleteEvent description(String description) { + this.description = description; + return this; + } + + /** + * An explnatory of the event. + * @return description + **/ + @Schema(description = "An explnatory of the event.") + @NotNull + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ProductDeleteEvent priority(String priority) { + this.priority = priority; + return this; + } + + /** + * A priority. + * @return priority + **/ + @Schema(description = "A priority.") + @NotNull + + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public ProductDeleteEvent timeOcurred(Date timeOcurred) { + this.timeOcurred = timeOcurred; + return this; + } + + /** + * The time the event occured. + * @return timeOcurred + **/ + @Schema(description = "The time the event occured.") + @NotNull + + @Valid + public Date getTimeOcurred() { + return timeOcurred; + } + + public void setTimeOcurred(Date timeOcurred) { + this.timeOcurred = timeOcurred; + } + + public ProductDeleteEvent event(ProductDeleteEventPayload event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + **/ + @Schema(description = "") + @NotNull + + @Valid + public ProductDeleteEventPayload getEvent() { + return event; + } + + public void setEvent(ProductDeleteEventPayload event) { + this.event = event; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductDeleteEvent productDeleteEvent = (ProductDeleteEvent) o; + return Objects.equals(this.id, productDeleteEvent.id) && + Objects.equals(this.href, productDeleteEvent.href) && + Objects.equals(this.eventId, productDeleteEvent.eventId) && + Objects.equals(this.eventTime, productDeleteEvent.eventTime) && + Objects.equals(this.eventType, productDeleteEvent.eventType) && + Objects.equals(this.correlationId, productDeleteEvent.correlationId) && + Objects.equals(this.domain, productDeleteEvent.domain) && + Objects.equals(this.title, productDeleteEvent.title) && + Objects.equals(this.description, productDeleteEvent.description) && + Objects.equals(this.priority, productDeleteEvent.priority) && + Objects.equals(this.timeOcurred, productDeleteEvent.timeOcurred) && + Objects.equals(this.event, productDeleteEvent.event); + } + + @Override + public int hashCode() { + return Objects.hash(id, href, eventId, eventTime, eventType, correlationId, domain, title, description, priority, timeOcurred, event); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductDeleteEvent {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" href: ").append(toIndentedString(href)).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(" event: ").append(toIndentedString(event)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductDeleteEventPayload.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductDeleteEventPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..fbe073e74da567fa7cedcf72502ed1b3b91be0bc --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductDeleteEventPayload.java @@ -0,0 +1,81 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * The event data structure + */ +@Schema(description = "The event data structure") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class ProductDeleteEventPayload { + @JsonProperty("product") + private Product product = null; + + public ProductDeleteEventPayload product(Product product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + **/ + @Schema(description = "") + @NotNull + + @Valid + public Product getProduct() { + return product; + } + + public void setProduct(Product product) { + this.product = product; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductDeleteEventPayload productDeleteEventPayload = (ProductDeleteEventPayload) o; + return Objects.equals(this.product, productDeleteEventPayload.product); + } + + @Override + public int hashCode() { + return Objects.hash(product); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductDeleteEventPayload {\n"); + + sb.append(" product: ").append(toIndentedString(product)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductPrice.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductPrice.java similarity index 69% rename from src/main/java/org/etsi/osl/tmf/po622/model/ProductPrice.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/ProductPrice.java index 58f6b58d781a484245c61ca0fb069e5b48133b01..b871aa6db1af9eed1ee245c9454da4044b097a52 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductPrice.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductPrice.java @@ -1,33 +1,20 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Objects; - +import java.util.Set; import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; +import org.etsi.osl.tmf.pcm620.model.ProductOfferingPriceRef; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; @@ -36,13 +23,13 @@ import jakarta.validation.constraints.NotNull; */ @Schema(description = "An amount, usually of money, that represents the actual price paid by a Customer for a purchase, a rent or a lease of a Product. The price is valid for a defined period of time.") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductPrice { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + +@Entity(name = "ProdPrice637") +public class ProductPrice extends BaseRootNamedEntity { @JsonProperty("description") private String description = null; - @JsonProperty("name") - private String name = null; @JsonProperty("priceType") private String priceType = null; @@ -54,26 +41,24 @@ public class ProductPrice { private String unitOfMeasure = null; @JsonProperty("billingAccount") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "billing_acc_refuuid", referencedColumnName = "uuid") private BillingAccountRef billingAccount = null; @JsonProperty("price") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "price_uuid", referencedColumnName = "uuid") private Price price = null; @JsonProperty("productOfferingPrice") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "prodoffprice_refuuid", referencedColumnName = "uuid") private ProductOfferingPriceRef productOfferingPrice = null; @JsonProperty("productPriceAlteration") @Valid - private List productPriceAlteration = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set productPriceAlteration = new HashSet<>(); public ProductPrice description(String description) { this.description = description; @@ -83,9 +68,10 @@ public class ProductPrice { /** * A narrative that explains in detail the semantics of this product price. * @return description - **/ + **/ @Schema(description = "A narrative that explains in detail the semantics of this product price.") - + @NotNull + public String getDescription() { return description; } @@ -102,9 +88,10 @@ public class ProductPrice { /** * A short descriptive name such as \"Subscription price\". * @return name - **/ + **/ @Schema(description = "A short descriptive name such as \"Subscription price\".") - + @NotNull + public String getName() { return name; } @@ -121,8 +108,8 @@ public class ProductPrice { /** * A category that describes the price, such as recurring, discount, allowance, penalty, and so forth. * @return priceType - **/ - @Schema(description = "A category that describes the price, such as recurring, discount, allowance, penalty, and so forth.") + **/ + @Schema(required = true, description = "A category that describes the price, such as recurring, discount, allowance, penalty, and so forth.") @NotNull public String getPriceType() { @@ -141,9 +128,10 @@ public class ProductPrice { /** * Could be month, week... * @return recurringChargePeriod - **/ + **/ @Schema(description = "Could be month, week...") - + @NotNull + public String getRecurringChargePeriod() { return recurringChargePeriod; } @@ -160,9 +148,10 @@ public class ProductPrice { /** * Could be minutes, GB... * @return unitOfMeasure - **/ + **/ @Schema(description = "Could be minutes, GB...") - + @NotNull + public String getUnitOfMeasure() { return unitOfMeasure; } @@ -179,9 +168,10 @@ public class ProductPrice { /** * Get billingAccount * @return billingAccount - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public BillingAccountRef getBillingAccount() { return billingAccount; @@ -199,8 +189,8 @@ public class ProductPrice { /** * Get price * @return price - **/ - @Schema(description = "") + **/ + @Schema(required = true, description = "") @NotNull @Valid @@ -220,9 +210,10 @@ public class ProductPrice { /** * Get productOfferingPrice * @return productOfferingPrice - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public ProductOfferingPriceRef getProductOfferingPrice() { return productOfferingPrice; @@ -232,14 +223,14 @@ public class ProductPrice { this.productOfferingPrice = productOfferingPrice; } - public ProductPrice productPriceAlteration(List productPriceAlteration) { + public ProductPrice productPriceAlteration(Set productPriceAlteration) { this.productPriceAlteration = productPriceAlteration; return this; } public ProductPrice addProductPriceAlterationItem(PriceAlteration productPriceAlterationItem) { if (this.productPriceAlteration == null) { - this.productPriceAlteration = new ArrayList<>(); + this.productPriceAlteration = new HashSet(); } this.productPriceAlteration.add(productPriceAlterationItem); return this; @@ -248,73 +239,19 @@ public class ProductPrice { /** * Get productPriceAlteration * @return productPriceAlteration - **/ + **/ @Schema(description = "") - @Valid - public List getProductPriceAlteration() { + @NotNull + @Valid + public Set getProductPriceAlteration() { return productPriceAlteration; } - public void setProductPriceAlteration(List productPriceAlteration) { + public void setProductPriceAlteration(Set productPriceAlteration) { this.productPriceAlteration = productPriceAlteration; } - public ProductPrice baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public ProductPrice schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public ProductPrice type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } + @Override @@ -337,12 +274,12 @@ public class ProductPrice { Objects.equals(this.productPriceAlteration, productPrice.productPriceAlteration) && Objects.equals(this.baseType, productPrice.baseType) && Objects.equals(this.schemaLocation, productPrice.schemaLocation) && - Objects.equals(this.type, productPrice.type); + Objects.equals(this.baseType, productPrice.baseType); } @Override public int hashCode() { - return Objects.hash(description, name, priceType, recurringChargePeriod, unitOfMeasure, billingAccount, price, productOfferingPrice, productPriceAlteration, baseType, schemaLocation, type); + return Objects.hash(description, name, priceType, recurringChargePeriod, unitOfMeasure, billingAccount, price, productOfferingPrice, productPriceAlteration, baseType, schemaLocation, baseType); } @Override @@ -359,9 +296,9 @@ public class ProductPrice { sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" productOfferingPrice: ").append(toIndentedString(productOfferingPrice)).append("\n"); sb.append(" productPriceAlteration: ").append(toIndentedString(productPriceAlteration)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(baseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(baseType)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductRef.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductRef.java similarity index 54% rename from src/main/java/org/etsi/osl/tmf/po622/model/ProductRef.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/ProductRef.java index 92d6d9cd96796c22a37f4fd2ce577fb14806c7ff..41860d3606a81fca3f9afa7ead7e55fc4859fc13 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductRef.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductRef.java @@ -1,56 +1,25 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** * ProductRef */ @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductRef { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + +@Entity(name = "ProductRef637") +public class ProductRef extends BaseRootNamedEntity { @JsonProperty("id") private String id = null; - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; @JsonProperty("@referredType") private String _atReferredType = null; @@ -63,8 +32,8 @@ public class ProductRef { /** * Unique identifier of a related entity. * @return id - **/ - @Schema(description = "Unique identifier of a related entity.") + **/ + @Schema(required = true, description = "Unique identifier of a related entity.") @NotNull public String getId() { @@ -83,9 +52,10 @@ public class ProductRef { /** * Reference of the related entity. * @return href - **/ + **/ @Schema(description = "Reference of the related entity.") - + @NotNull + public String getHref() { return href; } @@ -102,9 +72,10 @@ public class ProductRef { /** * Name of the related entity. * @return name - **/ + **/ @Schema(description = "Name of the related entity.") - + @NotNull + public String getName() { return name; } @@ -113,62 +84,8 @@ public class ProductRef { this.name = name; } - public ProductRef baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - public String getAtBaseType() { - return baseType; - } - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public ProductRef schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public ProductRef type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } public ProductRef _atReferredType(String _atReferredType) { this._atReferredType = _atReferredType; @@ -178,9 +95,10 @@ public class ProductRef { /** * The actual type of the target instance when needed for disambiguation. * @return _atReferredType - **/ + **/ @Schema(description = "The actual type of the target instance when needed for disambiguation.") - + @NotNull + public String getAtReferredType() { return _atReferredType; } @@ -221,9 +139,9 @@ public class ProductRef { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" href: ").append(toIndentedString(href)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(baseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(type)).append("\n"); sb.append(" _atReferredType: ").append(toIndentedString(_atReferredType)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductRefOrValue.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductRefOrValue.java new file mode 100644 index 0000000000000000000000000000000000000000..c95f059d0594f6e09ab2cb752ff06aa4a65acb27 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductRefOrValue.java @@ -0,0 +1,83 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.etsi.osl.tmf.common.model.service.Characteristic; +import org.etsi.osl.tmf.common.model.service.ResourceRef; +import org.etsi.osl.tmf.common.model.service.ServiceRef; +import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef; +import org.etsi.osl.tmf.pcm620.model.ProductSpecificationRef; +import org.etsi.osl.tmf.po622.model.AgreementItemRef; +import org.etsi.osl.tmf.po622.model.RelatedProductOrderItem; +import org.etsi.osl.tmf.prm669.model.RelatedParty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * A product to be created defined by value or existing defined by reference. The polymorphic + * attributes @type, @schemaLocation & @referredType are related to the product entity and not + * the RelatedProductRefOrValue class itself + */ +@Schema( + description = "A product to be created defined by value or existing defined by reference. The polymorphic attributes @type, @schemaLocation & @referredType are related to the product entity and not the RelatedProductRefOrValue class itself") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", + date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + +@Entity(name = "ProdRefOrVal637") +@JsonIgnoreProperties({"uuid"}) +public class ProductRefOrValue extends Product { + + + @Schema(description = "Unique identifier of the product") + @NotNull + + public String getId() { + if (id == null) { + return super.getId(); + } + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public Characteristic findCharacteristicByName(String aName) { + for (Characteristic c : productCharacteristic) { + if (c.getName().equals(aName)) { + return c; + } + } + + return null; + } + + public Object getRealizingServiceById(@NotNull String id) { + for (ServiceRef sr : realizingService) { + if ( sr.getId().equals(id)) { + return sr; + } + } + return null; + } + + public Object getRealizingResourceById(@NotNull String id) { + for (ResourceRef sr : realizingResource) { + if ( sr.getId().equals(id)) { + return sr; + } + } + return null; + } + + + +} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductRelationship.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductRelationship.java similarity index 54% rename from src/main/java/org/etsi/osl/tmf/po622/model/ProductRelationship.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/ProductRelationship.java index 309c363c0e25411a3456f91e810dce8a6c05eead..331b8fb5070609e14630fdcdb3207301d1033ea1 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductRelationship.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductRelationship.java @@ -1,31 +1,15 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootEntity; +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToOne; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; @@ -34,22 +18,18 @@ import jakarta.validation.constraints.NotNull; */ @Schema(description = "Linked products to the one instantiate, such as [bundled] if the product is a bundle and you want to describe the bundled products inside this bundle; [reliesOn] if the product needs another already owned product to rely on (e.g. an option on an already owned mobile access product) [targets] or [isTargeted] (depending on the way of expressing the link) for any other kind of links that may be useful") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductRelationship { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + +@Entity(name = "ProdRel637") +public class ProductRelationship extends BaseRootEntity { @JsonProperty("relationshipType") private String relationshipType = null; @JsonProperty("product") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "prod_refuuid", referencedColumnName = "uuid") private ProductRefOrValue product = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; public ProductRelationship relationshipType(String relationshipType) { this.relationshipType = relationshipType; @@ -59,8 +39,8 @@ public class ProductRelationship { /** * Type of the product relationship, such as [bundled] if the product is a bundle and you want to describe the bundled products inside this bundle; [reliesOn] if the product needs another already owned product to rely on (e.g. an option on an already owned mobile access product) [targets] or [isTargeted] (depending on the way of expressing the link) for any other kind of links that may be useful * @return relationshipType - **/ - @Schema(description = "Type of the product relationship, such as [bundled] if the product is a bundle and you want to describe the bundled products inside this bundle; [reliesOn] if the product needs another already owned product to rely on (e.g. an option on an already owned mobile access product) [targets] or [isTargeted] (depending on the way of expressing the link) for any other kind of links that may be useful") + **/ + @Schema(required = true, description = "Type of the product relationship, such as [bundled] if the product is a bundle and you want to describe the bundled products inside this bundle; [reliesOn] if the product needs another already owned product to rely on (e.g. an option on an already owned mobile access product) [targets] or [isTargeted] (depending on the way of expressing the link) for any other kind of links that may be useful") @NotNull public String getRelationshipType() { @@ -79,8 +59,8 @@ public class ProductRelationship { /** * Get product * @return product - **/ - @Schema(description = "") + **/ + @Schema(required = true, description = "") @NotNull @Valid @@ -92,62 +72,7 @@ public class ProductRelationship { this.product = product; } - public ProductRelationship baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public ProductRelationship schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public ProductRelationship type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } + @Override @@ -178,9 +103,9 @@ public class ProductRelationship { sb.append(" relationshipType: ").append(toIndentedString(relationshipType)).append("\n"); sb.append(" product: ").append(toIndentedString(product)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(baseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductStateChangeEvent.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductStateChangeEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..a5aa7f6af06ea4e8d869fdd2da77fcb3a77a252b --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductStateChangeEvent.java @@ -0,0 +1,359 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Date; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * The notification data structure + */ +@Schema(description = "The notification data structure") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class ProductStateChangeEvent { + @JsonProperty("id") + private String id = null; + + @JsonProperty("href") + private String href = null; + + @JsonProperty("eventId") + private String eventId = null; + + @JsonProperty("eventTime") + private Date eventTime = null; + + @JsonProperty("eventType") + private String eventType = null; + + @JsonProperty("correlationId") + private String correlationId = null; + + @JsonProperty("domain") + private String domain = null; + + @JsonProperty("title") + private String title = null; + + @JsonProperty("description") + private String description = null; + + @JsonProperty("priority") + private String priority = null; + + @JsonProperty("timeOcurred") + private Date timeOcurred = null; + + @JsonProperty("event") + private ProductStateChangeEventPayload event = null; + + public ProductStateChangeEvent id(String id) { + this.id = id; + return this; + } + + /** + * Identifier of the Process flow + * @return id + **/ + @Schema(description = "Identifier of the Process flow") + @NotNull + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductStateChangeEvent href(String href) { + this.href = href; + return this; + } + + /** + * Reference of the ProcessFlow + * @return href + **/ + @Schema(description = "Reference of the ProcessFlow") + @NotNull + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + public ProductStateChangeEvent eventId(String eventId) { + this.eventId = eventId; + return this; + } + + /** + * The identifier of the notification. + * @return eventId + **/ + @Schema(description = "The identifier of the notification.") + @NotNull + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public ProductStateChangeEvent eventTime(Date eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Time of the event occurrence. + * @return eventTime + **/ + @Schema(description = "Time of the event occurrence.") + @NotNull + + @Valid + public Date getEventTime() { + return eventTime; + } + + public void setEventTime(Date eventTime) { + this.eventTime = eventTime; + } + + public ProductStateChangeEvent eventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * The type of the notification. + * @return eventType + **/ + @Schema(description = "The type of the notification.") + @NotNull + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public ProductStateChangeEvent correlationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * The correlation id for this event. + * @return correlationId + **/ + @Schema(description = "The correlation id for this event.") + @NotNull + + public String getCorrelationId() { + return correlationId; + } + + public void setCorrelationId(String correlationId) { + this.correlationId = correlationId; + } + + public ProductStateChangeEvent domain(String domain) { + this.domain = domain; + return this; + } + + /** + * The domain of the event. + * @return domain + **/ + @Schema(description = "The domain of the event.") + @NotNull + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } + + public ProductStateChangeEvent title(String title) { + this.title = title; + return this; + } + + /** + * The title of the event. + * @return title + **/ + @Schema(description = "The title of the event.") + @NotNull + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public ProductStateChangeEvent description(String description) { + this.description = description; + return this; + } + + /** + * An explnatory of the event. + * @return description + **/ + @Schema(description = "An explnatory of the event.") + @NotNull + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ProductStateChangeEvent priority(String priority) { + this.priority = priority; + return this; + } + + /** + * A priority. + * @return priority + **/ + @Schema(description = "A priority.") + @NotNull + + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public ProductStateChangeEvent timeOcurred(Date timeOcurred) { + this.timeOcurred = timeOcurred; + return this; + } + + /** + * The time the event occured. + * @return timeOcurred + **/ + @Schema(description = "The time the event occured.") + @NotNull + + @Valid + public Date getTimeOcurred() { + return timeOcurred; + } + + public void setTimeOcurred(Date timeOcurred) { + this.timeOcurred = timeOcurred; + } + + public ProductStateChangeEvent event(ProductStateChangeEventPayload event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + **/ + @Schema(description = "") + @NotNull + + @Valid + public ProductStateChangeEventPayload getEvent() { + return event; + } + + public void setEvent(ProductStateChangeEventPayload event) { + this.event = event; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductStateChangeEvent productStateChangeEvent = (ProductStateChangeEvent) o; + return Objects.equals(this.id, productStateChangeEvent.id) && + Objects.equals(this.href, productStateChangeEvent.href) && + Objects.equals(this.eventId, productStateChangeEvent.eventId) && + Objects.equals(this.eventTime, productStateChangeEvent.eventTime) && + Objects.equals(this.eventType, productStateChangeEvent.eventType) && + Objects.equals(this.correlationId, productStateChangeEvent.correlationId) && + Objects.equals(this.domain, productStateChangeEvent.domain) && + Objects.equals(this.title, productStateChangeEvent.title) && + Objects.equals(this.description, productStateChangeEvent.description) && + Objects.equals(this.priority, productStateChangeEvent.priority) && + Objects.equals(this.timeOcurred, productStateChangeEvent.timeOcurred) && + Objects.equals(this.event, productStateChangeEvent.event); + } + + @Override + public int hashCode() { + return Objects.hash(id, href, eventId, eventTime, eventType, correlationId, domain, title, description, priority, timeOcurred, event); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductStateChangeEvent {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" href: ").append(toIndentedString(href)).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(" event: ").append(toIndentedString(event)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductStateChangeEventPayload.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductStateChangeEventPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..a492a3f7a49db34af09a948afd38d280f77316c7 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductStateChangeEventPayload.java @@ -0,0 +1,81 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * The event data structure + */ +@Schema(description = "The event data structure") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class ProductStateChangeEventPayload { + @JsonProperty("product") + private Product product = null; + + public ProductStateChangeEventPayload product(Product product) { + this.product = product; + return this; + } + + /** + * Get product + * @return product + **/ + @Schema(description = "") + @NotNull + + @Valid + public Product getProduct() { + return product; + } + + public void setProduct(Product product) { + this.product = product; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductStateChangeEventPayload productStateChangeEventPayload = (ProductStateChangeEventPayload) o; + return Objects.equals(this.product, productStateChangeEventPayload.product); + } + + @Override + public int hashCode() { + return Objects.hash(product); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductStateChangeEventPayload {\n"); + + sb.append(" product: ").append(toIndentedString(product)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductStatusType.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductStatusType.java new file mode 100644 index 0000000000000000000000000000000000000000..616f74176af27154a9e12ee791aedee55a2fb4f9 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductStatusType.java @@ -0,0 +1,40 @@ +package org.etsi.osl.tmf.pim637.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Possible values for the status of the product + */ +public enum ProductStatusType { + CREATED("CREATED"), + PENDINGACTIVE("PENDINGACTIVE"), + CANCELLED("CANCELLED"), + ACTIVE("ACTIVE"), + PENDINGTERMINATE("PENDINGTERMINATE"), + TERMINATED("TERMINATED"), + SUSPENDED("SUSPENDED"), + ABORTED_("ABORTED_ "); + + private String value; + + ProductStatusType(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProductStatusType fromValue(String text) { + for (ProductStatusType b : ProductStatusType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductTerm.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductTerm.java similarity index 57% rename from src/main/java/org/etsi/osl/tmf/po622/model/ProductTerm.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/ProductTerm.java index b43c08941c5fb2b816d01bad7edbc5b845e2edd5..4207102702166c26b6f10723ed14afdea2f89436 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductTerm.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductTerm.java @@ -1,45 +1,27 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.etsi.osl.tmf.common.model.Quantity; import org.etsi.osl.tmf.common.model.TimePeriod; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.Valid; - +import jakarta.validation.constraints.NotNull; /** * Description of a productTerm linked to this product. This represent a commitment with a duration */ @Schema(description = "Description of a productTerm linked to this product. This represent a commitment with a duration") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductTerm { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + +@Entity(name = "ProdTerm637") +public class ProductTerm extends BaseRootNamedEntity { @JsonProperty("description") private String description = null; - @JsonProperty("name") - private String name = null; @JsonProperty("duration") private Quantity duration = null; @@ -47,15 +29,6 @@ public class ProductTerm { @JsonProperty("validFor") private TimePeriod validFor = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; - public ProductTerm description(String description) { this.description = description; return this; @@ -64,9 +37,10 @@ public class ProductTerm { /** * Description of the productTerm * @return description - **/ + **/ @Schema(description = "Description of the productTerm") - + @NotNull + public String getDescription() { return description; } @@ -83,9 +57,10 @@ public class ProductTerm { /** * Name of the productTerm * @return name - **/ + **/ @Schema(description = "Name of the productTerm") - + @NotNull + public String getName() { return name; } @@ -102,9 +77,10 @@ public class ProductTerm { /** * Get duration * @return duration - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public Quantity getDuration() { return duration; @@ -122,9 +98,10 @@ public class ProductTerm { /** * Get validFor * @return validFor - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public TimePeriod getValidFor() { return validFor; @@ -134,62 +111,7 @@ public class ProductTerm { this.validFor = validFor; } - public ProductTerm baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public ProductTerm schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public ProductTerm type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } @Override @@ -224,9 +146,9 @@ public class ProductTerm { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); sb.append(" validFor: ").append(toIndentedString(validFor)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(baseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductRefOrValue.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductUpdate.java similarity index 59% rename from src/main/java/org/etsi/osl/tmf/po622/model/ProductRefOrValue.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/ProductUpdate.java index c77a6ed7d9376834d228c4e10263436d31d12a96..aff9c7cb50fa722e19ef0dcd5dae6c05b1ad2023 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductRefOrValue.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductUpdate.java @@ -1,50 +1,32 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; -import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; +import org.etsi.osl.tmf.common.model.service.Characteristic; import org.etsi.osl.tmf.common.model.service.ResourceRef; import org.etsi.osl.tmf.common.model.service.ServiceRef; +import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef; +import org.etsi.osl.tmf.pcm620.model.ProductSpecificationRef; +import org.etsi.osl.tmf.po622.model.AgreementItemRef; +import org.etsi.osl.tmf.po622.model.RelatedProductOrderItem; import org.etsi.osl.tmf.prm669.model.RelatedParty; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; /** - * A product to be created defined by value or existing defined by reference. The polymorphic attributes @type, @schemaLocation & @referredType are related to the product entity and not the RelatedProductRefOrValue class itself + * A product offering procured by a customer or other interested party playing a party role. A product is realized as one or more service(s) and / or resource(s). Skipped properties: id,href */ -@Schema(description = "A product to be created defined by value or existing defined by reference. The polymorphic attributes @type, @schemaLocation & @referredType are related to the product entity and not the RelatedProductRefOrValue class itself") +@Schema(description = "A product offering procured by a customer or other interested party playing a party role. A product is realized as one or more service(s) and / or resource(s). Skipped properties: id,href") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductRefOrValue { - @JsonProperty("id") - private String id = null; +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") - @JsonProperty("href") - private String href = null; +public class ProductUpdate { @JsonProperty("description") private String description = null; @@ -58,16 +40,16 @@ public class ProductRefOrValue { private String name = null; @JsonProperty("orderDate") - private OffsetDateTime orderDate = null; + private Date orderDate = null; @JsonProperty("productSerialNumber") private String productSerialNumber = null; @JsonProperty("startDate") - private OffsetDateTime startDate = null; + private Date startDate = null; @JsonProperty("terminationDate") - private OffsetDateTime terminationDate = null; + private Date terminationDate = null; @JsonProperty("agreement") @Valid @@ -126,56 +108,15 @@ public class ProductRefOrValue { private ProductStatusType status = null; @JsonProperty("@baseType") - private String baseType = null; + private String _atBaseType = null; @JsonProperty("@schemaLocation") - private String schemaLocation = null; + private String _atSchemaLocation = null; @JsonProperty("@type") - private String type = null; - - @JsonProperty("@referredType") - private String _atReferredType = null; - - public ProductRefOrValue id(String id) { - this.id = id; - return this; - } - - /** - * Unique identifier of the product - * @return id - **/ - @Schema(description = "Unique identifier of the product") - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ProductRefOrValue href(String href) { - this.href = href; - return this; - } + private String _atType = null; - /** - * Reference of the product - * @return href - **/ - @Schema(description = "Reference of the product") - - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - public ProductRefOrValue description(String description) { + public ProductUpdate description(String description) { this.description = description; return this; } @@ -183,9 +124,10 @@ public class ProductRefOrValue { /** * Is the description of the product. It could be copied from the description of the Product Offering. * @return description - **/ + **/ @Schema(description = "Is the description of the product. It could be copied from the description of the Product Offering.") - + @NotNull + public String getDescription() { return description; } @@ -194,7 +136,7 @@ public class ProductRefOrValue { this.description = description; } - public ProductRefOrValue isBundle(Boolean isBundle) { + public ProductUpdate isBundle(Boolean isBundle) { this.isBundle = isBundle; return this; } @@ -202,9 +144,10 @@ public class ProductRefOrValue { /** * If true, the product is a ProductBundle which is an instantiation of a BundledProductOffering. If false, the product is a ProductComponent which is an instantiation of a SimpleProductOffering. * @return isBundle - **/ + **/ @Schema(description = "If true, the product is a ProductBundle which is an instantiation of a BundledProductOffering. If false, the product is a ProductComponent which is an instantiation of a SimpleProductOffering.") - + @NotNull + public Boolean isIsBundle() { return isBundle; } @@ -213,7 +156,7 @@ public class ProductRefOrValue { this.isBundle = isBundle; } - public ProductRefOrValue isCustomerVisible(Boolean isCustomerVisible) { + public ProductUpdate isCustomerVisible(Boolean isCustomerVisible) { this.isCustomerVisible = isCustomerVisible; return this; } @@ -221,9 +164,10 @@ public class ProductRefOrValue { /** * If true, the product is visible by the customer. * @return isCustomerVisible - **/ + **/ @Schema(description = "If true, the product is visible by the customer.") - + @NotNull + public Boolean isIsCustomerVisible() { return isCustomerVisible; } @@ -232,7 +176,7 @@ public class ProductRefOrValue { this.isCustomerVisible = isCustomerVisible; } - public ProductRefOrValue name(String name) { + public ProductUpdate name(String name) { this.name = name; return this; } @@ -240,9 +184,10 @@ public class ProductRefOrValue { /** * Name of the product. It could be the same as the name of the product offering * @return name - **/ + **/ @Schema(description = "Name of the product. It could be the same as the name of the product offering") - + @NotNull + public String getName() { return name; } @@ -251,7 +196,7 @@ public class ProductRefOrValue { this.name = name; } - public ProductRefOrValue orderDate(OffsetDateTime orderDate) { + public ProductUpdate orderDate(Date orderDate) { this.orderDate = orderDate; return this; } @@ -259,19 +204,20 @@ public class ProductRefOrValue { /** * Is the date when the product was ordered * @return orderDate - **/ + **/ @Schema(description = "Is the date when the product was ordered") - + @NotNull + @Valid - public OffsetDateTime getOrderDate() { + public Date getOrderDate() { return orderDate; } - public void setOrderDate(OffsetDateTime orderDate) { + public void setOrderDate(Date orderDate) { this.orderDate = orderDate; } - public ProductRefOrValue productSerialNumber(String productSerialNumber) { + public ProductUpdate productSerialNumber(String productSerialNumber) { this.productSerialNumber = productSerialNumber; return this; } @@ -279,9 +225,10 @@ public class ProductRefOrValue { /** * Is the serial number for the product. This is typically applicable to tangible products e.g. Broadband Router. * @return productSerialNumber - **/ + **/ @Schema(description = "Is the serial number for the product. This is typically applicable to tangible products e.g. Broadband Router.") - + @NotNull + public String getProductSerialNumber() { return productSerialNumber; } @@ -290,7 +237,7 @@ public class ProductRefOrValue { this.productSerialNumber = productSerialNumber; } - public ProductRefOrValue startDate(OffsetDateTime startDate) { + public ProductUpdate startDate(Date startDate) { this.startDate = startDate; return this; } @@ -298,19 +245,20 @@ public class ProductRefOrValue { /** * Is the date from which the product starts * @return startDate - **/ + **/ @Schema(description = "Is the date from which the product starts") - + @NotNull + @Valid - public OffsetDateTime getStartDate() { + public Date getStartDate() { return startDate; } - public void setStartDate(OffsetDateTime startDate) { + public void setStartDate(Date startDate) { this.startDate = startDate; } - public ProductRefOrValue terminationDate(OffsetDateTime terminationDate) { + public ProductUpdate terminationDate(Date terminationDate) { this.terminationDate = terminationDate; return this; } @@ -318,26 +266,27 @@ public class ProductRefOrValue { /** * Is the date when the product was terminated * @return terminationDate - **/ + **/ @Schema(description = "Is the date when the product was terminated") - + @NotNull + @Valid - public OffsetDateTime getTerminationDate() { + public Date getTerminationDate() { return terminationDate; } - public void setTerminationDate(OffsetDateTime terminationDate) { + public void setTerminationDate(Date terminationDate) { this.terminationDate = terminationDate; } - public ProductRefOrValue agreement(List agreement) { + public ProductUpdate agreement(List agreement) { this.agreement = agreement; return this; } - public ProductRefOrValue addAgreementItem(AgreementItemRef agreementItem) { + public ProductUpdate addAgreementItem(AgreementItemRef agreementItem) { if (this.agreement == null) { - this.agreement = new ArrayList<>(); + this.agreement = new ArrayList(); } this.agreement.add(agreementItem); return this; @@ -346,9 +295,10 @@ public class ProductRefOrValue { /** * Get agreement * @return agreement - **/ + **/ @Schema(description = "") - @Valid + @NotNull + @Valid public List getAgreement() { return agreement; } @@ -357,7 +307,7 @@ public class ProductRefOrValue { this.agreement = agreement; } - public ProductRefOrValue billingAccount(BillingAccountRef billingAccount) { + public ProductUpdate billingAccount(BillingAccountRef billingAccount) { this.billingAccount = billingAccount; return this; } @@ -365,9 +315,10 @@ public class ProductRefOrValue { /** * Get billingAccount * @return billingAccount - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public BillingAccountRef getBillingAccount() { return billingAccount; @@ -377,14 +328,14 @@ public class ProductRefOrValue { this.billingAccount = billingAccount; } - public ProductRefOrValue place(List place) { + public ProductUpdate place(List place) { this.place = place; return this; } - public ProductRefOrValue addPlaceItem(RelatedPlaceRefOrValue placeItem) { + public ProductUpdate addPlaceItem(RelatedPlaceRefOrValue placeItem) { if (this.place == null) { - this.place = new ArrayList<>(); + this.place = new ArrayList(); } this.place.add(placeItem); return this; @@ -393,9 +344,10 @@ public class ProductRefOrValue { /** * Get place * @return place - **/ + **/ @Schema(description = "") - @Valid + @NotNull + @Valid public List getPlace() { return place; } @@ -404,14 +356,14 @@ public class ProductRefOrValue { this.place = place; } - public ProductRefOrValue product(List product) { + public ProductUpdate product(List product) { this.product = product; return this; } - public ProductRefOrValue addProductItem(ProductRefOrValue productItem) { + public ProductUpdate addProductItem(ProductRefOrValue productItem) { if (this.product == null) { - this.product = new ArrayList<>(); + this.product = new ArrayList(); } this.product.add(productItem); return this; @@ -420,9 +372,10 @@ public class ProductRefOrValue { /** * Get product * @return product - **/ + **/ @Schema(description = "") - @Valid + @NotNull + @Valid public List getProduct() { return product; } @@ -431,14 +384,14 @@ public class ProductRefOrValue { this.product = product; } - public ProductRefOrValue productCharacteristic(List productCharacteristic) { + public ProductUpdate productCharacteristic(List productCharacteristic) { this.productCharacteristic = productCharacteristic; return this; } - public ProductRefOrValue addProductCharacteristicItem(Characteristic productCharacteristicItem) { + public ProductUpdate addProductCharacteristicItem(Characteristic productCharacteristicItem) { if (this.productCharacteristic == null) { - this.productCharacteristic = new ArrayList<>(); + this.productCharacteristic = new ArrayList(); } this.productCharacteristic.add(productCharacteristicItem); return this; @@ -447,9 +400,10 @@ public class ProductRefOrValue { /** * Get productCharacteristic * @return productCharacteristic - **/ + **/ @Schema(description = "") - @Valid + @NotNull + @Valid public List getProductCharacteristic() { return productCharacteristic; } @@ -458,7 +412,7 @@ public class ProductRefOrValue { this.productCharacteristic = productCharacteristic; } - public ProductRefOrValue productOffering(ProductOfferingRef productOffering) { + public ProductUpdate productOffering(ProductOfferingRef productOffering) { this.productOffering = productOffering; return this; } @@ -466,9 +420,10 @@ public class ProductRefOrValue { /** * Get productOffering * @return productOffering - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public ProductOfferingRef getProductOffering() { return productOffering; @@ -478,14 +433,14 @@ public class ProductRefOrValue { this.productOffering = productOffering; } - public ProductRefOrValue productOrderItem(List productOrderItem) { + public ProductUpdate productOrderItem(List productOrderItem) { this.productOrderItem = productOrderItem; return this; } - public ProductRefOrValue addProductOrderItemItem(RelatedProductOrderItem productOrderItemItem) { + public ProductUpdate addProductOrderItemItem(RelatedProductOrderItem productOrderItemItem) { if (this.productOrderItem == null) { - this.productOrderItem = new ArrayList<>(); + this.productOrderItem = new ArrayList(); } this.productOrderItem.add(productOrderItemItem); return this; @@ -494,9 +449,10 @@ public class ProductRefOrValue { /** * Get productOrderItem * @return productOrderItem - **/ + **/ @Schema(description = "") - @Valid + @NotNull + @Valid public List getProductOrderItem() { return productOrderItem; } @@ -505,14 +461,14 @@ public class ProductRefOrValue { this.productOrderItem = productOrderItem; } - public ProductRefOrValue productPrice(List productPrice) { + public ProductUpdate productPrice(List productPrice) { this.productPrice = productPrice; return this; } - public ProductRefOrValue addProductPriceItem(ProductPrice productPriceItem) { + public ProductUpdate addProductPriceItem(ProductPrice productPriceItem) { if (this.productPrice == null) { - this.productPrice = new ArrayList<>(); + this.productPrice = new ArrayList(); } this.productPrice.add(productPriceItem); return this; @@ -521,9 +477,10 @@ public class ProductRefOrValue { /** * Get productPrice * @return productPrice - **/ + **/ @Schema(description = "") - @Valid + @NotNull + @Valid public List getProductPrice() { return productPrice; } @@ -532,14 +489,14 @@ public class ProductRefOrValue { this.productPrice = productPrice; } - public ProductRefOrValue productRelationship(List productRelationship) { + public ProductUpdate productRelationship(List productRelationship) { this.productRelationship = productRelationship; return this; } - public ProductRefOrValue addProductRelationshipItem(ProductRelationship productRelationshipItem) { + public ProductUpdate addProductRelationshipItem(ProductRelationship productRelationshipItem) { if (this.productRelationship == null) { - this.productRelationship = new ArrayList<>(); + this.productRelationship = new ArrayList(); } this.productRelationship.add(productRelationshipItem); return this; @@ -548,9 +505,10 @@ public class ProductRefOrValue { /** * Get productRelationship * @return productRelationship - **/ + **/ @Schema(description = "") - @Valid + @NotNull + @Valid public List getProductRelationship() { return productRelationship; } @@ -559,7 +517,7 @@ public class ProductRefOrValue { this.productRelationship = productRelationship; } - public ProductRefOrValue productSpecification(ProductSpecificationRef productSpecification) { + public ProductUpdate productSpecification(ProductSpecificationRef productSpecification) { this.productSpecification = productSpecification; return this; } @@ -567,9 +525,10 @@ public class ProductRefOrValue { /** * Get productSpecification * @return productSpecification - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public ProductSpecificationRef getProductSpecification() { return productSpecification; @@ -579,14 +538,14 @@ public class ProductRefOrValue { this.productSpecification = productSpecification; } - public ProductRefOrValue productTerm(List productTerm) { + public ProductUpdate productTerm(List productTerm) { this.productTerm = productTerm; return this; } - public ProductRefOrValue addProductTermItem(ProductTerm productTermItem) { + public ProductUpdate addProductTermItem(ProductTerm productTermItem) { if (this.productTerm == null) { - this.productTerm = new ArrayList<>(); + this.productTerm = new ArrayList(); } this.productTerm.add(productTermItem); return this; @@ -595,9 +554,10 @@ public class ProductRefOrValue { /** * Get productTerm * @return productTerm - **/ + **/ @Schema(description = "") - @Valid + @NotNull + @Valid public List getProductTerm() { return productTerm; } @@ -606,14 +566,14 @@ public class ProductRefOrValue { this.productTerm = productTerm; } - public ProductRefOrValue realizingResource(List realizingResource) { + public ProductUpdate realizingResource(List realizingResource) { this.realizingResource = realizingResource; return this; } - public ProductRefOrValue addRealizingResourceItem(ResourceRef realizingResourceItem) { + public ProductUpdate addRealizingResourceItem(ResourceRef realizingResourceItem) { if (this.realizingResource == null) { - this.realizingResource = new ArrayList<>(); + this.realizingResource = new ArrayList(); } this.realizingResource.add(realizingResourceItem); return this; @@ -622,9 +582,10 @@ public class ProductRefOrValue { /** * Get realizingResource * @return realizingResource - **/ + **/ @Schema(description = "") - @Valid + @NotNull + @Valid public List getRealizingResource() { return realizingResource; } @@ -633,14 +594,14 @@ public class ProductRefOrValue { this.realizingResource = realizingResource; } - public ProductRefOrValue realizingService(List realizingService) { + public ProductUpdate realizingService(List realizingService) { this.realizingService = realizingService; return this; } - public ProductRefOrValue addRealizingServiceItem(ServiceRef realizingServiceItem) { + public ProductUpdate addRealizingServiceItem(ServiceRef realizingServiceItem) { if (this.realizingService == null) { - this.realizingService = new ArrayList<>(); + this.realizingService = new ArrayList(); } this.realizingService.add(realizingServiceItem); return this; @@ -649,9 +610,10 @@ public class ProductRefOrValue { /** * Get realizingService * @return realizingService - **/ + **/ @Schema(description = "") - @Valid + @NotNull + @Valid public List getRealizingService() { return realizingService; } @@ -660,14 +622,14 @@ public class ProductRefOrValue { this.realizingService = realizingService; } - public ProductRefOrValue relatedParty(List relatedParty) { + public ProductUpdate relatedParty(List relatedParty) { this.relatedParty = relatedParty; return this; } - public ProductRefOrValue addRelatedPartyItem(RelatedParty relatedPartyItem) { + public ProductUpdate addRelatedPartyItem(RelatedParty relatedPartyItem) { if (this.relatedParty == null) { - this.relatedParty = new ArrayList<>(); + this.relatedParty = new ArrayList(); } this.relatedParty.add(relatedPartyItem); return this; @@ -676,9 +638,10 @@ public class ProductRefOrValue { /** * Get relatedParty * @return relatedParty - **/ + **/ @Schema(description = "") - @Valid + @NotNull + @Valid public List getRelatedParty() { return relatedParty; } @@ -687,7 +650,7 @@ public class ProductRefOrValue { this.relatedParty = relatedParty; } - public ProductRefOrValue status(ProductStatusType status) { + public ProductUpdate status(ProductStatusType status) { this.status = status; return this; } @@ -695,9 +658,10 @@ public class ProductRefOrValue { /** * Get status * @return status - **/ + **/ @Schema(description = "") - + @NotNull + @Valid public ProductStatusType getStatus() { return status; @@ -707,80 +671,64 @@ public class ProductRefOrValue { this.status = status; } - public ProductRefOrValue baseType(String baseType) { - this.baseType = baseType; + public ProductUpdate _atBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; return this; } /** * When sub-classing, this defines the super-class - * @return baseType - **/ + * @return _atBaseType + **/ @Schema(description = "When sub-classing, this defines the super-class") - + @NotNull + public String getAtBaseType() { - return baseType; + return _atBaseType; } - public void setAtBaseType(String baseType) { - this.baseType = baseType; + public void setAtBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; } - public ProductRefOrValue schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; + public ProductUpdate _atSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; return this; } /** * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ + * @return _atSchemaLocation + **/ @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - + @NotNull + public String getAtSchemaLocation() { - return schemaLocation; + return _atSchemaLocation; } - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; + public void setAtSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; } - public ProductRefOrValue type(String type) { - this.type = type; + public ProductUpdate _atType(String _atType) { + this._atType = _atType; return this; } /** * When sub-classing, this defines the sub-class entity name - * @return type - **/ + * @return _atType + **/ @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } + @NotNull - public void setAtType(String type) { - this.type = type; - } - - public ProductRefOrValue _atReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; - return this; - } - - /** - * The actual type of the target instance when needed for disambiguation. - * @return _atReferredType - **/ - @Schema(description = "The actual type of the target instance when needed for disambiguation.") - - public String getAtReferredType() { - return _atReferredType; + public String getAtType() { + return _atType; } - public void setAtReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; + public void setAtType(String _atType) { + this._atType = _atType; } @@ -792,50 +740,45 @@ public class ProductRefOrValue { if (o == null || getClass() != o.getClass()) { return false; } - ProductRefOrValue productRefOrValue = (ProductRefOrValue) o; - return Objects.equals(this.id, productRefOrValue.id) && - Objects.equals(this.href, productRefOrValue.href) && - Objects.equals(this.description, productRefOrValue.description) && - Objects.equals(this.isBundle, productRefOrValue.isBundle) && - Objects.equals(this.isCustomerVisible, productRefOrValue.isCustomerVisible) && - Objects.equals(this.name, productRefOrValue.name) && - Objects.equals(this.orderDate, productRefOrValue.orderDate) && - Objects.equals(this.productSerialNumber, productRefOrValue.productSerialNumber) && - Objects.equals(this.startDate, productRefOrValue.startDate) && - Objects.equals(this.terminationDate, productRefOrValue.terminationDate) && - Objects.equals(this.agreement, productRefOrValue.agreement) && - Objects.equals(this.billingAccount, productRefOrValue.billingAccount) && - Objects.equals(this.place, productRefOrValue.place) && - Objects.equals(this.product, productRefOrValue.product) && - Objects.equals(this.productCharacteristic, productRefOrValue.productCharacteristic) && - Objects.equals(this.productOffering, productRefOrValue.productOffering) && - Objects.equals(this.productOrderItem, productRefOrValue.productOrderItem) && - Objects.equals(this.productPrice, productRefOrValue.productPrice) && - Objects.equals(this.productRelationship, productRefOrValue.productRelationship) && - Objects.equals(this.productSpecification, productRefOrValue.productSpecification) && - Objects.equals(this.productTerm, productRefOrValue.productTerm) && - Objects.equals(this.realizingResource, productRefOrValue.realizingResource) && - Objects.equals(this.realizingService, productRefOrValue.realizingService) && - Objects.equals(this.relatedParty, productRefOrValue.relatedParty) && - Objects.equals(this.status, productRefOrValue.status) && - Objects.equals(this.baseType, productRefOrValue.baseType) && - Objects.equals(this.schemaLocation, productRefOrValue.schemaLocation) && - Objects.equals(this.type, productRefOrValue.type) && - Objects.equals(this._atReferredType, productRefOrValue._atReferredType); + ProductUpdate productUpdate = (ProductUpdate) o; + return Objects.equals(this.description, productUpdate.description) && + Objects.equals(this.isBundle, productUpdate.isBundle) && + Objects.equals(this.isCustomerVisible, productUpdate.isCustomerVisible) && + Objects.equals(this.name, productUpdate.name) && + Objects.equals(this.orderDate, productUpdate.orderDate) && + Objects.equals(this.productSerialNumber, productUpdate.productSerialNumber) && + Objects.equals(this.startDate, productUpdate.startDate) && + Objects.equals(this.terminationDate, productUpdate.terminationDate) && + Objects.equals(this.agreement, productUpdate.agreement) && + Objects.equals(this.billingAccount, productUpdate.billingAccount) && + Objects.equals(this.place, productUpdate.place) && + Objects.equals(this.product, productUpdate.product) && + Objects.equals(this.productCharacteristic, productUpdate.productCharacteristic) && + Objects.equals(this.productOffering, productUpdate.productOffering) && + Objects.equals(this.productOrderItem, productUpdate.productOrderItem) && + Objects.equals(this.productPrice, productUpdate.productPrice) && + Objects.equals(this.productRelationship, productUpdate.productRelationship) && + Objects.equals(this.productSpecification, productUpdate.productSpecification) && + Objects.equals(this.productTerm, productUpdate.productTerm) && + Objects.equals(this.realizingResource, productUpdate.realizingResource) && + Objects.equals(this.realizingService, productUpdate.realizingService) && + Objects.equals(this.relatedParty, productUpdate.relatedParty) && + Objects.equals(this.status, productUpdate.status) && + Objects.equals(this._atBaseType, productUpdate._atBaseType) && + Objects.equals(this._atSchemaLocation, productUpdate._atSchemaLocation) && + Objects.equals(this._atType, productUpdate._atType); } @Override public int hashCode() { - return Objects.hash(id, href, description, isBundle, isCustomerVisible, name, orderDate, productSerialNumber, startDate, terminationDate, agreement, billingAccount, place, product, productCharacteristic, productOffering, productOrderItem, productPrice, productRelationship, productSpecification, productTerm, realizingResource, realizingService, relatedParty, status, baseType, schemaLocation, type, _atReferredType); + return Objects.hash(description, isBundle, isCustomerVisible, name, orderDate, productSerialNumber, startDate, terminationDate, agreement, billingAccount, place, product, productCharacteristic, productOffering, productOrderItem, productPrice, productRelationship, productSpecification, productTerm, realizingResource, realizingService, relatedParty, status, _atBaseType, _atSchemaLocation, _atType); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ProductRefOrValue {\n"); + sb.append("class ProductUpdate {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" href: ").append(toIndentedString(href)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" isBundle: ").append(toIndentedString(isBundle)).append("\n"); sb.append(" isCustomerVisible: ").append(toIndentedString(isCustomerVisible)).append("\n"); @@ -859,10 +802,9 @@ public class ProductRefOrValue { sb.append(" realizingService: ").append(toIndentedString(realizingService)).append("\n"); sb.append(" relatedParty: ").append(toIndentedString(relatedParty)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" _atReferredType: ").append(toIndentedString(_atReferredType)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(_atBaseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(_atSchemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(_atType)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/RelatedPlaceRefOrValue.java b/src/main/java/org/etsi/osl/tmf/pim637/model/RelatedPlaceRefOrValue.java similarity index 60% rename from src/main/java/org/etsi/osl/tmf/po622/model/RelatedPlaceRefOrValue.java rename to src/main/java/org/etsi/osl/tmf/pim637/model/RelatedPlaceRefOrValue.java index 36ef6140ce63b69f063dac3326baf0fc4e330319..ccdae2577800303eb0ab94568502f92ce399e113 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/RelatedPlaceRefOrValue.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/RelatedPlaceRefOrValue.java @@ -1,31 +1,11 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; +package org.etsi.osl.tmf.pim637.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -33,29 +13,17 @@ import jakarta.validation.constraints.NotNull; */ @Schema(description = "Related Entity reference. A related place defines a place described by reference or by value linked to a specific entity. The polymorphic attributes @type, @schemaLocation & @referredType are related to the place entity and not the RelatedPlaceRefOrValue class itself") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class RelatedPlaceRefOrValue { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + +@Entity(name = "RelPlaceROrV637") +public class RelatedPlaceRefOrValue extends BaseRootNamedEntity { @JsonProperty("id") private String id = null; - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; @JsonProperty("role") private String role = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; - @JsonProperty("@referredType") private String _atReferredType = null; @@ -67,9 +35,10 @@ public class RelatedPlaceRefOrValue { /** * Unique identifier of the place * @return id - **/ + **/ @Schema(description = "Unique identifier of the place") - + @NotNull + public String getId() { return id; } @@ -86,9 +55,10 @@ public class RelatedPlaceRefOrValue { /** * Unique reference of the place * @return href - **/ + **/ @Schema(description = "Unique reference of the place") - + @NotNull + public String getHref() { return href; } @@ -105,9 +75,10 @@ public class RelatedPlaceRefOrValue { /** * A user-friendly name for the place, such as [Paris Store], [London Store], [Main Home] * @return name - **/ + **/ @Schema(description = "A user-friendly name for the place, such as [Paris Store], [London Store], [Main Home]") - + @NotNull + public String getName() { return name; } @@ -124,8 +95,8 @@ public class RelatedPlaceRefOrValue { /** * Get role * @return role - **/ - @Schema(description = "") + **/ + @Schema(required = true, description = "") @NotNull public String getRole() { @@ -136,74 +107,15 @@ public class RelatedPlaceRefOrValue { this.role = role; } - public RelatedPlaceRefOrValue baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public RelatedPlaceRefOrValue schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public RelatedPlaceRefOrValue type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } - - public RelatedPlaceRefOrValue _atReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; - return this; - } /** * The actual type of the target instance when needed for disambiguation. * @return _atReferredType - **/ + **/ @Schema(description = "The actual type of the target instance when needed for disambiguation.") - + @NotNull + public String getAtReferredType() { return _atReferredType; } @@ -246,9 +158,9 @@ public class RelatedPlaceRefOrValue { sb.append(" href: ").append(toIndentedString(href)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _atBaseType: ").append(toIndentedString(baseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(type)).append("\n"); sb.append(" _atReferredType: ").append(toIndentedString(_atReferredType)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/TargetProductSchema.java b/src/main/java/org/etsi/osl/tmf/pim637/model/TargetProductSchema.java new file mode 100644 index 0000000000000000000000000000000000000000..c0659e59482c6bc65814294b46cae1aa99d396e6 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/TargetProductSchema.java @@ -0,0 +1,129 @@ +package org.etsi.osl.tmf.pim637.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +/** + * The reference object to the schema and type of target product which is described by product specification + */ +@Schema(description = "The reference object to the schema and type of target product which is described by product specification") +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") + + +public class TargetProductSchema { + @JsonProperty("@baseType") + private String _atBaseType = null; + + @JsonProperty("@schemaLocation") + private String _atSchemaLocation = null; + + @JsonProperty("@type") + private String _atType = null; + + public TargetProductSchema _atBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; + return this; + } + + /** + * When sub-classing, this defines the super-class + * @return _atBaseType + **/ + @Schema(description = "When sub-classing, this defines the super-class") + @NotNull + + public String getAtBaseType() { + return _atBaseType; + } + + public void setAtBaseType(String _atBaseType) { + this._atBaseType = _atBaseType; + } + + public TargetProductSchema _atSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; + return this; + } + + /** + * This field provides a link to the schema describing the target product + * @return _atSchemaLocation + **/ + @Schema(required = true, description = "This field provides a link to the schema describing the target product") + @NotNull + + public String getAtSchemaLocation() { + return _atSchemaLocation; + } + + public void setAtSchemaLocation(String _atSchemaLocation) { + this._atSchemaLocation = _atSchemaLocation; + } + + public TargetProductSchema _atType(String _atType) { + this._atType = _atType; + return this; + } + + /** + * Class type of the target product + * @return _atType + **/ + @Schema(required = true, description = "Class type of the target product") + @NotNull + + public String getAtType() { + return _atType; + } + + public void setAtType(String _atType) { + this._atType = _atType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TargetProductSchema targetProductSchema = (TargetProductSchema) o; + return Objects.equals(this._atBaseType, targetProductSchema._atBaseType) && + Objects.equals(this._atSchemaLocation, targetProductSchema._atSchemaLocation) && + Objects.equals(this._atType, targetProductSchema._atType); + } + + @Override + public int hashCode() { + return Objects.hash(_atBaseType, _atSchemaLocation, _atType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TargetProductSchema {\n"); + + sb.append(" _atBaseType: ").append(toIndentedString(_atBaseType)).append("\n"); + sb.append(" _atSchemaLocation: ").append(toIndentedString(_atSchemaLocation)).append("\n"); + sb.append(" _atType: ").append(toIndentedString(_atType)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/AgreementItemRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/AgreementItemRef.java index 73de8611b1ece90f3ec9e20fe7c527b606287478..f4c8d6a2a16a87da97a2dccd454dd2c5aaadb258 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/AgreementItemRef.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/AgreementItemRef.java @@ -20,12 +20,11 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -34,27 +33,14 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "Agreement reference. An agreement represents a contract or arrangement, either written or verbal and sometimes enforceable by law, such as a service level agreement or a customer price agreement. An agreement involves a number of other business entities, such as products, services, and resources and/or their specifications.") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class AgreementItemRef { +@Entity(name = "AgrItemRef622") +public class AgreementItemRef extends BaseRootNamedEntity { @JsonProperty("id") private String id = null; - @JsonProperty("href") - private String href = null; - @JsonProperty("agreementItemId") private String agreementItemId = null; - @JsonProperty("name") - private String name = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; @JsonProperty("@referredType") private String _atReferredType = null; @@ -79,119 +65,7 @@ public class AgreementItemRef { this.id = id; } - public AgreementItemRef href(String href) { - this.href = href; - return this; - } - - /** - * Reference of the related entity. - * @return href - **/ - @Schema(description = "Reference of the related entity.") - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - public AgreementItemRef agreementItemId(String agreementItemId) { - this.agreementItemId = agreementItemId; - return this; - } - - /** - * Identifier of the agreement - * @return agreementItemId - **/ - @Schema(description = "Identifier of the agreement") - - public String getAgreementItemId() { - return agreementItemId; - } - - public void setAgreementItemId(String agreementItemId) { - this.agreementItemId = agreementItemId; - } - - public AgreementItemRef name(String name) { - this.name = name; - return this; - } - - /** - * Name of the related entity. - * @return name - **/ - @Schema(description = "Name of the related entity.") - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public AgreementItemRef baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public AgreementItemRef schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public AgreementItemRef type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } public AgreementItemRef _atReferredType(String _atReferredType) { this._atReferredType = _atReferredType; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/AgreementRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/AgreementRef.java index c729d633d433442643f981874999b6fbd13d92b8..b73098707710b58bddef9ff048e87a0927604abc 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/AgreementRef.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/AgreementRef.java @@ -20,12 +20,11 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -34,24 +33,11 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "Agreement reference. An agreement represents a contract or arrangement, either written or verbal and sometimes enforceable by law, such as a service level agreement or a customer price agreement. An agreement involves a number of other business entities, such as products, services, and resources and/or their specifications.") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class AgreementRef { +@Entity(name = "AgrRef622") +public class AgreementRef extends BaseRootNamedEntity { @JsonProperty("id") private String id = null; - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; @JsonProperty("@referredType") private String _atReferredType = null; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/Any.java b/src/main/java/org/etsi/osl/tmf/po622/model/Any.java index 836730781fb2b5198759302676013fec36be4607..822f9aa72ae6502993b89dcd6e97a5bdeefd9720 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/Any.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/Any.java @@ -20,7 +20,6 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import org.springframework.validation.annotation.Validated; /** diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/AppointmentRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/AppointmentRef.java index 44e145e39b1c2156681b7699e5ee4e72dbde030a..5273f1f1a394bb6c9fcaeb995de7a9afcd41945b 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/AppointmentRef.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/AppointmentRef.java @@ -20,12 +20,12 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootEntity; +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -34,25 +34,15 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "Refers an appointment, such as a Customer presentation or internal meeting or site visit") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class AppointmentRef { +@Entity(name = "AppointmentRef622") +public class AppointmentRef extends BaseRootEntity { + @JsonProperty("id") private String id = null; - - @JsonProperty("href") - private String href = null; - + @JsonProperty("description") private String description = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; - @JsonProperty("@referredType") private String _atReferredType = null; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/CancelOrder.java b/src/main/java/org/etsi/osl/tmf/po622/model/CancelOrder.java index c431bb56a9f38832339da33825cf3a6b731ceb9b..24571b80de5a0072f7cc0549db014734ea5d139e 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/CancelOrder.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/CancelOrder.java @@ -21,11 +21,8 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrder.java b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrder.java index 6a6ac36680f7e11d58ac5b5bc133bbe3427b121c..72083e646b25ab03ef7f7a70788edcf34df610de 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrder.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrder.java @@ -21,11 +21,8 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreate.java b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreate.java index 018dda099b7dc16bf7e336e11dad75fa4ded6bae..4cd79a75db832a9e44944fc8535dc7aad9dd0465 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreate.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreate.java @@ -21,11 +21,8 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreateEvent.java b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreateEvent.java index 59d42a223d8dcf9be83d3d58ebf2c928a2b59c2f..f2ca2027e8a5126afc8196b82dc51efbcc20c6cf 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreateEvent.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreateEvent.java @@ -21,11 +21,8 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreateEventPayload.java b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreateEventPayload.java index 86c4ec665d8d1621ee40abc373aca724ace10748..f0454d8a0af088fbadc4806d616d92b17641e7b4 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreateEventPayload.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderCreateEventPayload.java @@ -20,11 +20,8 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderInformationRequiredEvent.java b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderInformationRequiredEvent.java index fd6e530f456b2f8835f760d9527aa4b33b7d2ef6..898aee36327ee245c988ff075cff5dddd96f0e16 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderInformationRequiredEvent.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderInformationRequiredEvent.java @@ -21,11 +21,8 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderInformationRequiredEventPayload.java b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderInformationRequiredEventPayload.java index 75bf9e5c494a3fad81630aa5a4108a950133852c..739c278ecb728386026698d37597485258080ef3 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderInformationRequiredEventPayload.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderInformationRequiredEventPayload.java @@ -20,11 +20,8 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderStateChangeEvent.java b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderStateChangeEvent.java index c0280f588b97658958bd157e3a55b9c42adc313a..0702f78c3ebf972774316e0eeb71dc6699ba0876 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderStateChangeEvent.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderStateChangeEvent.java @@ -21,11 +21,8 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderStateChangeEventPayload.java b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderStateChangeEventPayload.java index dde76f6dedf5ced053fee627558b3b944989b302..ff5831c19f975da6fbcfe2fd292ab08edbc3b644 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderStateChangeEventPayload.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/CancelProductOrderStateChangeEventPayload.java @@ -20,11 +20,8 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/Characteristic.java b/src/main/java/org/etsi/osl/tmf/po622/model/Characteristic.java deleted file mode 100644 index d709b73f6509d496f47936f3bea84dec2350548e..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/po622/model/Characteristic.java +++ /dev/null @@ -1,222 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; - -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.springframework.validation.annotation.Validated; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; - -/** - * Describes a given characteristic of an object or entity through a name/value pair. - */ -@Schema(description = "Describes a given characteristic of an object or entity through a name/value pair.") -@Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class Characteristic { - @JsonProperty("name") - private String name = null; - - @JsonProperty("valueType") - private String valueType = null; - - @JsonProperty("value") - private Any value = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; - - public Characteristic name(String name) { - this.name = name; - return this; - } - - /** - * Name of the characteristic - * @return name - **/ - @Schema(description = "Name of the characteristic") - @NotNull - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Characteristic valueType(String valueType) { - this.valueType = valueType; - return this; - } - - /** - * Data type of the value of the characteristic - * @return valueType - **/ - @Schema(description = "Data type of the value of the characteristic") - - public String getValueType() { - return valueType; - } - - public void setValueType(String valueType) { - this.valueType = valueType; - } - - public Characteristic value(Any value) { - this.value = value; - return this; - } - - /** - * Get value - * @return value - **/ - @Schema(description = "") - @NotNull - - @Valid - public Any getValue() { - return value; - } - - public void setValue(Any value) { - this.value = value; - } - - public Characteristic baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public Characteristic schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public Characteristic type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Characteristic characteristic = (Characteristic) o; - return Objects.equals(this.name, characteristic.name) && - Objects.equals(this.valueType, characteristic.valueType) && - Objects.equals(this.value, characteristic.value) && - Objects.equals(this.baseType, characteristic.baseType) && - Objects.equals(this.schemaLocation, characteristic.schemaLocation) && - Objects.equals(this.type, characteristic.type); - } - - @Override - public int hashCode() { - return Objects.hash(name, valueType, value, baseType, schemaLocation, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Characteristic {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" valueType: ").append(toIndentedString(valueType)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/OrderItemActionType.java b/src/main/java/org/etsi/osl/tmf/po622/model/OrderItemActionType.java index f9477f20bde99bbf8f17476e4fc68a8c96e40692..30871bb4ca537527212f2b54ed6ef55bda2ed8ac 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/OrderItemActionType.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/OrderItemActionType.java @@ -26,10 +26,10 @@ import com.fasterxml.jackson.annotation.JsonValue; * action to be performed on the product */ public enum OrderItemActionType { - ADD("add"), - MODIFY("modify"), - DELETE("delete"), - NOCHANGE("noChange"); + ADD("ADD"), + MODIFY("MODIFY"), + DELETE("DELETE"), + NOCHANGE("NOCHANGE"); private String value; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/OrderItemRelationship.java b/src/main/java/org/etsi/osl/tmf/po622/model/OrderItemRelationship.java index 9ab03386297d958d21bc33f8409754929208a4d2..5e786ab9832ef04c0e6242c15ab093e4d54b1815 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/OrderItemRelationship.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/OrderItemRelationship.java @@ -20,33 +20,26 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; /** * OrderItemRelationship */ @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class OrderItemRelationship { +@Entity(name = "OrderItemRel") +public class OrderItemRelationship extends BaseRootEntity { @JsonProperty("id") private String id = null; @JsonProperty("relationshipType") private String relationshipType = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - @JsonProperty("@type") - private String type = null; public OrderItemRelationship id(String id) { this.id = id; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/OrderPrice.java b/src/main/java/org/etsi/osl/tmf/po622/model/OrderPrice.java index ec9f853c6460e70beb1e3cf11aa5c8141d94a459..992572d12f2f0e3c265778a31853e483f78677c0 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/OrderPrice.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/OrderPrice.java @@ -20,14 +20,25 @@ package org.etsi.osl.tmf.po622.model; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Objects; - +import java.util.Set; import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; +import org.etsi.osl.tmf.pcm620.model.ProductOfferingPriceRef; +import org.etsi.osl.tmf.pim637.model.BillingAccountRef; +import org.etsi.osl.tmf.pim637.model.Price; +import org.etsi.osl.tmf.pim637.model.PriceAlteration; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Lob; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; import jakarta.validation.Valid; /** @@ -36,13 +47,14 @@ import jakarta.validation.Valid; @Schema(description = "An amount, usually of money, that represents the actual price paid by the Customer for this item or this order") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class OrderPrice { +@Entity(name = "OrderPrice622") +public class OrderPrice extends BaseRootNamedEntity { + + @Lob + @Column(name = "LDESCRIPTION", columnDefinition = "LONGTEXT") @JsonProperty("description") private String description = null; - @JsonProperty("name") - private String name = null; - @JsonProperty("priceType") private String priceType = null; @@ -53,26 +65,25 @@ public class OrderPrice { private String unitOfMeasure = null; @JsonProperty("billingAccount") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "billing_acc_refuuid", referencedColumnName = "uuid") private BillingAccountRef billingAccount = null; @JsonProperty("price") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "price_uuid", referencedColumnName = "uuid") private Price price = null; @JsonProperty("priceAlteration") @Valid - private List priceAlteration = null; + @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private Set priceAlteration = new HashSet<>(); @JsonProperty("productOfferingPrice") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "productOffPr_refuuid", referencedColumnName = "uuid") private ProductOfferingPriceRef productOfferingPrice = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; public OrderPrice description(String description) { this.description = description; @@ -209,14 +220,14 @@ public class OrderPrice { this.price = price; } - public OrderPrice priceAlteration(List priceAlteration) { + public OrderPrice priceAlteration(Set priceAlteration) { this.priceAlteration = priceAlteration; return this; } public OrderPrice addPriceAlterationItem(PriceAlteration priceAlterationItem) { if (this.priceAlteration == null) { - this.priceAlteration = new ArrayList<>(); + this.priceAlteration = new HashSet<>(); } this.priceAlteration.add(priceAlterationItem); return this; @@ -228,11 +239,11 @@ public class OrderPrice { **/ @Schema(description = "a strucuture used to describe a price alteration") @Valid - public List getPriceAlteration() { + public Set getPriceAlteration() { return priceAlteration; } - public void setPriceAlteration(List priceAlteration) { + public void setPriceAlteration(Set priceAlteration) { this.priceAlteration = priceAlteration; } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/OrderTerm.java b/src/main/java/org/etsi/osl/tmf/po622/model/OrderTerm.java index 999b3db254896118e93a69f90b8c4b553838d8aa..ff34691bbf333e59c044790cf4de680cc75ebb0e 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/OrderTerm.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/OrderTerm.java @@ -20,11 +20,14 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.etsi.osl.tmf.common.model.Quantity; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Lob; import jakarta.validation.Valid; /** @@ -33,24 +36,17 @@ import jakarta.validation.Valid; @Schema(description = "Description of a productTerm linked to this orderItem. This represent a commitment with a duration") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class OrderTerm { +@Entity(name = "OrderTerm622") +public class OrderTerm extends BaseRootNamedEntity { + + @Lob + @Column(name = "LDESCRIPTION", columnDefinition = "LONGTEXT") @JsonProperty("description") private String description = null; - @JsonProperty("name") - private String name = null; - @JsonProperty("duration") private Quantity duration = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; public OrderTerm description(String description) { this.description = description; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/PaymentRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/PaymentRef.java index d60169ea1540fdff918f11b562e98ca8a6b09076..84ead8a4ac969920e9cfc0a7e139c05f0421fd48 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/PaymentRef.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/PaymentRef.java @@ -20,12 +20,11 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -34,25 +33,12 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "If an immediate payment has been done at the product order submission, the payment information are captured and stored (as a reference) in the order.") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class PaymentRef { +@Entity(name = "PaymentRef622") +public class PaymentRef extends BaseRootNamedEntity { @JsonProperty("id") private String id = null; - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; - + @JsonProperty("@referredType") private String _atReferredType = null; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingPriceRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingPriceRef.java deleted file mode 100644 index 25224fb75af1356ddd1477b5336339fa821c7445..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingPriceRef.java +++ /dev/null @@ -1,243 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; - -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.springframework.validation.annotation.Validated; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; - -/** - * ProductPriceOffering reference. An amount, usually of money, that is asked for or allowed when a ProductOffering is bought, rented, or leased - */ -@Schema(description = "ProductPriceOffering reference. An amount, usually of money, that is asked for or allowed when a ProductOffering is bought, rented, or leased") -@Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductOfferingPriceRef { - @JsonProperty("id") - private String id = null; - - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; - - @JsonProperty("@referredType") - private String _atReferredType = null; - - public ProductOfferingPriceRef id(String id) { - this.id = id; - return this; - } - - /** - * Unique identifier of a related entity. - * @return id - **/ - @Schema(description = "Unique identifier of a related entity.") - @NotNull - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ProductOfferingPriceRef href(String href) { - this.href = href; - return this; - } - - /** - * Reference of the related entity. - * @return href - **/ - @Schema(description = "Reference of the related entity.") - - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - public ProductOfferingPriceRef name(String name) { - this.name = name; - return this; - } - - /** - * Name of the related entity. - * @return name - **/ - @Schema(description = "Name of the related entity.") - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public ProductOfferingPriceRef baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public ProductOfferingPriceRef schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public ProductOfferingPriceRef type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } - - public ProductOfferingPriceRef _atReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; - return this; - } - - /** - * The actual type of the target instance when needed for disambiguation. - * @return _atReferredType - **/ - @Schema(description = "The actual type of the target instance when needed for disambiguation.") - - public String getAtReferredType() { - return _atReferredType; - } - - public void setAtReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProductOfferingPriceRef productOfferingPriceRef = (ProductOfferingPriceRef) o; - return Objects.equals(this.id, productOfferingPriceRef.id) && - Objects.equals(this.href, productOfferingPriceRef.href) && - Objects.equals(this.name, productOfferingPriceRef.name) && - Objects.equals(this.baseType, productOfferingPriceRef.baseType) && - Objects.equals(this.schemaLocation, productOfferingPriceRef.schemaLocation) && - Objects.equals(this.type, productOfferingPriceRef.type) && - Objects.equals(this._atReferredType, productOfferingPriceRef._atReferredType); - } - - @Override - public int hashCode() { - return Objects.hash(id, href, name, baseType, schemaLocation, type, _atReferredType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProductOfferingPriceRef {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" href: ").append(toIndentedString(href)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" _atReferredType: ").append(toIndentedString(_atReferredType)).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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingQualificationItemRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingQualificationItemRef.java index 1c3b20cac3b027f15c73d87ceee921a127eb076c..2ff1407ea9eae6c7ea0fcce5c95ae9270e3b8625 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingQualificationItemRef.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingQualificationItemRef.java @@ -20,12 +20,11 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -34,15 +33,14 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "It's a productOfferingQualification item that has been executed previously.") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductOfferingQualificationItemRef { +@Entity(name = "ProdOffQIRef622") +public class ProductOfferingQualificationItemRef extends BaseRootNamedEntity { @JsonProperty("id") private String id = null; @JsonProperty("href") private String href = null; - @JsonProperty("name") - private String name = null; @JsonProperty("productOfferingQualificationHref") private String productOfferingQualificationHref = null; @@ -53,14 +51,6 @@ public class ProductOfferingQualificationItemRef { @JsonProperty("productOfferingQualificationName") private String productOfferingQualificationName = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; @JsonProperty("@referredType") private String _atReferredType = null; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingQualificationRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingQualificationRef.java index ed7f58a5c7aa7b4282f347aad139ba90fb1a2340..efa5411c525894fd8eb661f12625652bfceb7ed5 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingQualificationRef.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingQualificationRef.java @@ -20,12 +20,11 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -34,24 +33,11 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "It's a productOfferingQualification that has been executed previously") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductOfferingQualificationRef { +@Entity(name = "ProdOffQualRef622") +public class ProductOfferingQualificationRef extends BaseRootNamedEntity { @JsonProperty("id") private String id = null; - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; @JsonProperty("@referredType") private String _atReferredType = null; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingRef.java deleted file mode 100644 index f18eb0729c49f94f98f189cb8a2581994518bf2f..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOfferingRef.java +++ /dev/null @@ -1,243 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; - -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.springframework.validation.annotation.Validated; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; - -/** - * ProductOffering reference. A product offering represents entities that are orderable from the provider of the catalog, this resource includes pricing information. - */ -@Schema(description = "ProductOffering reference. A product offering represents entities that are orderable from the provider of the catalog, this resource includes pricing information.") -@Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductOfferingRef { - @JsonProperty("id") - private String id = null; - - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; - - @JsonProperty("@referredType") - private String _atReferredType = null; - - public ProductOfferingRef id(String id) { - this.id = id; - return this; - } - - /** - * Unique identifier of a related entity. - * @return id - **/ - @Schema(description = "Unique identifier of a related entity.") - @NotNull - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ProductOfferingRef href(String href) { - this.href = href; - return this; - } - - /** - * Reference of the related entity. - * @return href - **/ - @Schema(description = "Reference of the related entity.") - - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - public ProductOfferingRef name(String name) { - this.name = name; - return this; - } - - /** - * Name of the related entity. - * @return name - **/ - @Schema(description = "Name of the related entity.") - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public ProductOfferingRef baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public ProductOfferingRef schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public ProductOfferingRef type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } - - public ProductOfferingRef _atReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; - return this; - } - - /** - * The actual type of the target instance when needed for disambiguation. - * @return _atReferredType - **/ - @Schema(description = "The actual type of the target instance when needed for disambiguation.") - - public String getAtReferredType() { - return _atReferredType; - } - - public void setAtReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProductOfferingRef productOfferingRef = (ProductOfferingRef) o; - return Objects.equals(this.id, productOfferingRef.id) && - Objects.equals(this.href, productOfferingRef.href) && - Objects.equals(this.name, productOfferingRef.name) && - Objects.equals(this.baseType, productOfferingRef.baseType) && - Objects.equals(this.schemaLocation, productOfferingRef.schemaLocation) && - Objects.equals(this.type, productOfferingRef.type) && - Objects.equals(this._atReferredType, productOfferingRef._atReferredType); - } - - @Override - public int hashCode() { - return Objects.hash(id, href, name, baseType, schemaLocation, type, _atReferredType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProductOfferingRef {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" href: ").append(toIndentedString(href)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" _atReferredType: ").append(toIndentedString(_atReferredType)).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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrder.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrder.java index b8a7a3848a6ed03409dbf75894c338c388a322d8..3598dd460f4434dda6d85ec1f53230a12e23b72c 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrder.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrder.java @@ -20,32 +20,45 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; +import java.util.HashSet; import java.util.Objects; - +import java.util.Set; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import org.etsi.osl.tmf.common.model.BaseRootEntity; +import org.etsi.osl.tmf.common.model.UserPartRoleType; import org.etsi.osl.tmf.common.model.service.Note; +import org.etsi.osl.tmf.pim637.model.BillingAccountRef; import org.etsi.osl.tmf.prm669.model.RelatedParty; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Lob; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; /** - * A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, + * A Product Order is a type of order which can be used to place an order between a customer and a + * service provider or between a service provider and a partner and vice versa, */ -@Schema(description = "A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa,") +@Schema( + description = "A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa,") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductOrder { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", + date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") + +@Entity(name = "ProductOrder") +@JsonIgnoreProperties("orderRequester") +public class ProductOrder extends BaseRootEntity { @JsonProperty("id") private String id = null; - @JsonProperty("href") - private String href = null; - @JsonProperty("cancellationDate") private OffsetDateTime cancellationDate = null; @@ -55,13 +68,15 @@ public class ProductOrder { @JsonProperty("category") private String category = null; - @JsonProperty("completionDate") + private OffsetDateTime completionDate = null; + @Lob + @Column(name = "LDESCRIPTION", columnDefinition = "LONGTEXT") @JsonProperty("description") - private String description = null; + private String description = null;; + - @JsonProperty("expectedCompletionDate") private OffsetDateTime expectedCompletionDate = null; @JsonProperty("externalId") @@ -70,88 +85,87 @@ public class ProductOrder { @JsonProperty("notificationContact") private String notificationContact = null; - @JsonProperty("orderDate") private OffsetDateTime orderDate = null; @JsonProperty("priority") private String priority = null; - @JsonProperty("requestedCompletionDate") + private OffsetDateTime requestedCompletionDate = null; - @JsonProperty("requestedStartDate") private OffsetDateTime requestedStartDate = null; @JsonProperty("agreement") @Valid - private List agreement = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set agreement = new HashSet<>(); @JsonProperty("billingAccount") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "billing_acc_refuuid", referencedColumnName = "uuid") private BillingAccountRef billingAccount = null; @JsonProperty("channel") @Valid - private List channel = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set channel = new HashSet<>(); @JsonProperty("note") @Valid - private List note = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set note = new HashSet<>(); @JsonProperty("orderTotalPrice") @Valid - private List orderTotalPrice = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set orderTotalPrice = new HashSet<>(); @JsonProperty("payment") @Valid - private List payment = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set payment = new HashSet<>(); @JsonProperty("productOfferingQualification") @Valid - private List productOfferingQualification = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set productOfferingQualification = new HashSet<>(); @JsonProperty("productOrderItem") @Valid - private List productOrderItem = new ArrayList<>(); + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set productOrderItem = new HashSet<>(); @JsonProperty("quote") @Valid - private List quote = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set quote = new HashSet<>(); @JsonProperty("relatedParty") @Valid - private List relatedParty = null; + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set relatedParty = new HashSet<>(); @JsonProperty("state") - private ProductOrderStateType state = null; - - @JsonProperty("@baseType") - private String baseType = null; + private ProductOrderStateType state = ProductOrderStateType.INITIAL; - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - @JsonProperty("@type") - private String type = null; - - public ProductOrder id(String id) { - this.id = id; - return this; - } /** * ID created on repository side (OM system) + * * @return id - **/ + **/ @Schema(description = "ID created on repository side (OM system)") - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; + public String getId() { + if ((id != null) && (uuid == null)) { // this check is good for external partners when no uuid + // exists + return id; + } + return uuid; } + public ProductOrder href(String href) { this.href = href; return this; @@ -159,11 +173,12 @@ public class ProductOrder { /** * Hyperlink to access the order + * * @return href - **/ + **/ @Schema(description = "Hyperlink to access the order") - - public String getHref() { + + public String getHref() { return href; } @@ -177,13 +192,14 @@ public class ProductOrder { } /** - * Date when the order is cancelled. This is used when order is cancelled. + * Date when the order is cancelled. This is used when order is cancelled. + * * @return cancellationDate - **/ + **/ @Schema(description = "Date when the order is cancelled. This is used when order is cancelled. ") - - @Valid - public OffsetDateTime getCancellationDate() { + + @Valid + public OffsetDateTime getCancellationDate() { return cancellationDate; } @@ -197,12 +213,13 @@ public class ProductOrder { } /** - * Reason why the order is cancelled. This is used when order is cancelled. + * Reason why the order is cancelled. This is used when order is cancelled. + * * @return cancellationReason - **/ + **/ @Schema(description = "Reason why the order is cancelled. This is used when order is cancelled. ") - - public String getCancellationReason() { + + public String getCancellationReason() { return cancellationReason; } @@ -216,12 +233,15 @@ public class ProductOrder { } /** - * Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...) + * Used to categorize the order from a business perspective that can be useful for the OM system + * (e.g. \"enterprise\", \"residential\", ...) + * * @return category - **/ - @Schema(description = "Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...)") - - public String getCategory() { + **/ + @Schema( + description = "Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...)") + + public String getCategory() { return category; } @@ -236,12 +256,22 @@ public class ProductOrder { /** * Date when the order was completed + * * @return completionDate - **/ + **/ @Schema(description = "Date when the order was completed") - - @Valid - public OffsetDateTime getCompletionDate() { + + @Valid + @JsonProperty("completionDate") + public String getCompletionDateString() { + if (this.completionDate == null) { + return null; + } + return this.completionDate.toString(); + } + + @Valid + public OffsetDateTime getCompletionDate() { return completionDate; } @@ -249,6 +279,13 @@ public class ProductOrder { this.completionDate = completionDate; } + public void setCompletionDate(String completionDate) { + if (completionDate != null) { + this.completionDate = OffsetDateTime.parse(completionDate); + } + } + + public ProductOrder description(String description) { this.description = description; return this; @@ -256,11 +293,12 @@ public class ProductOrder { /** * Description of the product order + * * @return description - **/ + **/ @Schema(description = "Description of the product order") - - public String getDescription() { + + public String getDescription() { return description; } @@ -275,12 +313,22 @@ public class ProductOrder { /** * Expected delivery date amended by the provider + * * @return expectedCompletionDate - **/ + **/ @Schema(description = "Expected delivery date amended by the provider") - - @Valid - public OffsetDateTime getExpectedCompletionDate() { + + @JsonProperty("expectedCompletionDate") + public String getExpectedCompletionDateString() { + + if (this.expectedCompletionDate == null) { + return null; + } + return this.expectedCompletionDate.toString(); + } + + @Valid + public OffsetDateTime getExpectedCompletionDate() { return expectedCompletionDate; } @@ -288,6 +336,13 @@ public class ProductOrder { this.expectedCompletionDate = expectedCompletionDate; } + public void setExpectedCompletionDate(String expectedCompletionDate) { + if (expectedCompletionDate != null) { + this.expectedCompletionDate = OffsetDateTime.parse(expectedCompletionDate); + + } + } + public ProductOrder externalId(String externalId) { this.externalId = externalId; return this; @@ -295,11 +350,13 @@ public class ProductOrder { /** * ID given by the consumer and only understandable by him (to facilitate his searches afterwards) + * * @return externalId - **/ - @Schema(description = "ID given by the consumer and only understandable by him (to facilitate his searches afterwards)") - - public String getExternalId() { + **/ + @Schema( + description = "ID given by the consumer and only understandable by him (to facilitate his searches afterwards)") + + public String getExternalId() { return externalId; } @@ -314,11 +371,13 @@ public class ProductOrder { /** * Contact attached to the order to send back information regarding this order + * * @return notificationContact - **/ - @Schema(description = "Contact attached to the order to send back information regarding this order") - - public String getNotificationContact() { + **/ + @Schema( + description = "Contact attached to the order to send back information regarding this order") + + public String getNotificationContact() { return notificationContact; } @@ -333,12 +392,22 @@ public class ProductOrder { /** * Date when the order was created + * * @return orderDate - **/ + **/ @Schema(description = "Date when the order was created") - - @Valid - public OffsetDateTime getOrderDate() { + + @Valid + @JsonProperty("orderDate") + public String getOrderDateString() { + if (this.orderDate == null) { + return null; + } + return this.orderDate.toString(); + } + + @Valid + public OffsetDateTime getOrderDate() { return orderDate; } @@ -346,18 +415,29 @@ public class ProductOrder { this.orderDate = orderDate; } + public void setOrderDate(String orderDate) { + + if (orderDate != null) { + this.orderDate = OffsetDateTime.parse(orderDate); + + } + } + public ProductOrder priority(String priority) { this.priority = priority; return this; } /** - * A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest) + * A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the + * highest priority, and 4 the lowest) + * * @return priority - **/ - @Schema(description = "A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)") - - public String getPriority() { + **/ + @Schema( + description = "A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)") + + public String getPriority() { return priority; } @@ -372,12 +452,23 @@ public class ProductOrder { /** * Requested delivery date from the requestor perspective + * * @return requestedCompletionDate - **/ + **/ @Schema(description = "Requested delivery date from the requestor perspective") - - @Valid - public OffsetDateTime getRequestedCompletionDate() { + + @Valid + @JsonProperty("requestedCompletionDate") + public String getRequestedCompletionDateString() { + + if (this.requestedCompletionDate == null) { + return null; + } + return this.requestedCompletionDate.toString(); + } + + @Valid + public OffsetDateTime getRequestedCompletionDate() { return requestedCompletionDate; } @@ -385,19 +476,40 @@ public class ProductOrder { this.requestedCompletionDate = requestedCompletionDate; } + public void setRequestedCompletionDate(String requestedCompletionDate) { + + if (requestedCompletionDate != null) { + this.requestedCompletionDate = OffsetDateTime.parse(requestedCompletionDate); + + } + } + public ProductOrder requestedStartDate(OffsetDateTime requestedStartDate) { this.requestedStartDate = requestedStartDate; return this; } /** - * Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. + * Order fulfillment start date wished by the requestor. This is used when, for any reason, + * requestor cannot allow seller to begin to operationally begin the fulfillment before a date. + * * @return requestedStartDate - **/ - @Schema(description = "Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. ") - - @Valid - public OffsetDateTime getRequestedStartDate() { + **/ + @Schema( + description = "Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. ") + + @Valid + @JsonProperty("requestedStartDate") + public String getRequestedStartDateString() { + + if (this.requestedStartDate == null) { + return null; + } + return this.requestedStartDate.toString(); + } + + @Valid + public OffsetDateTime getRequestedStartDate() { return requestedStartDate; } @@ -405,14 +517,23 @@ public class ProductOrder { this.requestedStartDate = requestedStartDate; } - public ProductOrder agreement(List agreement) { + + public void setRequestedStartDate(String requestedStartDate) { + + if (requestedStartDate != null) { + this.requestedStartDate = OffsetDateTime.parse(requestedStartDate); + + } + } + + public ProductOrder agreement(Set agreement) { this.agreement = agreement; return this; } public ProductOrder addAgreementItem(AgreementRef agreementItem) { if (this.agreement == null) { - this.agreement = new ArrayList<>(); + this.agreement = new HashSet<>(); } this.agreement.add(agreementItem); return this; @@ -420,15 +541,16 @@ public class ProductOrder { /** * A reference to an agreement defined in the context of the product order + * * @return agreement - **/ + **/ @Schema(description = "A reference to an agreement defined in the context of the product order") - @Valid - public List getAgreement() { + @Valid + public Set getAgreement() { return agreement; } - public void setAgreement(List agreement) { + public void setAgreement(Set agreement) { this.agreement = agreement; } @@ -439,12 +561,13 @@ public class ProductOrder { /** * Get billingAccount + * * @return billingAccount - **/ + **/ @Schema(description = "") - - @Valid - public BillingAccountRef getBillingAccount() { + + @Valid + public BillingAccountRef getBillingAccount() { return billingAccount; } @@ -452,14 +575,14 @@ public class ProductOrder { this.billingAccount = billingAccount; } - public ProductOrder channel(List channel) { + public ProductOrder channel(Set channel) { this.channel = channel; return this; } public ProductOrder addChannelItem(RelatedChannel channelItem) { if (this.channel == null) { - this.channel = new ArrayList<>(); + this.channel = new HashSet<>(); } this.channel.add(channelItem); return this; @@ -467,26 +590,27 @@ public class ProductOrder { /** * Get channel + * * @return channel - **/ + **/ @Schema(description = "") - @Valid - public List getChannel() { + @Valid + public Set getChannel() { return channel; } - public void setChannel(List channel) { + public void setChannel(Set channel) { this.channel = channel; } - public ProductOrder note(List note) { + public ProductOrder note(Set note) { this.note = note; return this; } public ProductOrder addNoteItem(Note noteItem) { if (this.note == null) { - this.note = new ArrayList<>(); + this.note = new HashSet<>(); } this.note.add(noteItem); return this; @@ -494,26 +618,27 @@ public class ProductOrder { /** * Get note + * * @return note - **/ + **/ @Schema(description = "") - @Valid - public List getNote() { + @Valid + public Set getNote() { return note; } - public void setNote(List note) { + public void setNote(Set note) { this.note = note; } - public ProductOrder orderTotalPrice(List orderTotalPrice) { + public ProductOrder orderTotalPrice(Set orderTotalPrice) { this.orderTotalPrice = orderTotalPrice; return this; } public ProductOrder addOrderTotalPriceItem(OrderPrice orderTotalPriceItem) { if (this.orderTotalPrice == null) { - this.orderTotalPrice = new ArrayList<>(); + this.orderTotalPrice = new HashSet<>(); } this.orderTotalPrice.add(orderTotalPriceItem); return this; @@ -521,26 +646,27 @@ public class ProductOrder { /** * Get orderTotalPrice + * * @return orderTotalPrice - **/ + **/ @Schema(description = "") - @Valid - public List getOrderTotalPrice() { + @Valid + public Set getOrderTotalPrice() { return orderTotalPrice; } - public void setOrderTotalPrice(List orderTotalPrice) { + public void setOrderTotalPrice(Set orderTotalPrice) { this.orderTotalPrice = orderTotalPrice; } - public ProductOrder payment(List payment) { + public ProductOrder payment(Set payment) { this.payment = payment; return this; } public ProductOrder addPaymentItem(PaymentRef paymentItem) { if (this.payment == null) { - this.payment = new ArrayList<>(); + this.payment = new HashSet<>(); } this.payment.add(paymentItem); return this; @@ -548,26 +674,29 @@ public class ProductOrder { /** * Get payment + * * @return payment - **/ + **/ @Schema(description = "") - @Valid - public List getPayment() { + @Valid + public Set getPayment() { return payment; } - public void setPayment(List payment) { + public void setPayment(Set payment) { this.payment = payment; } - public ProductOrder productOfferingQualification(List productOfferingQualification) { + public ProductOrder productOfferingQualification( + Set productOfferingQualification) { this.productOfferingQualification = productOfferingQualification; return this; } - public ProductOrder addProductOfferingQualificationItem(ProductOfferingQualificationRef productOfferingQualificationItem) { + public ProductOrder addProductOfferingQualificationItem( + ProductOfferingQualificationRef productOfferingQualificationItem) { if (this.productOfferingQualification == null) { - this.productOfferingQualification = new ArrayList<>(); + this.productOfferingQualification = new HashSet<>(); } this.productOfferingQualification.add(productOfferingQualificationItem); return this; @@ -575,19 +704,21 @@ public class ProductOrder { /** * Get productOfferingQualification + * * @return productOfferingQualification - **/ + **/ @Schema(description = "") - @Valid - public List getProductOfferingQualification() { + @Valid + public Set getProductOfferingQualification() { return productOfferingQualification; } - public void setProductOfferingQualification(List productOfferingQualification) { + public void setProductOfferingQualification( + Set productOfferingQualification) { this.productOfferingQualification = productOfferingQualification; } - public ProductOrder productOrderItem(List productOrderItem) { + public ProductOrder productOrderItem(Set productOrderItem) { this.productOrderItem = productOrderItem; return this; } @@ -599,27 +730,29 @@ public class ProductOrder { /** * Get productOrderItem + * * @return productOrderItem - **/ + **/ @Schema(description = "") - @NotNull - @Valid - @Size(min=1) public List getProductOrderItem() { + @NotNull + @Valid + @Size(min = 1) + public Set getProductOrderItem() { return productOrderItem; } - public void setProductOrderItem(List productOrderItem) { + public void setProductOrderItem(Set productOrderItem) { this.productOrderItem = productOrderItem; } - public ProductOrder quote(List quote) { + public ProductOrder quote(Set quote) { this.quote = quote; return this; } public ProductOrder addQuoteItem(QuoteRef quoteItem) { if (this.quote == null) { - this.quote = new ArrayList<>(); + this.quote = new HashSet<>(); } this.quote.add(quoteItem); return this; @@ -627,26 +760,27 @@ public class ProductOrder { /** * Get quote + * * @return quote - **/ + **/ @Schema(description = "") - @Valid - public List getQuote() { + @Valid + public Set getQuote() { return quote; } - public void setQuote(List quote) { + public void setQuote(Set quote) { this.quote = quote; } - public ProductOrder relatedParty(List relatedParty) { + public ProductOrder relatedParty(Set relatedParty) { this.relatedParty = relatedParty; return this; } public ProductOrder addRelatedPartyItem(RelatedParty relatedPartyItem) { if (this.relatedParty == null) { - this.relatedParty = new ArrayList<>(); + this.relatedParty = new HashSet<>(); } this.relatedParty.add(relatedPartyItem); return this; @@ -654,15 +788,16 @@ public class ProductOrder { /** * Get relatedParty + * * @return relatedParty - **/ + **/ @Schema(description = "") - @Valid - public List getRelatedParty() { + @Valid + public Set getRelatedParty() { return relatedParty; } - public void setRelatedParty(List relatedParty) { + public void setRelatedParty(Set relatedParty) { this.relatedParty = relatedParty; } @@ -673,12 +808,13 @@ public class ProductOrder { /** * Get state + * * @return state - **/ + **/ @Schema(description = "") - - @Valid - public ProductOrderStateType getState() { + + @Valid + public ProductOrderStateType getState() { return state; } @@ -693,11 +829,12 @@ public class ProductOrder { /** * When sub-classing, this defines the super-class + * * @return baseType - **/ + **/ @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { + + public String getAtBaseType() { return baseType; } @@ -712,11 +849,13 @@ public class ProductOrder { /** * A URI to a JSON-Schema file that defines additional attributes and relationships + * * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { + **/ + @Schema( + description = "A URI to a JSON-Schema file that defines additional attributes and relationships") + + public String getAtSchemaLocation() { return schemaLocation; } @@ -731,11 +870,12 @@ public class ProductOrder { /** * When sub-classing, this defines the sub-class entity name + * * @return type - **/ + **/ @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { + + public String getAtType() { return type; } @@ -753,46 +893,50 @@ public class ProductOrder { return false; } ProductOrder productOrder = (ProductOrder) o; - return Objects.equals(this.id, productOrder.id) && - Objects.equals(this.href, productOrder.href) && - Objects.equals(this.cancellationDate, productOrder.cancellationDate) && - Objects.equals(this.cancellationReason, productOrder.cancellationReason) && - Objects.equals(this.category, productOrder.category) && - Objects.equals(this.completionDate, productOrder.completionDate) && - Objects.equals(this.description, productOrder.description) && - Objects.equals(this.expectedCompletionDate, productOrder.expectedCompletionDate) && - Objects.equals(this.externalId, productOrder.externalId) && - Objects.equals(this.notificationContact, productOrder.notificationContact) && - Objects.equals(this.orderDate, productOrder.orderDate) && - Objects.equals(this.priority, productOrder.priority) && - Objects.equals(this.requestedCompletionDate, productOrder.requestedCompletionDate) && - Objects.equals(this.requestedStartDate, productOrder.requestedStartDate) && - Objects.equals(this.agreement, productOrder.agreement) && - Objects.equals(this.billingAccount, productOrder.billingAccount) && - Objects.equals(this.channel, productOrder.channel) && - Objects.equals(this.note, productOrder.note) && - Objects.equals(this.orderTotalPrice, productOrder.orderTotalPrice) && - Objects.equals(this.payment, productOrder.payment) && - Objects.equals(this.productOfferingQualification, productOrder.productOfferingQualification) && - Objects.equals(this.productOrderItem, productOrder.productOrderItem) && - Objects.equals(this.quote, productOrder.quote) && - Objects.equals(this.relatedParty, productOrder.relatedParty) && - Objects.equals(this.state, productOrder.state) && - Objects.equals(this.baseType, productOrder.baseType) && - Objects.equals(this.schemaLocation, productOrder.schemaLocation) && - Objects.equals(this.type, productOrder.type); + return Objects.equals(this.id, productOrder.id) && Objects.equals(this.href, productOrder.href) + && Objects.equals(this.cancellationDate, productOrder.cancellationDate) + && Objects.equals(this.cancellationReason, productOrder.cancellationReason) + && Objects.equals(this.category, productOrder.category) + && Objects.equals(this.completionDate, productOrder.completionDate) + && Objects.equals(this.description, productOrder.description) + && Objects.equals(this.expectedCompletionDate, productOrder.expectedCompletionDate) + && Objects.equals(this.externalId, productOrder.externalId) + && Objects.equals(this.notificationContact, productOrder.notificationContact) + && Objects.equals(this.orderDate, productOrder.orderDate) + && Objects.equals(this.priority, productOrder.priority) + && Objects.equals(this.requestedCompletionDate, productOrder.requestedCompletionDate) + && Objects.equals(this.requestedStartDate, productOrder.requestedStartDate) + && Objects.equals(this.agreement, productOrder.agreement) + && Objects.equals(this.billingAccount, productOrder.billingAccount) + && Objects.equals(this.channel, productOrder.channel) + && Objects.equals(this.note, productOrder.note) + && Objects.equals(this.orderTotalPrice, productOrder.orderTotalPrice) + && Objects.equals(this.payment, productOrder.payment) + && Objects.equals(this.productOfferingQualification, + productOrder.productOfferingQualification) + && Objects.equals(this.productOrderItem, productOrder.productOrderItem) + && Objects.equals(this.quote, productOrder.quote) + && Objects.equals(this.relatedParty, productOrder.relatedParty) + && Objects.equals(this.state, productOrder.state) + && Objects.equals(this.baseType, productOrder.baseType) + && Objects.equals(this.schemaLocation, productOrder.schemaLocation) + && Objects.equals(this.type, productOrder.type); } @Override public int hashCode() { - return Objects.hash(id, href, cancellationDate, cancellationReason, category, completionDate, description, expectedCompletionDate, externalId, notificationContact, orderDate, priority, requestedCompletionDate, requestedStartDate, agreement, billingAccount, channel, note, orderTotalPrice, payment, productOfferingQualification, productOrderItem, quote, relatedParty, state, baseType, schemaLocation, type); + return Objects.hash(id, href, cancellationDate, cancellationReason, category, completionDate, + description, expectedCompletionDate, externalId, notificationContact, orderDate, priority, + requestedCompletionDate, requestedStartDate, agreement, billingAccount, channel, note, + orderTotalPrice, payment, productOfferingQualification, productOrderItem, quote, + relatedParty, state, baseType, schemaLocation, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProductOrder {\n"); - + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" href: ").append(toIndentedString(href)).append("\n"); sb.append(" cancellationDate: ").append(toIndentedString(cancellationDate)).append("\n"); @@ -800,12 +944,15 @@ public class ProductOrder { sb.append(" category: ").append(toIndentedString(category)).append("\n"); sb.append(" completionDate: ").append(toIndentedString(completionDate)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)).append("\n"); + sb.append(" expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)) + .append("\n"); sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); - sb.append(" notificationContact: ").append(toIndentedString(notificationContact)).append("\n"); + sb.append(" notificationContact: ").append(toIndentedString(notificationContact)) + .append("\n"); sb.append(" orderDate: ").append(toIndentedString(orderDate)).append("\n"); sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); - sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n"); + sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)) + .append("\n"); sb.append(" requestedStartDate: ").append(toIndentedString(requestedStartDate)).append("\n"); sb.append(" agreement: ").append(toIndentedString(agreement)).append("\n"); sb.append(" billingAccount: ").append(toIndentedString(billingAccount)).append("\n"); @@ -813,7 +960,8 @@ public class ProductOrder { sb.append(" note: ").append(toIndentedString(note)).append("\n"); sb.append(" orderTotalPrice: ").append(toIndentedString(orderTotalPrice)).append("\n"); sb.append(" payment: ").append(toIndentedString(payment)).append("\n"); - sb.append(" productOfferingQualification: ").append(toIndentedString(productOfferingQualification)).append("\n"); + sb.append(" productOfferingQualification: ") + .append(toIndentedString(productOfferingQualification)).append("\n"); sb.append(" productOrderItem: ").append(toIndentedString(productOrderItem)).append("\n"); sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); sb.append(" relatedParty: ").append(toIndentedString(relatedParty)).append("\n"); @@ -826,8 +974,7 @@ public class ProductOrder { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -835,4 +982,25 @@ public class ProductOrder { } return o.toString().replace("\n", "\n "); } + + public ProductOrderItem findOrderItemById(String id) { + for (ProductOrderItem oi : this.productOrderItem) { + if (oi.getId().equals(id)) { + return oi; + } + } + return null; + } + + /** + * @return the PartyRole that made the request + */ + public RelatedParty getOrderRequester() { + for (RelatedParty rp : relatedParty) { + if (rp.getRole().equals(UserPartRoleType.REQUESTER.toString())) { + return rp; + } + } + return null; + } } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderAttributeValueChangeEvent.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderAttributeValueChangeEvent.java index 84c8851a582b16709a0d522b01cbf2fdcdb8e641..f2fe095351e5c29573f580d6e4ff6c8ca6be4b09 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderAttributeValueChangeEvent.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderAttributeValueChangeEvent.java @@ -21,11 +21,8 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; @@ -274,6 +271,9 @@ public class ProductOrderAttributeValueChangeEvent { @Valid public ProductOrderAttributeValueChangeEventPayload getEvent() { + if (event==null) { + event = new ProductOrderAttributeValueChangeEventPayload(); + } return event; } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderAttributeValueChangeEventPayload.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderAttributeValueChangeEventPayload.java index 28ebc7cf0a8888fc49274f2baddcc24155d71e10..e7cd65c1f0847d0e0ecf70c012e3468229969900 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderAttributeValueChangeEventPayload.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderAttributeValueChangeEventPayload.java @@ -20,11 +20,8 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderAttributeValueChangeNotification.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderAttributeValueChangeNotification.java new file mode 100644 index 0000000000000000000000000000000000000000..1f240a148d8e31d38b6c4e21361d3bd684ba7262 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderAttributeValueChangeNotification.java @@ -0,0 +1,92 @@ +package org.etsi.osl.tmf.po622.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.etsi.osl.tmf.common.model.Notification; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; + +public class ProductOrderAttributeValueChangeNotification extends Notification { + + + @JsonProperty("event") + private ProductOrderAttributeValueChangeEvent event = null; + + public ProductOrderAttributeValueChangeNotification eventId(String eventId) { + this.eventId = eventId; + return this; + } + + + + public ProductOrderAttributeValueChangeNotification event(ProductOrderAttributeValueChangeEvent event) { + this.event = event; + return this; + } + + /** + * The event linked to the involved resource object + * @return event + **/ + @Schema(description = "The event linked to the involved resource object") + + @Valid + + public ProductOrderAttributeValueChangeEvent getEvent() { + return event; + } + + public void setEvent(ProductOrderAttributeValueChangeEvent event) { + this.event = event; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductOrderAttributeValueChangeNotification productOrderAttributeValueChangeNotification = (ProductOrderAttributeValueChangeNotification) o; + return Objects.equals(this.eventId, productOrderAttributeValueChangeNotification.eventId) && + Objects.equals(this.eventTime, productOrderAttributeValueChangeNotification.eventTime) && + Objects.equals(this.eventType, productOrderAttributeValueChangeNotification.eventType) && + Objects.equals(this.fieldPath, productOrderAttributeValueChangeNotification.fieldPath) && + Objects.equals(this.resourcePath, productOrderAttributeValueChangeNotification.resourcePath) && + Objects.equals(this.event, productOrderAttributeValueChangeNotification.event); + } + + @Override + public int hashCode() { + return Objects.hash(eventId, eventTime, eventType, fieldPath, resourcePath, event); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductOrderAttributeValueChangeNotification {\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(" fieldPath: ").append(toIndentedString(fieldPath)).append("\n"); + sb.append(" resourcePath: ").append(toIndentedString(resourcePath)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreate.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreate.java index 7da8d3d1b95b0772eff6aa965ef22305b6a10141..fbd3f635fbc6a6eaeb275af0dcdd96f885985ee6 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreate.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreate.java @@ -23,9 +23,9 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; import org.etsi.osl.tmf.common.model.service.Note; +import org.etsi.osl.tmf.pim637.model.BillingAccountRef; import org.etsi.osl.tmf.prm669.model.RelatedParty; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; @@ -34,12 +34,17 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; /** - * A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,completionDate,orderDate,state,expectedCompletionDate,productOrderItem.state + * A Product Order is a type of order which can be used to place an order between a customer and a + * service provider or between a service provider and a partner and vice versa, Skipped properties: + * id,href,completionDate,orderDate,state,expectedCompletionDate,productOrderItem.state */ -@Schema(description = "A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,completionDate,orderDate,state,expectedCompletionDate,productOrderItem.state") +@Schema( + description = "A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,completionDate,orderDate,state,expectedCompletionDate,productOrderItem.state") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductOrderCreate { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", + date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") +public class ProductOrderCreate { + @JsonProperty("cancellationDate") private OffsetDateTime cancellationDate = null; @@ -61,10 +66,8 @@ public class ProductOrderCreate { @JsonProperty("priority") private String priority = null; - @JsonProperty("requestedCompletionDate") private OffsetDateTime requestedCompletionDate = null; - @JsonProperty("requestedStartDate") private OffsetDateTime requestedStartDate = null; @JsonProperty("agreement") @@ -114,6 +117,10 @@ public class ProductOrderCreate { @JsonProperty("@type") private String type = null; + + //we don;t skip state..This allows us to put it immediately in acknowledged + @JsonProperty("state") + private ProductOrderStateType state = null; public ProductOrderCreate cancellationDate(OffsetDateTime cancellationDate) { this.cancellationDate = cancellationDate; @@ -121,13 +128,14 @@ public class ProductOrderCreate { } /** - * Date when the order is cancelled. This is used when order is cancelled. + * Date when the order is cancelled. This is used when order is cancelled. + * * @return cancellationDate - **/ + **/ @Schema(description = "Date when the order is cancelled. This is used when order is cancelled. ") - - @Valid - public OffsetDateTime getCancellationDate() { + + @Valid + public OffsetDateTime getCancellationDate() { return cancellationDate; } @@ -141,12 +149,13 @@ public class ProductOrderCreate { } /** - * Reason why the order is cancelled. This is used when order is cancelled. + * Reason why the order is cancelled. This is used when order is cancelled. + * * @return cancellationReason - **/ + **/ @Schema(description = "Reason why the order is cancelled. This is used when order is cancelled. ") - - public String getCancellationReason() { + + public String getCancellationReason() { return cancellationReason; } @@ -160,12 +169,15 @@ public class ProductOrderCreate { } /** - * Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...) + * Used to categorize the order from a business perspective that can be useful for the OM system + * (e.g. \"enterprise\", \"residential\", ...) + * * @return category - **/ - @Schema(description = "Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...)") - - public String getCategory() { + **/ + @Schema( + description = "Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...)") + + public String getCategory() { return category; } @@ -180,11 +192,12 @@ public class ProductOrderCreate { /** * Description of the product order + * * @return description - **/ + **/ @Schema(description = "Description of the product order") - - public String getDescription() { + + public String getDescription() { return description; } @@ -199,11 +212,13 @@ public class ProductOrderCreate { /** * ID given by the consumer and only understandable by him (to facilitate his searches afterwards) + * * @return externalId - **/ - @Schema(description = "ID given by the consumer and only understandable by him (to facilitate his searches afterwards)") - - public String getExternalId() { + **/ + @Schema( + description = "ID given by the consumer and only understandable by him (to facilitate his searches afterwards)") + + public String getExternalId() { return externalId; } @@ -218,11 +233,13 @@ public class ProductOrderCreate { /** * Contact attached to the order to send back information regarding this order + * * @return notificationContact - **/ - @Schema(description = "Contact attached to the order to send back information regarding this order") - - public String getNotificationContact() { + **/ + @Schema( + description = "Contact attached to the order to send back information regarding this order") + + public String getNotificationContact() { return notificationContact; } @@ -236,12 +253,15 @@ public class ProductOrderCreate { } /** - * A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest) + * A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the + * highest priority, and 4 the lowest) + * * @return priority - **/ - @Schema(description = "A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)") - - public String getPriority() { + **/ + @Schema( + description = "A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)") + + public String getPriority() { return priority; } @@ -256,32 +276,54 @@ public class ProductOrderCreate { /** * Requested delivery date from the requestor perspective + * * @return requestedCompletionDate - **/ + **/ @Schema(description = "Requested delivery date from the requestor perspective") - - @Valid - public OffsetDateTime getRequestedCompletionDate() { + + @Valid + public OffsetDateTime getRequestedCompletionDate() { return requestedCompletionDate; } + @JsonProperty("requestedCompletionDate") + public String getRequestedCompletionDateStr() { + if (requestedCompletionDate != null) { + return requestedCompletionDate.toString(); + } else { + return null; + } + } + + public void setRequestedCompletionDate(OffsetDateTime requestedCompletionDate) { this.requestedCompletionDate = requestedCompletionDate; } + public void setRequestedCompletionDate(String requestedCompletionDate) { + + if (requestedCompletionDate != null) { + this.requestedCompletionDate = OffsetDateTime.parse(requestedCompletionDate); + + } + } + public ProductOrderCreate requestedStartDate(OffsetDateTime requestedStartDate) { this.requestedStartDate = requestedStartDate; return this; } /** - * Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. + * Order fulfillment start date wished by the requestor. This is used when, for any reason, + * requestor cannot allow seller to begin to operationally begin the fulfillment before a date. + * * @return requestedStartDate - **/ - @Schema(description = "Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. ") - - @Valid - public OffsetDateTime getRequestedStartDate() { + **/ + @Schema( + description = "Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. ") + + @Valid + public OffsetDateTime getRequestedStartDate() { return requestedStartDate; } @@ -289,6 +331,24 @@ public class ProductOrderCreate { this.requestedStartDate = requestedStartDate; } + public void setRequestedStartDate(String requestedStartDate) { + + if (requestedStartDate != null) { + this.requestedStartDate = OffsetDateTime.parse(requestedStartDate); + + } + } + + @JsonProperty("requestedStartDate") + public String getRequestedStartDateStr() { + + if (requestedStartDate != null) { + return requestedStartDate.toString(); + } + + return null; + } + public ProductOrderCreate agreement(List agreement) { this.agreement = agreement; return this; @@ -304,11 +364,12 @@ public class ProductOrderCreate { /** * A reference to an agreement defined in the context of the product order + * * @return agreement - **/ + **/ @Schema(description = "A reference to an agreement defined in the context of the product order") - @Valid - public List getAgreement() { + @Valid + public List getAgreement() { return agreement; } @@ -323,12 +384,13 @@ public class ProductOrderCreate { /** * Get billingAccount + * * @return billingAccount - **/ + **/ @Schema(description = "") - - @Valid - public BillingAccountRef getBillingAccount() { + + @Valid + public BillingAccountRef getBillingAccount() { return billingAccount; } @@ -351,11 +413,12 @@ public class ProductOrderCreate { /** * Get channel + * * @return channel - **/ + **/ @Schema(description = "") - @Valid - public List getChannel() { + @Valid + public List getChannel() { return channel; } @@ -378,11 +441,12 @@ public class ProductOrderCreate { /** * Get note + * * @return note - **/ + **/ @Schema(description = "") - @Valid - public List getNote() { + @Valid + public List getNote() { return note; } @@ -405,11 +469,12 @@ public class ProductOrderCreate { /** * Get orderTotalPrice + * * @return orderTotalPrice - **/ + **/ @Schema(description = "") - @Valid - public List getOrderTotalPrice() { + @Valid + public List getOrderTotalPrice() { return orderTotalPrice; } @@ -432,11 +497,12 @@ public class ProductOrderCreate { /** * Get payment + * * @return payment - **/ + **/ @Schema(description = "") - @Valid - public List getPayment() { + @Valid + public List getPayment() { return payment; } @@ -444,12 +510,14 @@ public class ProductOrderCreate { this.payment = payment; } - public ProductOrderCreate productOfferingQualification(List productOfferingQualification) { + public ProductOrderCreate productOfferingQualification( + List productOfferingQualification) { this.productOfferingQualification = productOfferingQualification; return this; } - public ProductOrderCreate addProductOfferingQualificationItem(ProductOfferingQualificationRef productOfferingQualificationItem) { + public ProductOrderCreate addProductOfferingQualificationItem( + ProductOfferingQualificationRef productOfferingQualificationItem) { if (this.productOfferingQualification == null) { this.productOfferingQualification = new ArrayList<>(); } @@ -459,15 +527,17 @@ public class ProductOrderCreate { /** * Get productOfferingQualification + * * @return productOfferingQualification - **/ + **/ @Schema(description = "") - @Valid - public List getProductOfferingQualification() { + @Valid + public List getProductOfferingQualification() { return productOfferingQualification; } - public void setProductOfferingQualification(List productOfferingQualification) { + public void setProductOfferingQualification( + List productOfferingQualification) { this.productOfferingQualification = productOfferingQualification; } @@ -483,12 +553,14 @@ public class ProductOrderCreate { /** * Get productOrderItem + * * @return productOrderItem - **/ + **/ @Schema(description = "") - @NotNull - @Valid - @Size(min=1) public List getProductOrderItem() { + @NotNull + @Valid + @Size(min = 1) + public List getProductOrderItem() { return productOrderItem; } @@ -511,11 +583,12 @@ public class ProductOrderCreate { /** * Get quote + * * @return quote - **/ + **/ @Schema(description = "") - @Valid - public List getQuote() { + @Valid + public List getQuote() { return quote; } @@ -538,11 +611,12 @@ public class ProductOrderCreate { /** * Get relatedParty + * * @return relatedParty - **/ + **/ @Schema(description = "") - @Valid - public List getRelatedParty() { + @Valid + public List getRelatedParty() { return relatedParty; } @@ -557,11 +631,12 @@ public class ProductOrderCreate { /** * When sub-classing, this defines the super-class + * * @return baseType - **/ + **/ @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { + + public String getAtBaseType() { return baseType; } @@ -576,17 +651,40 @@ public class ProductOrderCreate { /** * A URI to a JSON-Schema file that defines additional attributes and relationships + * * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { + **/ + @Schema( + description = "A URI to a JSON-Schema file that defines additional attributes and relationships") + + public String getAtSchemaLocation() { return schemaLocation; } public void setAtSchemaLocation(String schemaLocation) { this.schemaLocation = schemaLocation; } + + public ProductOrderCreate state(ProductOrderStateType state) { + this.state = state; + return this; + } + + /** + * Get state + * + * @return state + **/ + @Schema(description = "") + + @Valid + public ProductOrderStateType getState() { + return state; + } + + public void setState(ProductOrderStateType state) { + this.state = state; + } public ProductOrderCreate type(String type) { this.type = type; @@ -595,11 +693,12 @@ public class ProductOrderCreate { /** * When sub-classing, this defines the sub-class entity name + * * @return type - **/ + **/ @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { + + public String getAtType() { return type; } @@ -617,48 +716,54 @@ public class ProductOrderCreate { return false; } ProductOrderCreate productOrderCreate = (ProductOrderCreate) o; - return Objects.equals(this.cancellationDate, productOrderCreate.cancellationDate) && - Objects.equals(this.cancellationReason, productOrderCreate.cancellationReason) && - Objects.equals(this.category, productOrderCreate.category) && - Objects.equals(this.description, productOrderCreate.description) && - Objects.equals(this.externalId, productOrderCreate.externalId) && - Objects.equals(this.notificationContact, productOrderCreate.notificationContact) && - Objects.equals(this.priority, productOrderCreate.priority) && - Objects.equals(this.requestedCompletionDate, productOrderCreate.requestedCompletionDate) && - Objects.equals(this.requestedStartDate, productOrderCreate.requestedStartDate) && - Objects.equals(this.agreement, productOrderCreate.agreement) && - Objects.equals(this.billingAccount, productOrderCreate.billingAccount) && - Objects.equals(this.channel, productOrderCreate.channel) && - Objects.equals(this.note, productOrderCreate.note) && - Objects.equals(this.orderTotalPrice, productOrderCreate.orderTotalPrice) && - Objects.equals(this.payment, productOrderCreate.payment) && - Objects.equals(this.productOfferingQualification, productOrderCreate.productOfferingQualification) && - Objects.equals(this.productOrderItem, productOrderCreate.productOrderItem) && - Objects.equals(this.quote, productOrderCreate.quote) && - Objects.equals(this.relatedParty, productOrderCreate.relatedParty) && - Objects.equals(this.baseType, productOrderCreate.baseType) && - Objects.equals(this.schemaLocation, productOrderCreate.schemaLocation) && - Objects.equals(this.type, productOrderCreate.type); + return Objects.equals(this.cancellationDate, productOrderCreate.cancellationDate) + && Objects.equals(this.cancellationReason, productOrderCreate.cancellationReason) + && Objects.equals(this.category, productOrderCreate.category) + && Objects.equals(this.description, productOrderCreate.description) + && Objects.equals(this.externalId, productOrderCreate.externalId) + && Objects.equals(this.notificationContact, productOrderCreate.notificationContact) + && Objects.equals(this.priority, productOrderCreate.priority) + && Objects.equals(this.requestedCompletionDate, productOrderCreate.requestedCompletionDate) + && Objects.equals(this.requestedStartDate, productOrderCreate.requestedStartDate) + && Objects.equals(this.agreement, productOrderCreate.agreement) + && Objects.equals(this.billingAccount, productOrderCreate.billingAccount) + && Objects.equals(this.channel, productOrderCreate.channel) + && Objects.equals(this.note, productOrderCreate.note) + && Objects.equals(this.orderTotalPrice, productOrderCreate.orderTotalPrice) + && Objects.equals(this.payment, productOrderCreate.payment) + && Objects.equals(this.productOfferingQualification, + productOrderCreate.productOfferingQualification) + && Objects.equals(this.productOrderItem, productOrderCreate.productOrderItem) + && Objects.equals(this.quote, productOrderCreate.quote) + && Objects.equals(this.relatedParty, productOrderCreate.relatedParty) + && Objects.equals(this.baseType, productOrderCreate.baseType) + && Objects.equals(this.schemaLocation, productOrderCreate.schemaLocation) + && Objects.equals(this.type, productOrderCreate.type); } @Override public int hashCode() { - return Objects.hash(cancellationDate, cancellationReason, category, description, externalId, notificationContact, priority, requestedCompletionDate, requestedStartDate, agreement, billingAccount, channel, note, orderTotalPrice, payment, productOfferingQualification, productOrderItem, quote, relatedParty, baseType, schemaLocation, type); + return Objects.hash(cancellationDate, cancellationReason, category, description, externalId, + notificationContact, priority, requestedCompletionDate, requestedStartDate, agreement, + billingAccount, channel, note, orderTotalPrice, payment, productOfferingQualification, + productOrderItem, quote, relatedParty, baseType, schemaLocation, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProductOrderCreate {\n"); - + sb.append(" cancellationDate: ").append(toIndentedString(cancellationDate)).append("\n"); sb.append(" cancellationReason: ").append(toIndentedString(cancellationReason)).append("\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); - sb.append(" notificationContact: ").append(toIndentedString(notificationContact)).append("\n"); + sb.append(" notificationContact: ").append(toIndentedString(notificationContact)) + .append("\n"); sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); - sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n"); + sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)) + .append("\n"); sb.append(" requestedStartDate: ").append(toIndentedString(requestedStartDate)).append("\n"); sb.append(" agreement: ").append(toIndentedString(agreement)).append("\n"); sb.append(" billingAccount: ").append(toIndentedString(billingAccount)).append("\n"); @@ -666,7 +771,8 @@ public class ProductOrderCreate { sb.append(" note: ").append(toIndentedString(note)).append("\n"); sb.append(" orderTotalPrice: ").append(toIndentedString(orderTotalPrice)).append("\n"); sb.append(" payment: ").append(toIndentedString(payment)).append("\n"); - sb.append(" productOfferingQualification: ").append(toIndentedString(productOfferingQualification)).append("\n"); + sb.append(" productOfferingQualification: ") + .append(toIndentedString(productOfferingQualification)).append("\n"); sb.append(" productOrderItem: ").append(toIndentedString(productOrderItem)).append("\n"); sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); sb.append(" relatedParty: ").append(toIndentedString(relatedParty)).append("\n"); @@ -678,8 +784,7 @@ public class ProductOrderCreate { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreateEvent.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreateEvent.java index 4bbbc94ec5f7bc3ba9aed107aec04832793ef214..f49750ddae92c9bb1a94bc4d5fc1313c800a338f 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreateEvent.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreateEvent.java @@ -21,11 +21,8 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; @@ -296,6 +293,9 @@ public class ProductOrderCreateEvent { @Valid public ProductOrderCreateEventPayload getEvent() { + if (event==null) { + event = new ProductOrderCreateEventPayload(); + } return event; } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreateEventPayload.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreateEventPayload.java index f89b45db0ec823740a0bc988b02e50497b56bdc5..9dd985f1112da0bf1651d151d51d541166806a71 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreateEventPayload.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreateEventPayload.java @@ -20,11 +20,8 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreateNotification.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreateNotification.java new file mode 100644 index 0000000000000000000000000000000000000000..29d452210bf6dbe9107d0f5c0116232e3909d4e4 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreateNotification.java @@ -0,0 +1,91 @@ +package org.etsi.osl.tmf.po622.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.etsi.osl.tmf.common.model.Notification; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; + +public class ProductOrderCreateNotification extends Notification { + + @JsonProperty("event") + private ProductOrderCreateEvent event = null; + + public ProductOrderCreateNotification eventId(String eventId) { + this.eventId = eventId; + return this; + } + + + + public ProductOrderCreateNotification event(ProductOrderCreateEvent event) { + this.event = event; + return this; + } + + /** + * The event linked to the involved resource object + * @return event + **/ + @Schema(description = "The event linked to the involved resource object") + + @Valid + + public ProductOrderCreateEvent getEvent() { + return event; + } + + public void setEvent(ProductOrderCreateEvent event) { + this.event = event; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductOrderCreateNotification prodOrderCreateNotification = (ProductOrderCreateNotification) o; + return Objects.equals(this.eventId, prodOrderCreateNotification.eventId) && + Objects.equals(this.eventTime, prodOrderCreateNotification.eventTime) && + Objects.equals(this.eventType, prodOrderCreateNotification.eventType) && + Objects.equals(this.fieldPath, prodOrderCreateNotification.fieldPath) && + Objects.equals(this.resourcePath, prodOrderCreateNotification.resourcePath) && + Objects.equals(this.event, prodOrderCreateNotification.event); + } + + @Override + public int hashCode() { + return Objects.hash(eventId, eventTime, eventType, fieldPath, resourcePath, event); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductOrderCreateNotification {\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(" fieldPath: ").append(toIndentedString(fieldPath)).append("\n"); + sb.append(" resourcePath: ").append(toIndentedString(resourcePath)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderDeleteEvent.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderDeleteEvent.java index dd87d1c2594fba8e898da2403214a417ca8db98f..e4f4d2965521a9c108c59eeb871583e991f313b8 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderDeleteEvent.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderDeleteEvent.java @@ -21,11 +21,8 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; @@ -296,6 +293,9 @@ public class ProductOrderDeleteEvent { @Valid public ProductOrderDeleteEventPayload getEvent() { + if (event==null) { + event = new ProductOrderDeleteEventPayload(); + } return event; } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderDeleteEventPayload.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderDeleteEventPayload.java index 94de1d9401fe89347312f8f2c2dacf029dfcb130..474cdc8d9004d73053bbca2c555c19ffb51f492a 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderDeleteEventPayload.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderDeleteEventPayload.java @@ -20,11 +20,8 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderDeleteNotification.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderDeleteNotification.java new file mode 100644 index 0000000000000000000000000000000000000000..a88c4b578f309e4d1f14017cfaf5ba105198722c --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderDeleteNotification.java @@ -0,0 +1,92 @@ +package org.etsi.osl.tmf.po622.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.etsi.osl.tmf.common.model.Notification; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; + +public class ProductOrderDeleteNotification extends Notification { + + + @JsonProperty("event") + private ProductOrderDeleteEvent event = null; + + public ProductOrderDeleteNotification eventId(String eventId) { + this.eventId = eventId; + return this; + } + + + + public ProductOrderDeleteNotification event(ProductOrderDeleteEvent event) { + this.event = event; + return this; + } + + /** + * The event linked to the involved resource object + * @return event + **/ + @Schema(description = "The event linked to the involved resource object") + + @Valid + + public ProductOrderDeleteEvent getEvent() { + return event; + } + + public void setEvent(ProductOrderDeleteEvent event) { + this.event = event; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductOrderDeleteNotification productOrderDeleteNotification = (ProductOrderDeleteNotification) o; + return Objects.equals(this.eventId, productOrderDeleteNotification.eventId) && + Objects.equals(this.eventTime, productOrderDeleteNotification.eventTime) && + Objects.equals(this.eventType, productOrderDeleteNotification.eventType) && + Objects.equals(this.fieldPath, productOrderDeleteNotification.fieldPath) && + Objects.equals(this.resourcePath, productOrderDeleteNotification.resourcePath) && + Objects.equals(this.event, productOrderDeleteNotification.event); + } + + @Override + public int hashCode() { + return Objects.hash(eventId, eventTime, eventType, fieldPath, resourcePath, event); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductOrderDeleteNotification {\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(" fieldPath: ").append(toIndentedString(fieldPath)).append("\n"); + sb.append(" resourcePath: ").append(toIndentedString(resourcePath)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderInformationRequiredEvent.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderInformationRequiredEvent.java index 38a85af6c8b9818eea00504db1d7c9abaf391876..ab26a297734dc6675ec1720d50097f6f83a4d85e 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderInformationRequiredEvent.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderInformationRequiredEvent.java @@ -21,11 +21,8 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderInformationRequiredEventPayload.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderInformationRequiredEventPayload.java index 603295d4eb3468dba906c2eb5d27701a4f76da6e..d0743f12e1578e3506dd64077362c44f969be12e 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderInformationRequiredEventPayload.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderInformationRequiredEventPayload.java @@ -20,11 +20,8 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItem.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItem.java index a2dcbb8d0562635acd83bc54fc289b228d4cb21b..a9042a24d7dd0931597a77ba54bdc6e955b51904 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItem.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItem.java @@ -19,15 +19,22 @@ */ package org.etsi.osl.tmf.po622.model; -import java.util.ArrayList; -import java.util.List; +import java.util.HashSet; import java.util.Objects; - +import java.util.Set; import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootEntity; +import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef; +import org.etsi.osl.tmf.pim637.model.BillingAccountRef; +import org.etsi.osl.tmf.pim637.model.ProductRef; +import org.etsi.osl.tmf.pim637.model.ProductRefOrValue; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; @@ -37,7 +44,8 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "An identified part of the order. A product order is decomposed into one or more order items.") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductOrderItem { +@Entity(name = "POItem622") +public class ProductOrderItem extends BaseRootEntity { @JsonProperty("id") private String id = null; @@ -48,67 +56,73 @@ public class ProductOrderItem { private OrderItemActionType action = null; @JsonProperty("appointment") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "appoint_refuuid", referencedColumnName = "uuid") private AppointmentRef appointment = null; @JsonProperty("billingAccount") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "billing_acc_refuuid", referencedColumnName = "uuid") private BillingAccountRef billingAccount = null; @JsonProperty("itemPrice") @Valid - private List itemPrice = null; + @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private Set itemPrice = new HashSet<>(); @JsonProperty("itemTerm") @Valid - private List itemTerm = null; + @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private Set itemTerm = new HashSet<>(); @JsonProperty("itemTotalPrice") @Valid - private List itemTotalPrice = null; + @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private Set itemTotalPrice = new HashSet<>(); @JsonProperty("payment") @Valid - private List payment = null; + @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private Set payment = new HashSet<>(); @JsonProperty("product") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "prod_refuuid", referencedColumnName = "uuid") private ProductRefOrValue product = null; @JsonProperty("productOffering") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "prodoff_refuuid", referencedColumnName = "uuid") private ProductOfferingRef productOffering = null; @JsonProperty("productOfferingQualificationItem") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "prodoffqual_refuuid", referencedColumnName = "uuid") private ProductOfferingQualificationItemRef productOfferingQualificationItem = null; @JsonProperty("productOrderItem") @Valid - private List productOrderItem = null; + @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private Set productOrderItem = new HashSet<>(); @JsonProperty("productOrderItemRelationship") @Valid - private List productOrderItemRelationship = null; + @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private Set productOrderItemRelationship = new HashSet<>(); @JsonProperty("qualification") @Valid - private List qualification = null; + @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private Set qualification = new HashSet<>(); @JsonProperty("quoteItem") + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "qitem_refuuid", referencedColumnName = "uuid") private QuoteItemRef quoteItem = null; @JsonProperty("state") - private ProductOrderItemStateType state = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; + private ProductOrderItemStateType state = ProductOrderItemStateType.INITIAL; - @JsonProperty("@type") - private String type = null; - - public ProductOrderItem id(String id) { - this.id = id; - return this; - } /** * Identifier of the line item (generally it is a sequence number 01, 02, 03, ...) @@ -118,12 +132,9 @@ public class ProductOrderItem { @NotNull public String getId() { - return id; + return uuid; } - public void setId(String id) { - this.id = id; - } public ProductOrderItem quantity(Integer quantity) { this.quantity = quantity; @@ -205,14 +216,14 @@ public class ProductOrderItem { this.billingAccount = billingAccount; } - public ProductOrderItem itemPrice(List itemPrice) { + public ProductOrderItem itemPrice(Set itemPrice) { this.itemPrice = itemPrice; return this; } public ProductOrderItem addItemPriceItem(OrderPrice itemPriceItem) { if (this.itemPrice == null) { - this.itemPrice = new ArrayList<>(); + this.itemPrice = new HashSet<>(); } this.itemPrice.add(itemPriceItem); return this; @@ -224,22 +235,22 @@ public class ProductOrderItem { **/ @Schema(description = "") @Valid - public List getItemPrice() { + public Set getItemPrice() { return itemPrice; } - public void setItemPrice(List itemPrice) { + public void setItemPrice(Set itemPrice) { this.itemPrice = itemPrice; } - public ProductOrderItem itemTerm(List itemTerm) { + public ProductOrderItem itemTerm(Set itemTerm) { this.itemTerm = itemTerm; return this; } public ProductOrderItem addItemTermItem(OrderTerm itemTermItem) { if (this.itemTerm == null) { - this.itemTerm = new ArrayList<>(); + this.itemTerm = new HashSet<>(); } this.itemTerm.add(itemTermItem); return this; @@ -251,22 +262,22 @@ public class ProductOrderItem { **/ @Schema(description = "") @Valid - public List getItemTerm() { + public Set getItemTerm() { return itemTerm; } - public void setItemTerm(List itemTerm) { + public void setItemTerm(Set itemTerm) { this.itemTerm = itemTerm; } - public ProductOrderItem itemTotalPrice(List itemTotalPrice) { + public ProductOrderItem itemTotalPrice(Set itemTotalPrice) { this.itemTotalPrice = itemTotalPrice; return this; } public ProductOrderItem addItemTotalPriceItem(OrderPrice itemTotalPriceItem) { if (this.itemTotalPrice == null) { - this.itemTotalPrice = new ArrayList<>(); + this.itemTotalPrice = new HashSet<>(); } this.itemTotalPrice.add(itemTotalPriceItem); return this; @@ -278,22 +289,22 @@ public class ProductOrderItem { **/ @Schema(description = "") @Valid - public List getItemTotalPrice() { + public Set getItemTotalPrice() { return itemTotalPrice; } - public void setItemTotalPrice(List itemTotalPrice) { + public void setItemTotalPrice(Set itemTotalPrice) { this.itemTotalPrice = itemTotalPrice; } - public ProductOrderItem payment(List payment) { + public ProductOrderItem payment(Set payment) { this.payment = payment; return this; } public ProductOrderItem addPaymentItem(PaymentRef paymentItem) { if (this.payment == null) { - this.payment = new ArrayList<>(); + this.payment = new HashSet<>(); } this.payment.add(paymentItem); return this; @@ -305,11 +316,11 @@ public class ProductOrderItem { **/ @Schema(description = "") @Valid - public List getPayment() { + public Set getPayment() { return payment; } - public void setPayment(List payment) { + public void setPayment(Set payment) { this.payment = payment; } @@ -373,15 +384,12 @@ public class ProductOrderItem { this.productOfferingQualificationItem = productOfferingQualificationItem; } - public ProductOrderItem productOrderItem(List productOrderItem) { + public ProductOrderItem productOrderItem(Set productOrderItem) { this.productOrderItem = productOrderItem; return this; } public ProductOrderItem addProductOrderItemItem(ProductOrderItem productOrderItemItem) { - if (this.productOrderItem == null) { - this.productOrderItem = new ArrayList<>(); - } this.productOrderItem.add(productOrderItemItem); return this; } @@ -392,22 +400,22 @@ public class ProductOrderItem { **/ @Schema(description = "") @Valid - public List getProductOrderItem() { + public Set getProductOrderItem() { return productOrderItem; } - public void setProductOrderItem(List productOrderItem) { + public void setProductOrderItem(Set productOrderItem) { this.productOrderItem = productOrderItem; } - public ProductOrderItem productOrderItemRelationship(List productOrderItemRelationship) { + public ProductOrderItem productOrderItemRelationship(Set productOrderItemRelationship) { this.productOrderItemRelationship = productOrderItemRelationship; return this; } public ProductOrderItem addProductOrderItemRelationshipItem(OrderItemRelationship productOrderItemRelationshipItem) { if (this.productOrderItemRelationship == null) { - this.productOrderItemRelationship = new ArrayList<>(); + this.productOrderItemRelationship = new HashSet<>(); } this.productOrderItemRelationship.add(productOrderItemRelationshipItem); return this; @@ -419,22 +427,22 @@ public class ProductOrderItem { **/ @Schema(description = "") @Valid - public List getProductOrderItemRelationship() { + public Set getProductOrderItemRelationship() { return productOrderItemRelationship; } - public void setProductOrderItemRelationship(List productOrderItemRelationship) { + public void setProductOrderItemRelationship(Set productOrderItemRelationship) { this.productOrderItemRelationship = productOrderItemRelationship; } - public ProductOrderItem qualification(List qualification) { + public ProductOrderItem qualification(Set qualification) { this.qualification = qualification; return this; } public ProductOrderItem addQualificationItem(ProductOfferingQualificationRef qualificationItem) { if (this.qualification == null) { - this.qualification = new ArrayList<>(); + this.qualification = new HashSet<>(); } this.qualification.add(qualificationItem); return this; @@ -446,11 +454,11 @@ public class ProductOrderItem { **/ @Schema(description = "") @Valid - public List getQualification() { + public Set getQualification() { return qualification; } - public void setQualification(List qualification) { + public void setQualification(Set qualification) { this.qualification = qualification; } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItemStateType.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItemStateType.java index 1fff283fd0a1aeb933020610f5adabe6b1e3ea56..423f489ce5d76d46502144de40759d02a69e927b 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItemStateType.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItemStateType.java @@ -26,16 +26,17 @@ import com.fasterxml.jackson.annotation.JsonValue; * Possible values for the state of the product order item */ public enum ProductOrderItemStateType { - ACKNOWLEDGED("acknowledged"), - REJECTED("rejected"), - PENDING("pending"), - HELD("held"), - INPROGRESS("inProgress"), - CANCELLED("cancelled"), - COMPLETED("completed"), - FAILED("failed"), - ASSESSINGCANCELLATION("assessingCancellation"), - PENDINGCANCELLATION("pendingCancellation"); + INITIAL("INITIAL"), + ACKNOWLEDGED("ACKNOWLEDGED"), + REJECTED("REJECTED"), + PENDING("PENDING"), + HELD("HELD"), + INPROGRESS("INPROGRESS"), + CANCELLED("CANCELLED"), + COMPLETED("COMPLETED"), + FAILED("FAILED"), + ASSESSINGCANCELLATION("ASSESSINGCANCELLATION"), + PENDINGCANCELLATION("PENDINGCANCELLATION"); private String value; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderMapper.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..f6c7a411c40d62fd3839d68c0405e3d9cce1f989 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderMapper.java @@ -0,0 +1,155 @@ +package org.etsi.osl.tmf.po622.model; + +import java.util.List; +import java.util.Set; +import org.etsi.osl.tmf.common.model.Any; +import org.etsi.osl.tmf.common.model.service.Characteristic; +import org.etsi.osl.tmf.common.model.service.Note; +import org.etsi.osl.tmf.common.model.service.ResourceRef; +import org.etsi.osl.tmf.common.model.service.ServiceRef; +import org.etsi.osl.tmf.prm669.model.RelatedParty; +import org.etsi.osl.tmf.so641.model.ServiceOrderRelationship; +import org.mapstruct.BeanMapping; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.MappingTarget; +import org.mapstruct.NullValueCheckStrategy; +import org.mapstruct.NullValueMappingStrategy; +import org.mapstruct.NullValuePropertyMappingStrategy; + +@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT, + nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS) +public interface ProductOrderMapper { + + @Mapping(target = "uuid", ignore = true) + @Mapping(target = "baseType", ignore = true) + @Mapping(target = "href", ignore = true) + @Mapping(target = "schemaLocation", ignore = true) + @Mapping(target = "type", ignore = true) + ProductOrder fromProductOrderUpdate(ProductOrderUpdate rpdto); + + + + @Mapping(target = "baseType", ignore = true) + @Mapping(target = "schemaLocation", ignore = true) + @Mapping(target = "href", ignore = true) + @Mapping(target = "type", ignore = true) + @Mapping(target = "uuid", ignore = true) + @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE) + @Mapping(target = "productOrderItem", expression = "java(updateProductOrderItem(entity, updateEntity))") + @Mapping(target = "note", expression = "java(updateNote(entity, updateEntity))") + @Mapping(target = "relatedParty", expression = "java(updateRelatedParty(entity, updateEntity))") + ProductOrder updateProductOrder(@MappingTarget ProductOrder entity, + ProductOrderUpdate updateEntity); + + default Set updateProductOrderItem(ProductOrder so, + ProductOrderUpdate updateEntity) { + if (updateEntity.getProductOrderItem() != null) { + for (ProductOrderItem soiUpd : updateEntity.getProductOrderItem()) { + ProductOrderItem soiOrigin = so.findOrderItemById(soiUpd.getId()); + if (soiOrigin != null) { + soiOrigin = updateOrderItem(soiOrigin, soiUpd); + + + /** + * When we patch the order and see a MODIFY or DELETE action, we set the state to + * ACKNOWLEDGED + */ + if (soiOrigin.getAction().equals(OrderItemActionType.MODIFY) + || soiOrigin.getAction().equals(OrderItemActionType.DELETE)) { + soiOrigin.setState(ProductOrderItemStateType.ACKNOWLEDGED); + so.setState(ProductOrderStateType.ACKNOWLEDGED); + + + } + + }else { + so.addProductOrderItemItem(soiUpd); + } + } + } + return so.getProductOrderItem(); + } + + + default ProductOrderItem updateOrderItem(final ProductOrderItem soi, final ProductOrderItem soiUpd) { + ProductOrderItem soiOrigin = soi; + if (soiUpd.getAction() != null) { + soiOrigin.setAction(soiUpd.getAction()); + } + + + + if (soiUpd.getProductOffering() != null) { + soiOrigin.setProductOffering(soiUpd.getProductOffering()); + } + + if (soiUpd.getProduct() != null) { + if (soiOrigin.getProduct() == null) { + soiOrigin.setProduct(soiUpd.getProduct()); + } else { + soiOrigin.getProduct().setStatus(soiUpd.getProduct().getStatus());// this probably will + // change only + soiOrigin.getProduct().setName(soiUpd.getProduct().getName()); + + + for (Characteristic updChar : soiUpd.getProduct().getProductCharacteristic()) { + String charname = updChar.getName(); + Characteristic originChar = soiOrigin.getProduct().findCharacteristicByName(charname); + if ((originChar != null) && (updChar != null) && (originChar.getValue() != null) + && (originChar.getValue().getValue() != null) && (updChar.getValue() != null)) { + if (!originChar.getValue().getValue().equals(updChar.getValue().getValue())) { + originChar.setValue(new Any(updChar.getValue())); + } + } else if ((originChar != null) && (originChar.getValue() == null) + && (updChar.getValue() != null)) { + originChar.setValue(new Any(updChar.getValue())); + } + } + + // we need also to update supportingServices + for (ServiceRef serviceRef : soiUpd.getProduct().getRealizingService()) { + if (soiOrigin.getProduct().getRealizingServiceById(serviceRef.getId()) == null) { + soiOrigin.getProduct().addRealizingServiceItem(serviceRef); + } + } + + for (ResourceRef resourceRef : soiUpd.getProduct().getRealizingResource()) { + if (soiOrigin.getProduct().getRealizingResourceById(resourceRef.getId()) == null) { + soiOrigin.getProduct().addRealizingResourceItem(resourceRef); + } + } + + + } + } + return soiOrigin; + } + + + + default Set updateNote(ProductOrder so, ProductOrderUpdate updateEntity) { + if (updateEntity.getNote() != null) { + for (Note n : updateEntity.getNote()) { + if (n.getUuid() == null) { + so.addNoteItem(n); + } + } + + } + return so.getNote(); + } + + default Set updateRelatedParty(ProductOrder so, ProductOrderUpdate updateEntity) { + if (updateEntity.getRelatedParty() != null) { + for (RelatedParty n : updateEntity.getRelatedParty()) { + if (n.getUuid() == null) { + so.addRelatedPartyItem(n); + } + } + } + return so.getRelatedParty(); + } + + +} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderRef.java index 3f9c0ebc819f15942017179da9d4f0832b4de5da..b6b0162b907fde895b09b21749f86cea7bca9cf2 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderRef.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderRef.java @@ -20,11 +20,8 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateChangeEvent.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateChangeEvent.java index 613e5c7d861858e5e1e5ccb22b6cdd8feffeac0c..00b751a34a488fe038a9654a23019fd41ea986fb 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateChangeEvent.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateChangeEvent.java @@ -21,11 +21,8 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; @@ -296,6 +293,9 @@ public class ProductOrderStateChangeEvent { @Valid public ProductOrderStateChangeEventPayload getEvent() { + if (event==null) { + event = new ProductOrderStateChangeEventPayload(); + } return event; } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateChangeEventPayload.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateChangeEventPayload.java index 3ca7b78837b469f4a93552919ec81a02123d7a7b..37e3b872a9bbfd79a36f3f0955a6f8ecf052fa55 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateChangeEventPayload.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateChangeEventPayload.java @@ -20,11 +20,8 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateChangeNotification.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateChangeNotification.java new file mode 100644 index 0000000000000000000000000000000000000000..4fb2115154dffbc8190ff30fb4905f7be2d784f2 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateChangeNotification.java @@ -0,0 +1,90 @@ +package org.etsi.osl.tmf.po622.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.etsi.osl.tmf.common.model.Notification; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; + +public class ProductOrderStateChangeNotification extends Notification { + + @JsonProperty("event") + private ProductOrderStateChangeEvent event = null; + + public ProductOrderStateChangeNotification eventId(String eventId) { + this.eventId = eventId; + return this; + } + + + + public ProductOrderStateChangeNotification event(ProductOrderStateChangeEvent event) { + this.event = event; + return this; + } + + /** + * The event linked to the involved resource object + * @return event + **/ + @Schema(description = "The event linked to the involved resource object") + + @Valid + + public ProductOrderStateChangeEvent getEvent() { + return event; + } + + public void setEvent(ProductOrderStateChangeEvent event) { + this.event = event; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductOrderStateChangeNotification productOrderStateChangeNotification = (ProductOrderStateChangeNotification) o; + return Objects.equals(this.eventId, productOrderStateChangeNotification.eventId) && + Objects.equals(this.eventTime, productOrderStateChangeNotification.eventTime) && + Objects.equals(this.eventType, productOrderStateChangeNotification.eventType) && + Objects.equals(this.fieldPath, productOrderStateChangeNotification.fieldPath) && + Objects.equals(this.resourcePath, productOrderStateChangeNotification.resourcePath) && + Objects.equals(this.event, productOrderStateChangeNotification.event); + } + + @Override + public int hashCode() { + return Objects.hash(eventId, eventTime, eventType, fieldPath, resourcePath, event); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductOrderStateChangeNotification {\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(" fieldPath: ").append(toIndentedString(fieldPath)).append("\n"); + sb.append(" resourcePath: ").append(toIndentedString(resourcePath)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateType.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateType.java index f6766150efc32f11df5816e670cc786786a5211b..dd26b1bc245f4ad34ba08a20a5b6622b51b5a0b0 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateType.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderStateType.java @@ -26,17 +26,18 @@ import com.fasterxml.jackson.annotation.JsonValue; * Possible values for the state of the order */ public enum ProductOrderStateType { - ACKNOWLEDGED("acknowledged"), - REJECTED("rejected"), - PENDING("pending"), - HELD("held"), - INPROGRESS("inProgress"), - CANCELLED("cancelled"), - COMPLETED("completed"), - FAILED("failed"), - PARTIAL("partial"), - ASSESSINGCANCELLATION("assessingCancellation"), - PENDINGCANCELLATION("pendingCancellation"); + INITIAL("INITIAL"), + ACKNOWLEDGED("ACKNOWLEDGED"), + REJECTED("REJECTED"), + PENDING("PENDING"), + HELD("HELD"), + INPROGRESS("INPROGRESS"), + CANCELLED("CANCELLED"), + COMPLETED("COMPLETED"), + FAILED("FAILED"), + PARTIAL("PARTIAL"), + ASSESSINGCANCELLATION("ASSESSINGCANCELLATION"), + PENDINGCANCELLATION("PENDINGCANCELLATION"); private String value; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderUpdate.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderUpdate.java index ddef47a6244d23c6a0ea947b73a76637b3a8f965..e705a5ac48d91435435e97a24fb37c80963eb071 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderUpdate.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderUpdate.java @@ -23,9 +23,9 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; import org.etsi.osl.tmf.common.model.service.Note; +import org.etsi.osl.tmf.pim637.model.BillingAccountRef; import org.etsi.osl.tmf.prm669.model.RelatedParty; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; @@ -34,12 +34,16 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; /** - * A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,orderDate + * A Product Order is a type of order which can be used to place an order between a customer and a + * service provider or between a service provider and a partner and vice versa, Skipped properties: + * id,href,orderDate */ -@Schema(description = "A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,orderDate") +@Schema( + description = "A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,orderDate") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductOrderUpdate { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", + date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") +public class ProductOrderUpdate { @JsonProperty("cancellationDate") private OffsetDateTime cancellationDate = null; @@ -49,13 +53,12 @@ public class ProductOrderUpdate { @JsonProperty("category") private String category = null; - @JsonProperty("completionDate") + private OffsetDateTime completionDate = null; @JsonProperty("description") private String description = null; - @JsonProperty("expectedCompletionDate") private OffsetDateTime expectedCompletionDate = null; @JsonProperty("externalId") @@ -67,10 +70,8 @@ public class ProductOrderUpdate { @JsonProperty("priority") private String priority = null; - @JsonProperty("requestedCompletionDate") private OffsetDateTime requestedCompletionDate = null; - @JsonProperty("requestedStartDate") private OffsetDateTime requestedStartDate = null; @JsonProperty("agreement") @@ -130,13 +131,14 @@ public class ProductOrderUpdate { } /** - * Date when the order is cancelled. This is used when order is cancelled. + * Date when the order is cancelled. This is used when order is cancelled. + * * @return cancellationDate - **/ + **/ @Schema(description = "Date when the order is cancelled. This is used when order is cancelled. ") - - @Valid - public OffsetDateTime getCancellationDate() { + + @Valid + public OffsetDateTime getCancellationDate() { return cancellationDate; } @@ -150,12 +152,13 @@ public class ProductOrderUpdate { } /** - * Reason why the order is cancelled. This is used when order is cancelled. + * Reason why the order is cancelled. This is used when order is cancelled. + * * @return cancellationReason - **/ + **/ @Schema(description = "Reason why the order is cancelled. This is used when order is cancelled. ") - - public String getCancellationReason() { + + public String getCancellationReason() { return cancellationReason; } @@ -169,12 +172,15 @@ public class ProductOrderUpdate { } /** - * Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...) + * Used to categorize the order from a business perspective that can be useful for the OM system + * (e.g. \"enterprise\", \"residential\", ...) + * * @return category - **/ - @Schema(description = "Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...)") - - public String getCategory() { + **/ + @Schema( + description = "Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...)") + + public String getCategory() { return category; } @@ -189,12 +195,13 @@ public class ProductOrderUpdate { /** * Date when the order was completed + * * @return completionDate - **/ + **/ @Schema(description = "Date when the order was completed") - - @Valid - public OffsetDateTime getCompletionDate() { + + @Valid + public OffsetDateTime getCompletionDate() { return completionDate; } @@ -207,13 +214,33 @@ public class ProductOrderUpdate { return this; } + @JsonProperty("completionDate") + + public String getCompletionDateStr() { + if (completionDate != null) { + return completionDate.toString(); + } else { + return null; + } + } + + public void setCompletionDate(String completionDate) { + + if (completionDate != null) { + this.completionDate = OffsetDateTime.parse(completionDate); + + } + } + + /** * Description of the product order + * * @return description - **/ + **/ @Schema(description = "Description of the product order") - - public String getDescription() { + + public String getDescription() { return description; } @@ -228,19 +255,37 @@ public class ProductOrderUpdate { /** * Expected delivery date amended by the provider + * * @return expectedCompletionDate - **/ + **/ @Schema(description = "Expected delivery date amended by the provider") - - @Valid - public OffsetDateTime getExpectedCompletionDate() { + + @Valid + public OffsetDateTime getExpectedCompletionDate() { return expectedCompletionDate; } + @JsonProperty("expectedCompletionDate") + public String getExpectedCompletionDateStr() { + if (expectedCompletionDate != null) { + return expectedCompletionDate.toString(); + } else { + return null; + } + } + public void setExpectedCompletionDate(OffsetDateTime expectedCompletionDate) { this.expectedCompletionDate = expectedCompletionDate; } + public void setExpectedCompletionDate(String expectedCompletionDate) { + + if (expectedCompletionDate != null) { + this.expectedCompletionDate = OffsetDateTime.parse(expectedCompletionDate); + + } + } + public ProductOrderUpdate externalId(String externalId) { this.externalId = externalId; return this; @@ -248,11 +293,13 @@ public class ProductOrderUpdate { /** * ID given by the consumer and only understandable by him (to facilitate his searches afterwards) + * * @return externalId - **/ - @Schema(description = "ID given by the consumer and only understandable by him (to facilitate his searches afterwards)") - - public String getExternalId() { + **/ + @Schema( + description = "ID given by the consumer and only understandable by him (to facilitate his searches afterwards)") + + public String getExternalId() { return externalId; } @@ -267,11 +314,13 @@ public class ProductOrderUpdate { /** * Contact attached to the order to send back information regarding this order + * * @return notificationContact - **/ - @Schema(description = "Contact attached to the order to send back information regarding this order") - - public String getNotificationContact() { + **/ + @Schema( + description = "Contact attached to the order to send back information regarding this order") + + public String getNotificationContact() { return notificationContact; } @@ -285,12 +334,15 @@ public class ProductOrderUpdate { } /** - * A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest) + * A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the + * highest priority, and 4 the lowest) + * * @return priority - **/ - @Schema(description = "A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)") - - public String getPriority() { + **/ + @Schema( + description = "A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)") + + public String getPriority() { return priority; } @@ -303,14 +355,32 @@ public class ProductOrderUpdate { return this; } + @JsonProperty("requestedCompletionDate") + public String getRequestedCompletionDateStr() { + if (requestedCompletionDate != null) { + return requestedCompletionDate.toString(); + } else { + return null; + } + } + + public void setRequestedCompletionDate(String requestedCompletionDate) { + + if (requestedCompletionDate != null) { + this.requestedCompletionDate = OffsetDateTime.parse(requestedCompletionDate); + + } + } + /** * Requested delivery date from the requestor perspective + * * @return requestedCompletionDate - **/ + **/ @Schema(description = "Requested delivery date from the requestor perspective") - - @Valid - public OffsetDateTime getRequestedCompletionDate() { + + @Valid + public OffsetDateTime getRequestedCompletionDate() { return requestedCompletionDate; } @@ -324,19 +394,40 @@ public class ProductOrderUpdate { } /** - * Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. + * Order fulfillment start date wished by the requestor. This is used when, for any reason, + * requestor cannot allow seller to begin to operationally begin the fulfillment before a date. + * * @return requestedStartDate - **/ - @Schema(description = "Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. ") - - @Valid - public OffsetDateTime getRequestedStartDate() { + **/ + @Schema( + description = "Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. ") + + @Valid + public OffsetDateTime getRequestedStartDate() { return requestedStartDate; } public void setRequestedStartDate(OffsetDateTime requestedStartDate) { this.requestedStartDate = requestedStartDate; } + + @JsonProperty("requestedStartDate") + public String getRequestedStartDateStr() { + + if (requestedStartDate != null) { + return requestedStartDate.toString(); + } + + return null; + } + + public void setRequestedStartDate(String requestedStartDate) { + + if (requestedStartDate != null) { + this.requestedStartDate = OffsetDateTime.parse(requestedStartDate); + + } + } public ProductOrderUpdate agreement(List agreement) { this.agreement = agreement; @@ -353,11 +444,12 @@ public class ProductOrderUpdate { /** * A reference to an agreement defined in the context of the product order + * * @return agreement - **/ + **/ @Schema(description = "A reference to an agreement defined in the context of the product order") - @Valid - public List getAgreement() { + @Valid + public List getAgreement() { return agreement; } @@ -372,12 +464,13 @@ public class ProductOrderUpdate { /** * Get billingAccount + * * @return billingAccount - **/ + **/ @Schema(description = "") - - @Valid - public BillingAccountRef getBillingAccount() { + + @Valid + public BillingAccountRef getBillingAccount() { return billingAccount; } @@ -400,11 +493,12 @@ public class ProductOrderUpdate { /** * Get channel + * * @return channel - **/ + **/ @Schema(description = "") - @Valid - public List getChannel() { + @Valid + public List getChannel() { return channel; } @@ -427,11 +521,12 @@ public class ProductOrderUpdate { /** * Get note + * * @return note - **/ + **/ @Schema(description = "") - @Valid - public List getNote() { + @Valid + public List getNote() { return note; } @@ -454,11 +549,12 @@ public class ProductOrderUpdate { /** * Get orderTotalPrice + * * @return orderTotalPrice - **/ + **/ @Schema(description = "") - @Valid - public List getOrderTotalPrice() { + @Valid + public List getOrderTotalPrice() { return orderTotalPrice; } @@ -481,11 +577,12 @@ public class ProductOrderUpdate { /** * Get payment + * * @return payment - **/ + **/ @Schema(description = "") - @Valid - public List getPayment() { + @Valid + public List getPayment() { return payment; } @@ -493,12 +590,14 @@ public class ProductOrderUpdate { this.payment = payment; } - public ProductOrderUpdate productOfferingQualification(List productOfferingQualification) { + public ProductOrderUpdate productOfferingQualification( + List productOfferingQualification) { this.productOfferingQualification = productOfferingQualification; return this; } - public ProductOrderUpdate addProductOfferingQualificationItem(ProductOfferingQualificationRef productOfferingQualificationItem) { + public ProductOrderUpdate addProductOfferingQualificationItem( + ProductOfferingQualificationRef productOfferingQualificationItem) { if (this.productOfferingQualification == null) { this.productOfferingQualification = new ArrayList<>(); } @@ -508,15 +607,17 @@ public class ProductOrderUpdate { /** * Get productOfferingQualification + * * @return productOfferingQualification - **/ + **/ @Schema(description = "") - @Valid - public List getProductOfferingQualification() { + @Valid + public List getProductOfferingQualification() { return productOfferingQualification; } - public void setProductOfferingQualification(List productOfferingQualification) { + public void setProductOfferingQualification( + List productOfferingQualification) { this.productOfferingQualification = productOfferingQualification; } @@ -532,12 +633,14 @@ public class ProductOrderUpdate { /** * Get productOrderItem + * * @return productOrderItem - **/ + **/ @Schema(description = "") - @NotNull - @Valid - @Size(min=1) public List getProductOrderItem() { + @NotNull + @Valid + @Size(min = 1) + public List getProductOrderItem() { return productOrderItem; } @@ -560,11 +663,12 @@ public class ProductOrderUpdate { /** * Get quote + * * @return quote - **/ + **/ @Schema(description = "") - @Valid - public List getQuote() { + @Valid + public List getQuote() { return quote; } @@ -587,11 +691,12 @@ public class ProductOrderUpdate { /** * Get relatedParty + * * @return relatedParty - **/ + **/ @Schema(description = "") - @Valid - public List getRelatedParty() { + @Valid + public List getRelatedParty() { return relatedParty; } @@ -606,12 +711,13 @@ public class ProductOrderUpdate { /** * Get state + * * @return state - **/ + **/ @Schema(description = "") - - @Valid - public ProductOrderStateType getState() { + + @Valid + public ProductOrderStateType getState() { return state; } @@ -626,11 +732,12 @@ public class ProductOrderUpdate { /** * When sub-classing, this defines the super-class + * * @return baseType - **/ + **/ @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { + + public String getAtBaseType() { return baseType; } @@ -645,11 +752,13 @@ public class ProductOrderUpdate { /** * A URI to a JSON-Schema file that defines additional attributes and relationships + * * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { + **/ + @Schema( + description = "A URI to a JSON-Schema file that defines additional attributes and relationships") + + public String getAtSchemaLocation() { return schemaLocation; } @@ -664,11 +773,12 @@ public class ProductOrderUpdate { /** * When sub-classing, this defines the sub-class entity name + * * @return type - **/ + **/ @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { + + public String getAtType() { return type; } @@ -686,53 +796,61 @@ public class ProductOrderUpdate { return false; } ProductOrderUpdate productOrderUpdate = (ProductOrderUpdate) o; - return Objects.equals(this.cancellationDate, productOrderUpdate.cancellationDate) && - Objects.equals(this.cancellationReason, productOrderUpdate.cancellationReason) && - Objects.equals(this.category, productOrderUpdate.category) && - Objects.equals(this.completionDate, productOrderUpdate.completionDate) && - Objects.equals(this.description, productOrderUpdate.description) && - Objects.equals(this.expectedCompletionDate, productOrderUpdate.expectedCompletionDate) && - Objects.equals(this.externalId, productOrderUpdate.externalId) && - Objects.equals(this.notificationContact, productOrderUpdate.notificationContact) && - Objects.equals(this.priority, productOrderUpdate.priority) && - Objects.equals(this.requestedCompletionDate, productOrderUpdate.requestedCompletionDate) && - Objects.equals(this.requestedStartDate, productOrderUpdate.requestedStartDate) && - Objects.equals(this.agreement, productOrderUpdate.agreement) && - Objects.equals(this.billingAccount, productOrderUpdate.billingAccount) && - Objects.equals(this.channel, productOrderUpdate.channel) && - Objects.equals(this.note, productOrderUpdate.note) && - Objects.equals(this.orderTotalPrice, productOrderUpdate.orderTotalPrice) && - Objects.equals(this.payment, productOrderUpdate.payment) && - Objects.equals(this.productOfferingQualification, productOrderUpdate.productOfferingQualification) && - Objects.equals(this.productOrderItem, productOrderUpdate.productOrderItem) && - Objects.equals(this.quote, productOrderUpdate.quote) && - Objects.equals(this.relatedParty, productOrderUpdate.relatedParty) && - Objects.equals(this.state, productOrderUpdate.state) && - Objects.equals(this.baseType, productOrderUpdate.baseType) && - Objects.equals(this.schemaLocation, productOrderUpdate.schemaLocation) && - Objects.equals(this.type, productOrderUpdate.type); + return Objects.equals(this.cancellationDate, productOrderUpdate.cancellationDate) + && Objects.equals(this.cancellationReason, productOrderUpdate.cancellationReason) + && Objects.equals(this.category, productOrderUpdate.category) + && Objects.equals(this.completionDate, productOrderUpdate.completionDate) + && Objects.equals(this.description, productOrderUpdate.description) + && Objects.equals(this.expectedCompletionDate, productOrderUpdate.expectedCompletionDate) + && Objects.equals(this.externalId, productOrderUpdate.externalId) + && Objects.equals(this.notificationContact, productOrderUpdate.notificationContact) + && Objects.equals(this.priority, productOrderUpdate.priority) + && Objects.equals(this.requestedCompletionDate, productOrderUpdate.requestedCompletionDate) + && Objects.equals(this.requestedStartDate, productOrderUpdate.requestedStartDate) + && Objects.equals(this.agreement, productOrderUpdate.agreement) + && Objects.equals(this.billingAccount, productOrderUpdate.billingAccount) + && Objects.equals(this.channel, productOrderUpdate.channel) + && Objects.equals(this.note, productOrderUpdate.note) + && Objects.equals(this.orderTotalPrice, productOrderUpdate.orderTotalPrice) + && Objects.equals(this.payment, productOrderUpdate.payment) + && Objects.equals(this.productOfferingQualification, + productOrderUpdate.productOfferingQualification) + && Objects.equals(this.productOrderItem, productOrderUpdate.productOrderItem) + && Objects.equals(this.quote, productOrderUpdate.quote) + && Objects.equals(this.relatedParty, productOrderUpdate.relatedParty) + && Objects.equals(this.state, productOrderUpdate.state) + && Objects.equals(this.baseType, productOrderUpdate.baseType) + && Objects.equals(this.schemaLocation, productOrderUpdate.schemaLocation) + && Objects.equals(this.type, productOrderUpdate.type); } @Override public int hashCode() { - return Objects.hash(cancellationDate, cancellationReason, category, completionDate, description, expectedCompletionDate, externalId, notificationContact, priority, requestedCompletionDate, requestedStartDate, agreement, billingAccount, channel, note, orderTotalPrice, payment, productOfferingQualification, productOrderItem, quote, relatedParty, state, baseType, schemaLocation, type); + return Objects.hash(cancellationDate, cancellationReason, category, completionDate, description, + expectedCompletionDate, externalId, notificationContact, priority, requestedCompletionDate, + requestedStartDate, agreement, billingAccount, channel, note, orderTotalPrice, payment, + productOfferingQualification, productOrderItem, quote, relatedParty, state, baseType, + schemaLocation, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProductOrderUpdate {\n"); - + sb.append(" cancellationDate: ").append(toIndentedString(cancellationDate)).append("\n"); sb.append(" cancellationReason: ").append(toIndentedString(cancellationReason)).append("\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); sb.append(" completionDate: ").append(toIndentedString(completionDate)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)).append("\n"); + sb.append(" expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)) + .append("\n"); sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); - sb.append(" notificationContact: ").append(toIndentedString(notificationContact)).append("\n"); + sb.append(" notificationContact: ").append(toIndentedString(notificationContact)) + .append("\n"); sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); - sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n"); + sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)) + .append("\n"); sb.append(" requestedStartDate: ").append(toIndentedString(requestedStartDate)).append("\n"); sb.append(" agreement: ").append(toIndentedString(agreement)).append("\n"); sb.append(" billingAccount: ").append(toIndentedString(billingAccount)).append("\n"); @@ -740,7 +858,8 @@ public class ProductOrderUpdate { sb.append(" note: ").append(toIndentedString(note)).append("\n"); sb.append(" orderTotalPrice: ").append(toIndentedString(orderTotalPrice)).append("\n"); sb.append(" payment: ").append(toIndentedString(payment)).append("\n"); - sb.append(" productOfferingQualification: ").append(toIndentedString(productOfferingQualification)).append("\n"); + sb.append(" productOfferingQualification: ") + .append(toIndentedString(productOfferingQualification)).append("\n"); sb.append(" productOrderItem: ").append(toIndentedString(productOrderItem)).append("\n"); sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); sb.append(" relatedParty: ").append(toIndentedString(relatedParty)).append("\n"); @@ -753,8 +872,7 @@ public class ProductOrderUpdate { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductSpecificationRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductSpecificationRef.java deleted file mode 100644 index 02b30f6eabf04b7f5d1bc2ca9f68285d6f25a260..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductSpecificationRef.java +++ /dev/null @@ -1,293 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; - -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.springframework.validation.annotation.Validated; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; - -/** - * Product specification reference: A ProductSpecification is a detailed description of a tangible or intangible object made available externally in the form of a ProductOffering to customers or other parties playing a party role. - */ -@Schema(description = "Product specification reference: A ProductSpecification is a detailed description of a tangible or intangible object made available externally in the form of a ProductOffering to customers or other parties playing a party role.") -@Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductSpecificationRef { - @JsonProperty("id") - private String id = null; - - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; - - @JsonProperty("version") - private String version = null; - - @JsonProperty("targetProductSchema") - private TargetProductSchema targetProductSchema = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; - - @JsonProperty("@referredType") - private String _atReferredType = null; - - public ProductSpecificationRef id(String id) { - this.id = id; - return this; - } - - /** - * Unique identifier of a related entity. - * @return id - **/ - @Schema(description = "Unique identifier of a related entity.") - @NotNull - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ProductSpecificationRef href(String href) { - this.href = href; - return this; - } - - /** - * Reference of the related entity. - * @return href - **/ - @Schema(description = "Reference of the related entity.") - - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - public ProductSpecificationRef name(String name) { - this.name = name; - return this; - } - - /** - * Name of the related entity. - * @return name - **/ - @Schema(description = "Name of the related entity.") - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public ProductSpecificationRef version(String version) { - this.version = version; - return this; - } - - /** - * Version of the product specification - * @return version - **/ - @Schema(description = "Version of the product specification") - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public ProductSpecificationRef targetProductSchema(TargetProductSchema targetProductSchema) { - this.targetProductSchema = targetProductSchema; - return this; - } - - /** - * Get targetProductSchema - * @return targetProductSchema - **/ - @Schema(description = "") - - @Valid - public TargetProductSchema getTargetProductSchema() { - return targetProductSchema; - } - - public void setTargetProductSchema(TargetProductSchema targetProductSchema) { - this.targetProductSchema = targetProductSchema; - } - - public ProductSpecificationRef baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public ProductSpecificationRef schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public ProductSpecificationRef type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } - - public ProductSpecificationRef _atReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; - return this; - } - - /** - * The actual type of the target instance when needed for disambiguation. - * @return _atReferredType - **/ - @Schema(description = "The actual type of the target instance when needed for disambiguation.") - - public String getAtReferredType() { - return _atReferredType; - } - - public void setAtReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProductSpecificationRef productSpecificationRef = (ProductSpecificationRef) o; - return Objects.equals(this.id, productSpecificationRef.id) && - Objects.equals(this.href, productSpecificationRef.href) && - Objects.equals(this.name, productSpecificationRef.name) && - Objects.equals(this.version, productSpecificationRef.version) && - Objects.equals(this.targetProductSchema, productSpecificationRef.targetProductSchema) && - Objects.equals(this.baseType, productSpecificationRef.baseType) && - Objects.equals(this.schemaLocation, productSpecificationRef.schemaLocation) && - Objects.equals(this.type, productSpecificationRef.type) && - Objects.equals(this._atReferredType, productSpecificationRef._atReferredType); - } - - @Override - public int hashCode() { - return Objects.hash(id, href, name, version, targetProductSchema, baseType, schemaLocation, type, _atReferredType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProductSpecificationRef {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" href: ").append(toIndentedString(href)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" targetProductSchema: ").append(toIndentedString(targetProductSchema)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" _atReferredType: ").append(toIndentedString(_atReferredType)).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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductStatusType.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductStatusType.java deleted file mode 100644 index a5717e066d0c3717710f46a6e3990c226d98c1c4..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductStatusType.java +++ /dev/null @@ -1,59 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Possible values for the status of the product - */ -public enum ProductStatusType { - CREATED("created"), - PENDINGACTIVE("pendingActive"), - CANCELLED("cancelled"), - ACTIVE("active"), - PENDINGTERMINATE("pendingTerminate"), - TERMINATED("terminated"), - SUSPENDED("suspended"), - ABORTED_("aborted "); - - private String value; - - ProductStatusType(String value) { - this.value = value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ProductStatusType fromValue(String text) { - for (ProductStatusType b : ProductStatusType.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } -} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/QuoteItemRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/QuoteItemRef.java index 9ce513c9081d879f26f86c1967208918a531ed3b..7b9a91ff67cee82931009a20d4c0048b5b0a095a 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/QuoteItemRef.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/QuoteItemRef.java @@ -20,12 +20,11 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -34,16 +33,11 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "It's a Quote item that has been executed previously.") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class QuoteItemRef { +@Entity(name = "QuoteItRef622") +public class QuoteItemRef extends BaseRootNamedEntity { @JsonProperty("id") private String id = null; - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; - @JsonProperty("quoteHref") private String quoteHref = null; @@ -53,14 +47,6 @@ public class QuoteItemRef { @JsonProperty("quoteName") private String quoteName = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; @JsonProperty("@referredType") private String _atReferredType = null; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/QuoteRef.java b/src/main/java/org/etsi/osl/tmf/po622/model/QuoteRef.java index 39278ba46f5f8c0cb72b4a6e597ced2a8c61dd7d..563306e92fcb94eb12e35b2d9a76f243e24077eb 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/QuoteRef.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/QuoteRef.java @@ -20,12 +20,11 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -34,24 +33,11 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "It's a Quote that has been executed previously") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class QuoteRef { +@Entity(name = "QuoteRef622") +public class QuoteRef extends BaseRootNamedEntity { @JsonProperty("id") private String id = null; - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; @JsonProperty("@referredType") private String _atReferredType = null; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/RelatedChannel.java b/src/main/java/org/etsi/osl/tmf/po622/model/RelatedChannel.java index 6b824312249222904d660bb018a256b11e020f9d..e56f90707d0699cf525fffbc0db2cd5332ad4d5c 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/RelatedChannel.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/RelatedChannel.java @@ -20,12 +20,12 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootEntity; +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -34,27 +34,15 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "Related channel to another entity. May be online web, mobile app, social ,etc.") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class RelatedChannel { +@Entity(name = "RelatedChan622") +public class RelatedChannel extends BaseRootNamedEntity { @JsonProperty("id") private String id = null; - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; @JsonProperty("role") private String role = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; @JsonProperty("@referredType") private String _atReferredType = null; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/RelatedProductOrderItem.java b/src/main/java/org/etsi/osl/tmf/po622/model/RelatedProductOrderItem.java index f9e567e8288d6ab697c2380384911d1a282ed784..11efb010f2a010ce6aa29aac1b489b878c82e9ae 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/RelatedProductOrderItem.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/RelatedProductOrderItem.java @@ -20,12 +20,12 @@ package org.etsi.osl.tmf.po622.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonProperty; - +import org.etsi.osl.tmf.common.model.BaseRootEntity; +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; - import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; import jakarta.validation.constraints.NotNull; /** @@ -34,7 +34,8 @@ import jakarta.validation.constraints.NotNull; @Schema(description = "RelatedProductOrderItem (ProductOrder item) .The product order item which triggered product creation/change/termination.") @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class RelatedProductOrderItem { +@Entity(name = "RelatedProdOrdItem622") +public class RelatedProductOrderItem extends BaseRootEntity { @JsonProperty("orderItemAction") private String orderItemAction = null; @@ -50,14 +51,6 @@ public class RelatedProductOrderItem { @JsonProperty("role") private String role = null; - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; @JsonProperty("@referredType") private String _atReferredType = null; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/TargetProductSchema.java b/src/main/java/org/etsi/osl/tmf/po622/model/TargetProductSchema.java deleted file mode 100644 index 34205af02aa50605d33c1a173787219687bb3af8..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/po622/model/TargetProductSchema.java +++ /dev/null @@ -1,148 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 - 2021 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.po622.model; - -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.springframework.validation.annotation.Validated; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; - -/** - * The reference object to the schema and type of target product which is described by product specification - */ -@Schema(description = "The reference object to the schema and type of target product which is described by product specification") -@Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class TargetProductSchema { - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; - - public TargetProductSchema baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { - return baseType; - } - - public void setAtBaseType(String baseType) { - this.baseType = baseType; - } - - public TargetProductSchema schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * This field provides a link to the schema describing the target product - * @return schemaLocation - **/ - @Schema(description = "This field provides a link to the schema describing the target product") - @NotNull - - public String getAtSchemaLocation() { - return schemaLocation; - } - - public void setAtSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public TargetProductSchema type(String type) { - this.type = type; - return this; - } - - /** - * Class type of the target product - * @return type - **/ - @Schema(description = "Class type of the target product") - @NotNull - - public String getAtType() { - return type; - } - - public void setAtType(String type) { - this.type = type; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TargetProductSchema targetProductSchema = (TargetProductSchema) o; - return Objects.equals(this.baseType, targetProductSchema.baseType) && - Objects.equals(this.schemaLocation, targetProductSchema.schemaLocation) && - Objects.equals(this.type, targetProductSchema.type); - } - - @Override - public int hashCode() { - return Objects.hash(baseType, schemaLocation, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TargetProductSchema {\n"); - - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/org/etsi/osl/tmf/prm669/model/Characteristic.java b/src/main/java/org/etsi/osl/tmf/prm669/model/Characteristic.java deleted file mode 100644 index c0ca3cf990a1c82da38ddc388ca43dc04d3e0d72..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/prm669/model/Characteristic.java +++ /dev/null @@ -1,229 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * org.etsi.osl.tmf.api - * %% - * Copyright (C) 2019 openslice.io - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ -package org.etsi.osl.tmf.prm669.model; - -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.etsi.osl.tmf.common.model.Any; -import org.springframework.validation.annotation.Validated; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; - -/** - * Describes a given characteristic of an object or entity through a name/value pair. - */ -@Schema(description = "Describes a given characteristic of an object or entity through a name/value pair.") -@Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-19T23:20:50.154+03:00") - -public class Characteristic { - @JsonProperty("name") - private String name = null; - - @JsonProperty("valueType") - private String valueType = null; - - @JsonProperty("value") - private Any value = null; - - @JsonProperty("@baseType") - private String baseType = null; - - @JsonProperty("@schemaLocation") - private String schemaLocation = null; - - @JsonProperty("@type") - private String type = null; - - public Characteristic name(String name) { - this.name = name; - return this; - } - - /** - * Name of the characteristic - * @return name - **/ - @Schema(description = "Name of the characteristic") - @NotNull - - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Characteristic valueType(String valueType) { - this.valueType = valueType; - return this; - } - - /** - * Data type of the value of the characteristic - * @return valueType - **/ - @Schema(description = "Data type of the value of the characteristic") - - - public String getValueType() { - return valueType; - } - - public void setValueType(String valueType) { - this.valueType = valueType; - } - - public Characteristic value(Any value) { - this.value = value; - return this; - } - - /** - * The value of the characteristic - * @return value - **/ - @Schema(description = "The value of the characteristic") - @NotNull - - @Valid - - public Any getValue() { - return value; - } - - public void setValue(Any value) { - this.value = value; - } - - public Characteristic baseType(String baseType) { - this.baseType = baseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return baseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - - - public String getBaseType() { - return baseType; - } - - public void setBaseType(String baseType) { - this.baseType = baseType; - } - - public Characteristic schemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - - public String getSchemaLocation() { - return schemaLocation; - } - - public void setSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } - - public Characteristic type(String type) { - this.type = type; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return type - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Characteristic characteristic = (Characteristic) o; - return Objects.equals(this.name, characteristic.name) && - Objects.equals(this.valueType, characteristic.valueType) && - Objects.equals(this.value, characteristic.value) && - Objects.equals(this.baseType, characteristic.baseType) && - Objects.equals(this.schemaLocation, characteristic.schemaLocation) && - Objects.equals(this.type, characteristic.type); - } - - @Override - public int hashCode() { - return Objects.hash(name, valueType, value, baseType, schemaLocation, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Characteristic {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" valueType: ").append(toIndentedString(valueType)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); - sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRole.java b/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRole.java index db0583cccc103506a61ec66e44adb7d3ed4229ea..b972197d63778e1551442c40814a4de812d2faf8 100644 --- a/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRole.java +++ b/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRole.java @@ -28,6 +28,7 @@ import org.etsi.osl.tmf.am651.model.AgreementRef; import org.etsi.osl.tmf.am666.model.AccountRef; import org.etsi.osl.tmf.am666.model.PaymentMethodRef; import org.etsi.osl.tmf.common.model.TimePeriod; +import org.etsi.osl.tmf.common.model.service.Characteristic; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRoleCreate.java b/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRoleCreate.java index 436574c9e6bca7691ab55647f47bbf53643963f8..5b4435971dac31ebe2a4cfe73b53c255b9a945f0 100644 --- a/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRoleCreate.java +++ b/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRoleCreate.java @@ -28,6 +28,7 @@ import org.etsi.osl.tmf.am651.model.AgreementRef; import org.etsi.osl.tmf.am666.model.AccountRef; import org.etsi.osl.tmf.am666.model.PaymentMethodRef; import org.etsi.osl.tmf.common.model.TimePeriod; +import org.etsi.osl.tmf.common.model.service.Characteristic; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRoleUpdate.java b/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRoleUpdate.java index 560acbf57d3d663530af95c02abcb01228744bce..3a890cb9930ce0c3dbf991aa3dc4e3c33c35600a 100644 --- a/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRoleUpdate.java +++ b/src/main/java/org/etsi/osl/tmf/prm669/model/PartyRoleUpdate.java @@ -28,6 +28,7 @@ import org.etsi.osl.tmf.am651.model.AgreementRef; import org.etsi.osl.tmf.am666.model.AccountRef; import org.etsi.osl.tmf.am666.model.PaymentMethodRef; import org.etsi.osl.tmf.common.model.TimePeriod; +import org.etsi.osl.tmf.common.model.service.Characteristic; import org.springframework.validation.annotation.Validated; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; diff --git a/src/main/java/org/etsi/osl/tmf/ro652/model/Quantity.java b/src/main/java/org/etsi/osl/tmf/ro652/model/Quantity.java deleted file mode 100644 index 4b6899d742f0de03775539f85c409e309541dd1d..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/ro652/model/Quantity.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.etsi.osl.tmf.ro652.model; - -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.springframework.validation.annotation.Validated; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * An amount in a given unit - */ -@Schema(description = "An amount in a given unit") -@Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2022-09-28T23:39:08.914219800+03:00[Europe/Athens]") -public class Quantity { - @JsonProperty("amount") - private Float amount = 1.0f; - - @JsonProperty("units") - private String units = null; - - public Quantity amount(Float amount) { - this.amount = amount; - return this; - } - - /** - * Numeric value in a given unit - * @return amount - **/ - @Schema(description = "Numeric value in a given unit") - - public Float getAmount() { - return amount; - } - - public void setAmount(Float amount) { - this.amount = amount; - } - - public Quantity units(String units) { - this.units = units; - return this; - } - - /** - * Unit - * @return units - **/ - @Schema(description = "Unit") - - public String getUnits() { - return units; - } - - public void setUnits(String units) { - this.units = units; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Quantity quantity = (Quantity) o; - return Objects.equals(this.amount, quantity.amount) && - Objects.equals(this.units, quantity.units); - } - - @Override - public int hashCode() { - return Objects.hash(amount, units); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Quantity {\n"); - - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" units: ").append(toIndentedString(units)).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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/org/etsi/osl/tmf/rpm685/model/ProductOfferingRef.java b/src/main/java/org/etsi/osl/tmf/rpm685/model/ProductOfferingRef.java deleted file mode 100644 index a0a6750d9454dfb1fbdf418bd1f1a672d14955e7..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/rpm685/model/ProductOfferingRef.java +++ /dev/null @@ -1,183 +0,0 @@ -package org.etsi.osl.tmf.rpm685.model; - -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.springframework.validation.annotation.Validated; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * ProductOffering reference. A product offering represents entities that are orderable from the provider of the catalog, this resource includes pricing information. - */ -@Schema(description = "ProductOffering reference. A product offering represents entities that are orderable from the provider of the catalog, this resource includes pricing information.") -@Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2022-10-05T08:56:49.602231700+03:00[Europe/Athens]") -public class ProductOfferingRef { - @JsonProperty("href") - private String href = null; - - @JsonProperty("id") - private String id = null; - - @JsonProperty("name") - private String name = null; - -// @JsonProperty("bundledProductOffering") -// @Valid -// private List bundledProductOffering = null; - - @JsonProperty("@referredType") - private String _atReferredType = null; - - public ProductOfferingRef href(String href) { - this.href = href; - return this; - } - - /** - * Reference of the product offering - * @return href - **/ - @Schema(description = "Reference of the product offering") - - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - public ProductOfferingRef id(String id) { - this.id = id; - return this; - } - - /** - * Unique identifier of the product offering - * @return id - **/ - @Schema(description = "Unique identifier of the product offering") - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ProductOfferingRef name(String name) { - this.name = name; - return this; - } - - /** - * Name of the product offering - * @return name - **/ - @Schema(description = "Name of the product offering") - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -// public ProductOfferingRef bundledProductOffering(List bundledProductOffering) { -// this.bundledProductOffering = bundledProductOffering; -// return this; -// } -// -// public ProductOfferingRef addBundledProductOfferingItem(BundledProductOfferingRef bundledProductOfferingItem) { -// if (this.bundledProductOffering == null) { -// this.bundledProductOffering = new ArrayList<>(); -// } -// this.bundledProductOffering.add(bundledProductOfferingItem); -// return this; -// } -// -// /** -// * Get bundledProductOffering -// * @return bundledProductOffering -// **/ -// @Schema(description = "") -// @Valid -// public List getBundledProductOffering() { -// return bundledProductOffering; -// } -// -// public void setBundledProductOffering(List bundledProductOffering) { -// this.bundledProductOffering = bundledProductOffering; -// } -// -// public ProductOfferingRef _atReferredType(String _atReferredType) { -// this._atReferredType = _atReferredType; -// return this; -// } - - /** - * The actual type of the target instance when needed for disambiguation. - * @return _atReferredType - **/ - @Schema(description = "The actual type of the target instance when needed for disambiguation.") - - public String getAtReferredType() { - return _atReferredType; - } - - public void setAtReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProductOfferingRef productOfferingRef = (ProductOfferingRef) o; - return Objects.equals(this.href, productOfferingRef.href) && - Objects.equals(this.id, productOfferingRef.id) && - Objects.equals(this.name, productOfferingRef.name) && -// Objects.equals(this.bundledProductOffering, productOfferingRef.bundledProductOffering) && - Objects.equals(this._atReferredType, productOfferingRef._atReferredType); - } - - @Override - public int hashCode() { - return Objects.hash(href, id, name, _atReferredType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProductOfferingRef {\n"); - - sb.append(" href: ").append(toIndentedString(href)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); -// sb.append(" bundledProductOffering: ").append(toIndentedString(bundledProductOffering)).append("\n"); - sb.append(" _atReferredType: ").append(toIndentedString(_atReferredType)).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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -}