+ void parsePayload(ServiceInstancesRequest sir, Action action) throws ValidationException{
+ msoLogger.debug("Validating for requestParameters and payload");
+ this.sir = sir;
+ this.action = action;
+ this.requestScope = ModelType.vnf.name();
+ RequestParameters requestParameters = sir.getRequestDetails().getRequestParameters();
+ this.cloudConfiguration = sir.getRequestDetails ().getCloudConfiguration();
+ this.requestInfo = sir.getRequestDetails().getRequestInfo();
+
+ if(action == Action.inPlaceSoftwareUpdate){
+ if (cloudConfiguration == null) {
+ throw new ValidationException ("cloudConfiguration");
+ }else if (empty (cloudConfiguration.getLcpCloudRegionId ())) {
+ throw new ValidationException ("lcpCloudRegionId");
+ }else if (empty (cloudConfiguration.getTenantId ())) {
+ throw new ValidationException ("tenantId");
+ }
+ }
+ if(requestInfo == null){
+ throw new ValidationException("requestInfo");
+ }else if(empty(requestInfo.getRequestorId())) {
+ throw new ValidationException ("requestorId");
+ }else if (empty (requestInfo.getSource ())) {
+ throw new ValidationException ("source");
+ }
+ if(requestParameters == null){
+ throw new ValidationException("requestParameters");
+ }
+ }
+ void parsePlatformAndLineOfBusiness(ServiceInstancesRequest sir) throws ValidationException {
+ msoLogger.debug("Validating Platform and LineOfBusiness Objects");
+ this.sir = sir;
+ platform = sir.getRequestDetails().getPlatform();
+ lineOfBusiness = sir.getRequestDetails().getLineOfBusiness();
+
+ if(this.reqVersion > 5 && platform == null) {
+ throw new ValidationException("platform");
+ }
+
+ if(platform != null && empty(platform.getPlatformName())){
+ throw new ValidationException("platformName");
+ }
+
+ if(lineOfBusiness != null && empty(lineOfBusiness.getLineOfBusinessName())){
+ throw new ValidationException("lineOfBusinessName");
+ }
+ }
+
+ void parseProjectAndOwningEntity(ServiceInstancesRequest sir) throws ValidationException {
+ msoLogger.debug("Validating Project and OwningEntity Objects");
+ this.sir = sir;
+ this.project = sir.getRequestDetails().getProject();
+ this.owningEntity = sir.getRequestDetails().getOwningEntity();
+
+ if(this.reqVersion > 5 && owningEntity == null) {
+ throw new ValidationException("owningEntity");
+ }
+
+ if(owningEntity != null && empty(owningEntity.getOwningEntityId())){
+ throw new ValidationException("owningEntityId");
+ }
+
+ if(project != null && empty(project.getProjectName())){
+ throw new ValidationException("projectName");
+ }
+ }
+