Merge "NCMP: Update existing Batch endpoint (Moving url param into rest body)"
[cps.git] / cps-ncmp-service / src / main / java / org / onap / cps / ncmp / api / impl / operations / DmiRequestBody.java
index c84e4cb..6613d3c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2021-2022 Nordix Foundation
+ *  Copyright (C) 2021-2023 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ package org.onap.cps.ncmp.api.impl.operations;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -33,27 +33,11 @@ import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle;
 @JsonInclude(JsonInclude.Include.NON_NULL)
 @Getter
 @Builder
+@JsonPropertyOrder({"operation", "dataType", "data", "cmHandleProperties", "requestId"})
 public class DmiRequestBody {
-    public enum OperationEnum {
-        READ("read"),
-        CREATE("create"),
-        UPDATE("update"),
-        PATCH("patch"),
-        DELETE("delete");
-        private final String value;
 
-        OperationEnum(final String value) {
-            this.value = value;
-        }
-
-        @Override
-        @JsonValue
-        public String toString() {
-            return String.valueOf(value);
-        }
-    }
-
-    private OperationEnum operation;
+    @JsonProperty("operation")
+    private OperationType operationType;
     private String dataType;
     private String data;
     @JsonProperty("cmHandleProperties")