+++ /dev/null
-/**
- * Copyright (c) 2018 Orange
- *
- * 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.
- */
-/*
- * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
- * open API16.5 + applied TMF guideline 3.0
- *
- * OpenAPI spec version: 0.1.1_inProgress
- *
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
- *
- * 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.
- */
-
-
-package org.onap.nbi.apis.serviceorder.model;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import javax.validation.constraints.NotNull;
-import java.util.Objects;
-
-/**
- * Used to precise that an appointment was set-up with a related party for this order item
- */
-@ApiModel(description = "Used to precise that an appointment was set-up with a related party for this order item")
-@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
- date = "2018-02-19T14:00:30.767Z")
-public class AppointmentRef {
- @JsonProperty("id")
- private String id = null;
-
- @JsonProperty("href")
- private String href = null;
-
- @JsonProperty("@referredType")
- private String referredType = null;
-
- public AppointmentRef id(String id) {
- this.id = id;
- return this;
- }
-
- /**
- * Unique identifier of the appointment
- *
- * @return id
- **/
- @JsonProperty("id")
- @ApiModelProperty(required = true, value = "Unique identifier of the appointment")
- @NotNull
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public AppointmentRef href(String href) {
- this.href = href;
- return this;
- }
-
- /**
- * Reference of the appointmenrt
- *
- * @return href
- **/
- @JsonProperty("href")
- @ApiModelProperty(required = true, value = "Reference of the appointmenrt")
- @NotNull
- public String getHref() {
- return href;
- }
-
- public void setHref(String href) {
- this.href = href;
- }
-
- public AppointmentRef referredType(String referredType) {
- this.referredType = referredType;
- return this;
- }
-
- /**
- * @return referredType
- **/
- @JsonProperty("@referredType")
- @ApiModelProperty(value = "")
- 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;
- }
- AppointmentRef appointmentRef = (AppointmentRef) o;
- return Objects.equals(this.id, appointmentRef.id) && Objects.equals(this.href, appointmentRef.href)
- && Objects.equals(this.referredType, appointmentRef.referredType);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, href, referredType);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AppointmentRef {\n");
-
- sb.append(" id: ").append(toIndentedString(id)).append("\n");
- sb.append(" href: ").append(toIndentedString(href)).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 ");
- }
-}
-
+++ /dev/null
-/**
- * Copyright (c) 2018 Orange
- *
- * 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.
- */
-/*
- * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
- * open API16.5 + applied TMF guideline 3.0
- *
- * OpenAPI spec version: 0.1.1_inProgress
- *
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
- *
- * 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.
- */
-
-
-package org.onap.nbi.apis.serviceorder.model;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import javax.validation.constraints.NotNull;
-import java.util.Objects;
-
-/**
- *
- */
-@ApiModel(description = "")
-@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
- date = "2018-02-19T14:00:30.767Z")
-public class ErrorRepresentation {
- @JsonProperty("code")
- private Integer 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("@type")
- private String type = null;
-
- @JsonProperty("@schemaLocation")
- private String schemaLocation = null;
-
- public ErrorRepresentation code(Integer code) {
- this.code = code;
- return this;
- }
-
- /**
- * Application related code (as defined in the API or from a common list)
- *
- * @return code
- **/
- @JsonProperty("code")
- @ApiModelProperty(required = true, value = "Application related code (as defined in the API or from a common list)")
- @NotNull
- public Integer getCode() {
- return code;
- }
-
- public void setCode(Integer code) {
- this.code = code;
- }
-
- public ErrorRepresentation reason(String reason) {
- this.reason = reason;
- return this;
- }
-
- /**
- * Text that explains the reason for error. This can be shown to a client user.
- *
- * @return reason
- **/
- @JsonProperty("reason")
- @ApiModelProperty(required = true,
- value = "Text that explains the reason for error. This can be shown to a client user.")
- @NotNull
- public String getReason() {
- return reason;
- }
-
- public void setReason(String reason) {
- this.reason = reason;
- }
-
- public ErrorRepresentation message(String message) {
- this.message = message;
- return this;
- }
-
- /**
- * Text that provide more details and corrective actions related to the error. This can be shown
- * to a client user
- *
- * @return message
- **/
- @JsonProperty("message")
- @ApiModelProperty(
- value = "Text that provide more details and corrective actions related to the error. This can be shown to a client user")
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public ErrorRepresentation status(String status) {
- this.status = status;
- return this;
- }
-
- /**
- * http error code extension like 400-2
- *
- * @return status
- **/
- @JsonProperty("status")
- @ApiModelProperty(value = "http error code extension like 400-2")
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public ErrorRepresentation referenceError(String referenceError) {
- this.referenceError = referenceError;
- return this;
- }
-
- /**
- * url pointing to documentation describing the error
- *
- * @return referenceError
- **/
- @JsonProperty("referenceError")
- @ApiModelProperty(value = "url pointing to documentation describing the error")
- public String getReferenceError() {
- return referenceError;
- }
-
- public void setReferenceError(String referenceError) {
- this.referenceError = referenceError;
- }
-
- public ErrorRepresentation type(String type) {
- this.type = type;
- return this;
- }
-
- /**
- * The class type of a REST resource
- *
- * @return type
- **/
- @JsonProperty("@type")
- @ApiModelProperty(value = "The class type of a REST resource")
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public ErrorRepresentation schemaLocation(String schemaLocation) {
- this.schemaLocation = schemaLocation;
- return this;
- }
-
- /**
- * it provides a link to the schema describing a REST resource
- *
- * @return schemaLocation
- **/
- @JsonProperty("@schemaLocation")
- @ApiModelProperty(value = "it provides a link to the schema describing a REST resource")
- 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;
- }
- ErrorRepresentation errorRepresentation = (ErrorRepresentation) o;
- return Objects.equals(this.code, errorRepresentation.code)
- && Objects.equals(this.reason, errorRepresentation.reason)
- && Objects.equals(this.message, errorRepresentation.message)
- && Objects.equals(this.status, errorRepresentation.status)
- && Objects.equals(this.referenceError, errorRepresentation.referenceError)
- && Objects.equals(this.type, errorRepresentation.type)
- && Objects.equals(this.schemaLocation, errorRepresentation.schemaLocation);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(code, reason, message, status, referenceError, type, schemaLocation);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class ErrorRepresentation {\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(" 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 ");
- }
-}
-
+++ /dev/null
-/**
- * Copyright (c) 2018 Orange
- *
- * 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.
- */
-/*
- * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
- * open API16.5 + applied TMF guideline 3.0
- *
- * OpenAPI spec version: 0.1.1_inProgress
- *
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
- *
- * 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.
- */
-
-
-package org.onap.nbi.apis.serviceorder.model;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.Date;
-import java.util.Objects;
-
-/**
- * Extra-information about the order (e.g. useful to add extra delivery information that could be
- * useful for a human process
- */
-@ApiModel(
- description = "Extra-information about the order (e.g. useful to add extra delivery information that could be useful for a human process")
-@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
- date = "2018-02-19T14:00:30.767Z")
-public class Note {
- @JsonProperty("date")
- private Date date = null;
-
- @JsonProperty("author")
- private String author = null;
-
- @JsonProperty("text")
- private String text = null;
-
- public Note date(Date date) {
- this.date = date;
- return this;
- }
-
- /**
- * Date of the note
- *
- * @return date
- **/
- @JsonProperty("date")
- @ApiModelProperty(value = "Date of the note")
- @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
- public Date getDate() {
- return date;
- }
-
- public void setDate(Date date) {
- this.date = date;
- }
-
- public Note author(String author) {
- this.author = author;
- return this;
- }
-
- /**
- * Author of the note
- *
- * @return author
- **/
- @JsonProperty("author")
- @ApiModelProperty(value = "Author of the note")
- public String getAuthor() {
- return author;
- }
-
- public void setAuthor(String author) {
- this.author = author;
- }
-
- public Note text(String text) {
- this.text = text;
- return this;
- }
-
- /**
- * Text of the note
- *
- * @return text
- **/
- @JsonProperty("text")
- @ApiModelProperty(value = "Text of the note")
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
-
- @Override
- public boolean equals(java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Note note = (Note) o;
- return Objects.equals(this.date, note.date) && Objects.equals(this.author, note.author)
- && Objects.equals(this.text, note.text);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(date, author, text);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class Note {\n");
-
- sb.append(" date: ").append(toIndentedString(date)).append("\n");
- sb.append(" author: ").append(toIndentedString(author)).append("\n");
- sb.append(" text: ").append(toIndentedString(text)).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 ");
- }
-}
-
+++ /dev/null
-/**
- * Copyright (c) 2018 Orange
- *
- * 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.
- */
-/*
- * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
- * open API16.5 + applied TMF guideline 3.0
- *
- * OpenAPI spec version: 0.1.1_inProgress
- *
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
- *
- * 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.
- */
-
-
-package org.onap.nbi.apis.serviceorder.model;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import javax.validation.constraints.NotNull;
-import java.util.Objects;
-
-/**
- * Reference of an order item
- */
-@ApiModel(description = "Reference of an order item")
-@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
- date = "2018-02-19T14:00:30.767Z")
-public class OrderItemRef {
- @JsonProperty("id")
- private String id = null;
-
- @JsonProperty("href")
- private String href = null;
-
- public OrderItemRef id(String id) {
- this.id = id;
- return this;
- }
-
- /**
- * Unique identifier of the order irtem
- *
- * @return id
- **/
- @JsonProperty("id")
- @ApiModelProperty(required = true, value = "Unique identifier of the order irtem")
- @NotNull
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public OrderItemRef href(String href) {
- this.href = href;
- return this;
- }
-
- /**
- * Unique reference of the order item
- *
- * @return href
- **/
- @JsonProperty("href")
- @ApiModelProperty(value = "Unique reference of the order item")
- public String getHref() {
- return href;
- }
-
- public void setHref(String href) {
- this.href = href;
- }
-
-
- @Override
- public boolean equals(java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- OrderItemRef orderItemRef = (OrderItemRef) o;
- return Objects.equals(this.id, orderItemRef.id) && Objects.equals(this.href, orderItemRef.href);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, href);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class OrderItemRef {\n");
-
- sb.append(" id: ").append(toIndentedString(id)).append("\n");
- sb.append(" href: ").append(toIndentedString(href)).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 ");
- }
-}
-
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
import java.util.Objects;
+import javax.validation.constraints.Pattern;
/**
* Linked order item to the one containing this attribute
@JsonProperty("type")
@ApiModelProperty(required = true,
value = "The type of related order item, can be : dependancy if the order item needs to be “not started” until another order item is complete")
- @NotNull
+ @NotNull(message = "RelationshipType type cannot be null")
public RelationshipType getType() {
return type;
}
**/
@JsonProperty("id")
@ApiModelProperty(required = true, value = "Unique identifier of an order item")
- @NotNull
+ @NotNull(message = "RelationshipType id cannot be null")
+ @Pattern(regexp="^(?!\\s*$).+", message="RelationshipType id cannot be empty")
public String getId() {
return id;
}
**/
@JsonProperty("severity")
@ApiModelProperty(required = true,value = "Gravity of this message")
- @NotNull
+ @NotNull(message = "OrderMessage severity cannot be null")
public SeverityMessage getSeverity() {
return severity;
}
**/
@JsonProperty("correctionRequired")
@ApiModelProperty(required = true,value = "Indicator that an action is required to allow service order fullfilment to follow up")
- @NotNull
+ @NotNull(message = "OrderMessage correctionRequired cannot be null")
public boolean getCorrectionRequired() {
return correctionRequired;
}
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Objects;
+import javax.validation.constraints.Pattern;
/**
* Linked order to the one containing this attribute
**/
@JsonProperty("id")
@ApiModelProperty(required = true, value = "The id of the related order")
- @NotNull
+ @NotNull(message = "OrderRelationship id cannot be null")
+ @Pattern(regexp="^(?!\\s*$).+", message="OrderRelationship id cannot be empty")
public String getId() {
return id;
}
+++ /dev/null
-/**
- * Copyright (c) 2018 Orange
- *
- * 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.
- */
-/*
- * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
- * open API16.5 + applied TMF guideline 3.0
- *
- * OpenAPI spec version: 0.1.1_inProgress
- *
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
- *
- * 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.
- */
-
-
-package org.onap.nbi.apis.serviceorder.model;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import javax.validation.constraints.NotNull;
-import java.util.Objects;
-
-/**
- * Used to defined a place useful for the service (for example a delivery geographical place)
- */
-@ApiModel(description = "Used to defined a place useful for the service (for example a delivery geographical place)")
-@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
- date = "2018-02-19T14:00:30.767Z")
-public class Place {
- @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("@referredType")
- private String referredType = null;
-
- @JsonProperty("@schemaLocation")
- private String schemaLocation = null;
-
- public Place id(String id) {
- this.id = id;
- return this;
- }
-
- /**
- * @return id
- **/
- @JsonProperty("id")
- @ApiModelProperty(value = "")
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Place href(String href) {
- this.href = href;
- return this;
- }
-
- /**
- * Reference of a place (for instance in google map)
- *
- * @return href
- **/
- @JsonProperty("href")
- @ApiModelProperty(value = "Reference of a place (for instance in google map)")
- public String getHref() {
- return href;
- }
-
- public void setHref(String href) {
- this.href = href;
- }
-
- public Place name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * @return name
- **/
- @JsonProperty("name")
- @ApiModelProperty(value = "")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Place role(String role) {
- this.role = role;
- return this;
- }
-
- /**
- * The role of the place (e.g. delivery address, install site etc)
- *
- * @return role
- **/
- @JsonProperty("role")
- @ApiModelProperty(required = true, value = "The role of the place (e.g. delivery address, install site etc)")
- @NotNull
- public String getRole() {
- return role;
- }
-
- public void setRole(String role) {
- this.role = role;
- }
-
- public Place referredType(String referredType) {
- this.referredType = referredType;
- return this;
- }
-
- /**
- * @return referredType
- **/
- @JsonProperty("@referredType")
- @ApiModelProperty(value = "")
- public String getReferredType() {
- return referredType;
- }
-
- public void setReferredType(String referredType) {
- this.referredType = referredType;
- }
-
- public Place schemaLocation(String schemaLocation) {
- this.schemaLocation = schemaLocation;
- return this;
- }
-
- /**
- * @return schemaLocation
- **/
- @JsonProperty("@schemaLocation")
- @ApiModelProperty(value = "")
- 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;
- }
- Place place = (Place) o;
- return Objects.equals(this.id, place.id) && Objects.equals(this.href, place.href)
- && Objects.equals(this.name, place.name) && Objects.equals(this.role, place.role)
- && Objects.equals(this.referredType, place.referredType)
- && Objects.equals(this.schemaLocation, place.schemaLocation);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, href, name, role, referredType, schemaLocation);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class Place {\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(" role: ").append(toIndentedString(role)).append("\n");
- sb.append(" referredType: ").append(toIndentedString(referredType)).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 ");
- }
-}
-
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
import java.util.Objects;
+import javax.validation.constraints.Pattern;
/**
* A related party defines party which are involved in this order and the role they are playing
**/
@JsonProperty("id")
@ApiModelProperty(required = true, value = "Unique identifier of a related party")
- @NotNull
+ @NotNull(message = "RelatedParty Id cannot be null")
+ @Pattern(regexp="^(?!\\s*$).+", message="RelatedParty Id cannot be empty")
public String getId() {
return id;
}
**/
@JsonProperty("role")
@ApiModelProperty(required = true, value = "The role of the related party (e.g. Owner, requester, fullfiller etc)")
- @NotNull
+ @NotNull(message = "RelatedParty role cannot be null")
+ @Pattern(regexp="^(?!\\s*$).+", message="RelatedParty role cannot be empty")
public String getRole() {
return role;
}
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
* @return id
**/
@JsonProperty("id")
- @ApiModelProperty(required = true, value = "Identifier of a service instance")
+ @ApiModelProperty(value = "Identifier of a service instance")
public String getId() {
return id;
}
@JsonProperty("serviceCharacteristic")
@ApiModelProperty(
value = "A list of service characteristics .A name/value pair list used to store instance specific values of attributes. The behavior is equivalent to a MAP data structure where only one entry for any given value of \"name\" can exist")
+ @Valid
public List<ServiceCharacteristic> getServiceCharacteristic() {
return serviceCharacteristic;
}
@JsonProperty("serviceRelationship")
@ApiModelProperty(
value = "A list or service relationships (ServiceRelationship[*]). Linked Services to the one instantiate, it can be : “reliesOn” if the Service needs another already owned Service to rely on (e.g. an option on an already owned mobile access Service) or “targets” or “isTargeted” (depending on the way of expressing the link) for any other kind of links that may be useful")
+ @Valid
public List<ServiceRelationship> getServiceRelationship() {
return serviceRelationship;
}
@JsonProperty("relatedParty")
@ApiModelProperty(
value = "A list of related party parties linked at the Service level (it may be a User for example)")
+ @Valid
public List<RelatedParty> getRelatedParty() {
return relatedParty;
}
**/
@JsonProperty("serviceSpecification")
@ApiModelProperty(value = "")
- @NotNull
+ @NotNull(message = "ServiceSpecification cannot be null")
+ @Valid
public ServiceSpecificationRef getServiceSpecification() {
return serviceSpecification;
}
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Objects;
+import javax.validation.constraints.Pattern;
/**
* ServiceCharacteristic
**/
@JsonProperty("name")
@ApiModelProperty(required = true, value = "Name of characteristic")
- @NotNull
+ @NotNull(message = "ServiceCharacteristic name cannot be null")
+ @Pattern(regexp="^(?!\\s*$).+", message="ServiceCharacteristic name cannot be empty")
public String getName() {
return name;
}
**/
@JsonProperty("value")
@ApiModelProperty(value = "")
+ @Valid
public Value getValue() {
return value;
}
import java.util.Date;
import java.util.List;
import java.util.Objects;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;
import org.onap.nbi.apis.serviceorder.serviceordervalidator.ValidServiceOrder;
import org.onap.nbi.commons.Resource;
@JsonProperty("relatedParty")
@ApiModelProperty(
value = "A list of related parties which are involved in this order and the role they are playing.")
+ @Valid
public List<RelatedParty> getRelatedParty() {
return relatedParty;
}
**/
@JsonProperty("orderRelationship")
@ApiModelProperty(value = "A list of related order references .Linked order to the one containing this attribute")
+ @Valid
public List<OrderRelationship> getOrderRelationship() {
return orderRelationship;
}
@JsonProperty("orderItem")
@ApiModelProperty(value = "A list of order items that have to be processed.")
@NotEmpty
+ @Valid
public List<ServiceOrderItem> getOrderItem() {
return orderItem;
}
**/
@JsonProperty("orderMessage")
@ApiModelProperty(value = "")
+ @Valid
public List<OrderMessage> getOrderMessage() {
return orderMessage;
}
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
/**
* An identified part of the order. A service order is decomposed into one or more order items.
private StateType state = null;
@JsonProperty("percentProgress")
- private String percentProgress = null;
+ private String percentProgress = "0";
@JsonProperty("@type")
private String type = null;
* @return id
**/
@JsonProperty("id")
- @ApiModelProperty(required = true,
+ @ApiModelProperty(
value = "Identifier of the line item (generally it is a sequence number 01, 02, 03, …)")
- @NotNull
+ @NotNull(message = "order item id cannot be null")
+ @Pattern(regexp="^(?!\\s*$).+", message="order item id cannot be empty")
public String getId() {
return id;
}
**/
@JsonProperty("percentProgress")
@ApiModelProperty(required = false, value = "Progress of the delivery in percentage")
- @NotNull
+ @NotNull(message = "order item PercentProgress cannot be null")
public String getPercentProgress() {
return percentProgress;
}
**/
@JsonProperty("orderItemRelationship")
@ApiModelProperty(value = "Linked order item to the one containing this attribute")
+ @Valid
public List<OrderItemRelationship> getOrderItemRelationship() {
return orderItemRelationship;
}
**/
@JsonProperty("service")
@ApiModelProperty(required = true, value = "The Service to be acted on by the order item")
- @NotNull
+ @NotNull(message = "order item service cannot be null")
+ @Valid
public Service getService() {
return service;
}
**/
@JsonProperty("orderItemMessage")
@ApiModelProperty(value = "")
+ @Valid
public List<OrderMessage> getOrderItemMessage() {
return orderItemMessage;
}
+++ /dev/null
-/**
- * Copyright (c) 2018 Orange
- *
- * 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.
- */
-/*
- * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
- * open API16.5 + applied TMF guideline 3.0
- *
- * OpenAPI spec version: 0.1.1_inProgress
- *
- *
- * NOTE: This class is auto generated by the swagger code generator program.
- * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
- *
- * 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.
- */
-
-
-package org.onap.nbi.apis.serviceorder.model;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import javax.validation.constraints.NotNull;
-import java.util.Objects;
-
-/**
- * Service references
- */
-@ApiModel(description = "Service references")
-@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
- date = "2018-02-19T14:00:30.767Z")
-public class ServiceRef {
- @JsonProperty("id")
- private String id = null;
-
- @JsonProperty("href")
- private String href = null;
-
- public ServiceRef id(String id) {
- this.id = id;
- return this;
- }
-
- /**
- * Unique identifier of the service
- *
- * @return id
- **/
- @JsonProperty("id")
- @ApiModelProperty(required = true, value = "Unique identifier of the service")
- @NotNull
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public ServiceRef href(String href) {
- this.href = href;
- return this;
- }
-
- /**
- * Reference of the service
- *
- * @return href
- **/
- @JsonProperty("href")
- @ApiModelProperty(value = "Reference of the service")
- public String getHref() {
- return href;
- }
-
- public void setHref(String href) {
- this.href = href;
- }
-
-
- @Override
- public boolean equals(java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- ServiceRef serviceRef = (ServiceRef) o;
- return Objects.equals(this.id, serviceRef.id) && Objects.equals(this.href, serviceRef.href);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, href);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class ServiceRef {\n");
-
- sb.append(" id: ").append(toIndentedString(id)).append("\n");
- sb.append(" href: ").append(toIndentedString(href)).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 ");
- }
-}
-
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Objects;
@JsonProperty("type")
@ApiModelProperty(required = true,
value = "Relationship type. It can be : “reliesOn” if the Service needs another already owned Service to rely on (e.g. an option on an already owned mobile access Service) or “targets” or “isTargeted” (depending on the way of expressing the link) for any other kind of links that may be useful")
- @NotNull
+ @NotNull(message = "Relationship type cannot be null")
+ @Valid
public RelationshipType getType() {
return type;
}
**/
@JsonProperty("service")
@ApiModelProperty(required = true, value = "Service reference")
- @NotNull
+ @NotNull(message = "Relationship service cannot be null")
+ @Valid
public Service getService() {
return service;
}
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import javax.validation.constraints.NotNull;
import java.util.Objects;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
/**
* The service specification (default values, etc. are fetched from the catalogue).
**/
@JsonProperty("id")
@ApiModelProperty(required = true, value = "Unique identifier of the service specification")
- @NotNull
+ @NotNull(message = "ServiceSpecification id cannot be null")
+ @Pattern(regexp="^(?!\\s*$).+", message="ServiceSpecification id cannot be empty")
public String getId() {
return id;
}
**/
@JsonProperty("targetServiceSchema")
@ApiModelProperty(value = "")
+ @Valid
public TargetServiceSchema getTargetServiceSchema() {
return targetServiceSchema;
}
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
import java.util.Objects;
+import javax.validation.constraints.Pattern;
/**
*
**/
@JsonProperty("@type")
@ApiModelProperty(required = true, value = "")
- @NotNull
+ @NotNull(message = "TargetServiceSchema @type cannot be null")
+ @Pattern(regexp="^(?!\\s*$).+", message="TargetServiceSchema @type cannot be empty")
public String getType() {
return type;
}
**/
@JsonProperty("@schemaLocation")
@ApiModelProperty(required = true, value = "")
- @NotNull
+ @NotNull(message = "TargetServiceSchema @schemaLocation cannot be null")
+ @Pattern(regexp="^(?!\\s*$).+", message="TargetServiceSchema @schemaLocation cannot be empty")
public String getSchemaLocation() {
return schemaLocation;
}
orderMessage.setMessageInformation("Incorrect service.id provided – not found in Inventory (AAI)");
serviceOrderItem.addOrderItemMessageItem(orderMessage);
}
- if ("107".equalsIgnoreCase(code)) {
- orderMessage.setMessageInformation("tenantId not found in AAI");
- serviceOrderItem.addOrderItemMessageItem(orderMessage);
- }
serviceOrderRepository.save(serviceOrder);
}
} else if (!e2eService && !serviceOrderConsumerService.isTenantIdPresentInAAI(serviceOrder)) {
LOGGER.warn("serviceOrderItem {} for serviceOrder {} rejected cause tenantId not found in AAI",
serviceOrderItem.getId(), serviceOrderId);
- serviceOrderService.addOrderItemMessage(serviceOrder,serviceOrderItem, "107");
+ serviceOrderService.addOrderMessage(serviceOrder,"503");
return false;
}
import org.onap.nbi.apis.serviceorder.model.Service;
import org.onap.nbi.apis.serviceorder.model.ServiceOrder;
import org.onap.nbi.apis.serviceorder.model.ServiceOrderItem;
+import org.onap.nbi.apis.serviceorder.model.ServiceSpecificationRef;
import org.onap.nbi.apis.serviceorder.model.StateType;
import org.onap.nbi.apis.serviceorder.model.orchestrator.ExecutionTask;
import org.onap.nbi.apis.serviceorder.repositories.ExecutionTaskRepository;
violations = validator.validate(serviceOrder);
assertThat(violations).isNotEmpty();
+
+ ServiceOrder serviceOrder2 = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD);
+ serviceOrder2.getOrderItem().get(0).getService().getServiceSpecification().setId("");
+ serviceOrder2.getOrderItem().get(1).getService().getServiceSpecification().setId(" ");
+
+ violations = validator.validate(serviceOrder2);
+ assertThat(violations).isNotEmpty();
+ assertThat(violations.size()).isEqualTo(2);
+
}
import org.onap.nbi.apis.serviceorder.model.OrderItemRelationship;
import org.onap.nbi.apis.serviceorder.model.OrderRelationship;
import org.onap.nbi.apis.serviceorder.model.RelatedParty;
+import org.onap.nbi.apis.serviceorder.model.RelationshipType;
import org.onap.nbi.apis.serviceorder.model.ResourceSpecification;
import org.onap.nbi.apis.serviceorder.model.Service;
import org.onap.nbi.apis.serviceorder.model.ServiceCharacteristic;
List<OrderItemRelationship> orderItemRelationships = new ArrayList<>();
OrderItemRelationship orderItemRelationship = new OrderItemRelationship();
orderItemRelationship.setId("A");
+ orderItemRelationship.setType(RelationshipType.RELIESON);
orderItemRelationships.add(orderItemRelationship);
itemB.setOrderItemRelationship(orderItemRelationships);
items.add(itemB);