Improve Java (hence feign) API of the REST API (#1684)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -12,49 +12,31 @@ package org.eclipse.hawkbit.mgmt.json.model;
|
|||||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A generic abstract rest model which contains only a ID for use-case e.g.
|
* A generic abstract rest model which contains only a ID for use-case e.g.
|
||||||
* which allows only posting or putting an ID into the request body, e.g. for
|
* which allows only posting or putting an ID into the request body, e.g. for
|
||||||
* assignments.
|
* assignments.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ToString
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class MgmtId {
|
public class MgmtId {
|
||||||
|
|
||||||
@Schema(example = "108")
|
@Schema(example = "108")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*/
|
|
||||||
public MgmtId() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* @param id ID of object
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* ID of object
|
|
||||||
*/
|
*/
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public MgmtId(final Long id) {
|
public MgmtId(final Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the ID
|
|
||||||
*/
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id
|
|
||||||
* the ID to set
|
|
||||||
*/
|
|
||||||
public void setId(final Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -14,7 +14,6 @@ import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Request Body of DistributionSetType for assignment operations (ID only).
|
* Request Body of DistributionSetType for assignment operations (ID only).
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class MgmtDistributionSetTypeAssignment extends MgmtId {
|
public class MgmtDistributionSetTypeAssignment extends MgmtId {
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Request Body of SoftwareModule for assignment operations (ID only).
|
* Request Body of SoftwareModule for assignment operations (ID only).
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class MgmtSoftwareModuleAssigment extends MgmtId {
|
public class MgmtSoftwareModuleAssigment extends MgmtId {
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Request Body of SoftwareModuleType for assignment operations (ID only).
|
* Request Body of SoftwareModuleType for assignment operations (ID only).
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class MgmtSoftwareModuleTypeAssigment extends MgmtId {
|
public class MgmtSoftwareModuleTypeAssigment extends MgmtId {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
|
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.MgmtMaintenanceWindowRequestBody;
|
import org.eclipse.hawkbit.mgmt.json.model.MgmtMaintenanceWindowRequestBody;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
|
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
|
||||||
@@ -18,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
* Request Body of DistributionSet for assignment operations (ID only).
|
* Request Body of DistributionSet for assignment operations (ID only).
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class MgmtDistributionSetAssignment extends MgmtId {
|
public class MgmtDistributionSetAssignment extends MgmtId {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ package org.eclipse.hawkbit.mgmt.json.model.targetfilter;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
|
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
|
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
|
||||||
|
|
||||||
@@ -22,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
* assignment operation.
|
* assignment operation.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class MgmtDistributionSetAutoAssignment extends MgmtId {
|
public class MgmtDistributionSetAutoAssignment extends MgmtId {
|
||||||
|
|||||||
@@ -12,11 +12,15 @@ package org.eclipse.hawkbit.mgmt.json.model.targetfilter;
|
|||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request body for target PUT/POST commands.
|
* Request body for target PUT/POST commands.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ToString
|
||||||
public class MgmtTargetFilterQueryRequestBody {
|
public class MgmtTargetFilterQueryRequestBody {
|
||||||
|
|
||||||
@JsonProperty(required = true)
|
@JsonProperty(required = true)
|
||||||
|
|||||||
Reference in New Issue
Block a user