339 lines
9.0 KiB
Java
339 lines
9.0 KiB
Java
package com.muse.dto;
|
|
|
|
import java.net.URI;
|
|
import java.util.Objects;
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
import com.fasterxml.jackson.annotation.JsonValue;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import org.springframework.lang.Nullable;
|
|
import java.io.Serializable;
|
|
import java.time.OffsetDateTime;
|
|
import jakarta.validation.Valid;
|
|
import jakarta.validation.constraints.*;
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
|
|
|
import java.util.*;
|
|
import jakarta.annotation.Generated;
|
|
|
|
/**
|
|
* 当前治理策略下的动作限制,不等同于 listingStatus、licenseStatus、installStatus 或 bindStatus。
|
|
*/
|
|
|
|
@Schema(name = "AssetActionPolicy", description = "当前治理策略下的动作限制,不等同于 listingStatus、licenseStatus、installStatus 或 bindStatus。")
|
|
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T16:47:40.290595+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0")
|
|
public class AssetActionPolicy implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
/**
|
|
* Gets or Sets acquirePolicy
|
|
*/
|
|
public enum AcquirePolicyEnum {
|
|
ALLOWED("allowed"),
|
|
|
|
STOP_NEW_ACQUIRE("stop_new_acquire");
|
|
|
|
private final String value;
|
|
|
|
AcquirePolicyEnum(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
@JsonValue
|
|
public String getValue() {
|
|
return value;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.valueOf(value);
|
|
}
|
|
|
|
@JsonCreator
|
|
public static AcquirePolicyEnum fromValue(String value) {
|
|
for (AcquirePolicyEnum b : AcquirePolicyEnum.values()) {
|
|
if (b.value.equals(value)) {
|
|
return b;
|
|
}
|
|
}
|
|
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
|
}
|
|
}
|
|
|
|
private @Nullable AcquirePolicyEnum acquirePolicy;
|
|
|
|
/**
|
|
* Gets or Sets installPolicy
|
|
*/
|
|
public enum InstallPolicyEnum {
|
|
ALLOWED("allowed"),
|
|
|
|
STOP_NEW_INSTALL("stop_new_install");
|
|
|
|
private final String value;
|
|
|
|
InstallPolicyEnum(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
@JsonValue
|
|
public String getValue() {
|
|
return value;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.valueOf(value);
|
|
}
|
|
|
|
@JsonCreator
|
|
public static InstallPolicyEnum fromValue(String value) {
|
|
for (InstallPolicyEnum b : InstallPolicyEnum.values()) {
|
|
if (b.value.equals(value)) {
|
|
return b;
|
|
}
|
|
}
|
|
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
|
}
|
|
}
|
|
|
|
private @Nullable InstallPolicyEnum installPolicy;
|
|
|
|
/**
|
|
* Gets or Sets bindPolicy
|
|
*/
|
|
public enum BindPolicyEnum {
|
|
ALLOWED("allowed"),
|
|
|
|
STOP_NEW_BIND("stop_new_bind");
|
|
|
|
private final String value;
|
|
|
|
BindPolicyEnum(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
@JsonValue
|
|
public String getValue() {
|
|
return value;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.valueOf(value);
|
|
}
|
|
|
|
@JsonCreator
|
|
public static BindPolicyEnum fromValue(String value) {
|
|
for (BindPolicyEnum b : BindPolicyEnum.values()) {
|
|
if (b.value.equals(value)) {
|
|
return b;
|
|
}
|
|
}
|
|
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
|
}
|
|
}
|
|
|
|
private @Nullable BindPolicyEnum bindPolicy;
|
|
|
|
/**
|
|
* Gets or Sets generationPolicy
|
|
*/
|
|
public enum GenerationPolicyEnum {
|
|
ALLOWED("allowed"),
|
|
|
|
STOP_GENERATION("stop_generation");
|
|
|
|
private final String value;
|
|
|
|
GenerationPolicyEnum(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
@JsonValue
|
|
public String getValue() {
|
|
return value;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.valueOf(value);
|
|
}
|
|
|
|
@JsonCreator
|
|
public static GenerationPolicyEnum fromValue(String value) {
|
|
for (GenerationPolicyEnum b : GenerationPolicyEnum.values()) {
|
|
if (b.value.equals(value)) {
|
|
return b;
|
|
}
|
|
}
|
|
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
|
}
|
|
}
|
|
|
|
private @Nullable GenerationPolicyEnum generationPolicy;
|
|
|
|
@Valid
|
|
private List<String> recheckReasons = new ArrayList<>();
|
|
|
|
public AssetActionPolicy acquirePolicy(@Nullable AcquirePolicyEnum acquirePolicy) {
|
|
this.acquirePolicy = acquirePolicy;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get acquirePolicy
|
|
* @return acquirePolicy
|
|
*/
|
|
|
|
@Schema(name = "acquirePolicy", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("acquirePolicy")
|
|
public @Nullable AcquirePolicyEnum getAcquirePolicy() {
|
|
return acquirePolicy;
|
|
}
|
|
|
|
@JsonProperty("acquirePolicy")
|
|
public void setAcquirePolicy(@Nullable AcquirePolicyEnum acquirePolicy) {
|
|
this.acquirePolicy = acquirePolicy;
|
|
}
|
|
|
|
public AssetActionPolicy installPolicy(@Nullable InstallPolicyEnum installPolicy) {
|
|
this.installPolicy = installPolicy;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get installPolicy
|
|
* @return installPolicy
|
|
*/
|
|
|
|
@Schema(name = "installPolicy", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("installPolicy")
|
|
public @Nullable InstallPolicyEnum getInstallPolicy() {
|
|
return installPolicy;
|
|
}
|
|
|
|
@JsonProperty("installPolicy")
|
|
public void setInstallPolicy(@Nullable InstallPolicyEnum installPolicy) {
|
|
this.installPolicy = installPolicy;
|
|
}
|
|
|
|
public AssetActionPolicy bindPolicy(@Nullable BindPolicyEnum bindPolicy) {
|
|
this.bindPolicy = bindPolicy;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get bindPolicy
|
|
* @return bindPolicy
|
|
*/
|
|
|
|
@Schema(name = "bindPolicy", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("bindPolicy")
|
|
public @Nullable BindPolicyEnum getBindPolicy() {
|
|
return bindPolicy;
|
|
}
|
|
|
|
@JsonProperty("bindPolicy")
|
|
public void setBindPolicy(@Nullable BindPolicyEnum bindPolicy) {
|
|
this.bindPolicy = bindPolicy;
|
|
}
|
|
|
|
public AssetActionPolicy generationPolicy(@Nullable GenerationPolicyEnum generationPolicy) {
|
|
this.generationPolicy = generationPolicy;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get generationPolicy
|
|
* @return generationPolicy
|
|
*/
|
|
|
|
@Schema(name = "generationPolicy", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("generationPolicy")
|
|
public @Nullable GenerationPolicyEnum getGenerationPolicy() {
|
|
return generationPolicy;
|
|
}
|
|
|
|
@JsonProperty("generationPolicy")
|
|
public void setGenerationPolicy(@Nullable GenerationPolicyEnum generationPolicy) {
|
|
this.generationPolicy = generationPolicy;
|
|
}
|
|
|
|
public AssetActionPolicy recheckReasons(List<String> recheckReasons) {
|
|
this.recheckReasons = recheckReasons;
|
|
return this;
|
|
}
|
|
|
|
public AssetActionPolicy addRecheckReasonsItem(String recheckReasonsItem) {
|
|
if (this.recheckReasons == null) {
|
|
this.recheckReasons = new ArrayList<>();
|
|
}
|
|
this.recheckReasons.add(recheckReasonsItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 需要目标 owner 重验的原因列表,例如 source_version_changed / authorization_snapshot_expired。
|
|
* @return recheckReasons
|
|
*/
|
|
|
|
@Schema(name = "recheckReasons", description = "需要目标 owner 重验的原因列表,例如 source_version_changed / authorization_snapshot_expired。", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("recheckReasons")
|
|
public List<String> getRecheckReasons() {
|
|
return recheckReasons;
|
|
}
|
|
|
|
@JsonProperty("recheckReasons")
|
|
public void setRecheckReasons(List<String> recheckReasons) {
|
|
this.recheckReasons = recheckReasons;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
AssetActionPolicy assetActionPolicy = (AssetActionPolicy) o;
|
|
return Objects.equals(this.acquirePolicy, assetActionPolicy.acquirePolicy) &&
|
|
Objects.equals(this.installPolicy, assetActionPolicy.installPolicy) &&
|
|
Objects.equals(this.bindPolicy, assetActionPolicy.bindPolicy) &&
|
|
Objects.equals(this.generationPolicy, assetActionPolicy.generationPolicy) &&
|
|
Objects.equals(this.recheckReasons, assetActionPolicy.recheckReasons);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(acquirePolicy, installPolicy, bindPolicy, generationPolicy, recheckReasons);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class AssetActionPolicy {\n");
|
|
sb.append(" acquirePolicy: ").append(toIndentedString(acquirePolicy)).append("\n");
|
|
sb.append(" installPolicy: ").append(toIndentedString(installPolicy)).append("\n");
|
|
sb.append(" bindPolicy: ").append(toIndentedString(bindPolicy)).append("\n");
|
|
sb.append(" generationPolicy: ").append(toIndentedString(generationPolicy)).append("\n");
|
|
sb.append(" recheckReasons: ").append(toIndentedString(recheckReasons)).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(@Nullable Object o) {
|
|
return o == null ? "null" : o.toString().replace("\n", "\n ");
|
|
}
|
|
}
|
|
|