com.huaweicloud.sdk.cloudide.v2.model.ExtensionAuthorization Maven / Gradle / Ivy
package com.huaweicloud.sdk.cloudide.v2.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* ExtensionAuthorization
*/
public class ExtensionAuthorization {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "extension_version")
private String extensionVersion;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "identifier")
private String identifier;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "instance_id")
private String instanceId;
/**
* 插件状态。 - AGREE 同意 - REJECT 不同意 - UNKNOWN 未知(下次重新询问)
*/
public static final class StatusEnum {
/**
* Enum AGREE for value: "AGREE"
*/
public static final StatusEnum AGREE = new StatusEnum("AGREE");
/**
* Enum REJECT for value: "REJECT"
*/
public static final StatusEnum REJECT = new StatusEnum("REJECT");
/**
* Enum UNKNOWN for value: "UNKNOWN"
*/
public static final StatusEnum UNKNOWN = new StatusEnum("UNKNOWN");
private static final Map STATIC_FIELDS = createStaticFields();
private static Map createStaticFields() {
Map map = new HashMap<>();
map.put("AGREE", AGREE);
map.put("REJECT", REJECT);
map.put("UNKNOWN", UNKNOWN);
return Collections.unmodifiableMap(map);
}
private String value;
StatusEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StatusEnum fromValue(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value)).orElse(new StatusEnum(value));
}
public static StatusEnum valueOf(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value))
.orElseThrow(() -> new IllegalArgumentException("Unexpected value '" + value + "'"));
}
@Override
public boolean equals(Object obj) {
if (obj instanceof StatusEnum) {
return this.value.equals(((StatusEnum) obj).value);
}
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "status")
private StatusEnum status;
public ExtensionAuthorization withExtensionVersion(String extensionVersion) {
this.extensionVersion = extensionVersion;
return this;
}
/**
* 插件版本
* @return extensionVersion
*/
public String getExtensionVersion() {
return extensionVersion;
}
public void setExtensionVersion(String extensionVersion) {
this.extensionVersion = extensionVersion;
}
public ExtensionAuthorization withIdentifier(String identifier) {
this.identifier = identifier;
return this;
}
/**
* 插件标识(发布者.插件名)
* @return identifier
*/
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public ExtensionAuthorization withInstanceId(String instanceId) {
this.instanceId = instanceId;
return this;
}
/**
* CodeArtsIDEOnline实例ID
* @return instanceId
*/
public String getInstanceId() {
return instanceId;
}
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
public ExtensionAuthorization withStatus(StatusEnum status) {
this.status = status;
return this;
}
/**
* 插件状态。 - AGREE 同意 - REJECT 不同意 - UNKNOWN 未知(下次重新询问)
* @return status
*/
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
ExtensionAuthorization that = (ExtensionAuthorization) obj;
return Objects.equals(this.extensionVersion, that.extensionVersion)
&& Objects.equals(this.identifier, that.identifier) && Objects.equals(this.instanceId, that.instanceId)
&& Objects.equals(this.status, that.status);
}
@Override
public int hashCode() {
return Objects.hash(extensionVersion, identifier, instanceId, status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ExtensionAuthorization {\n");
sb.append(" extensionVersion: ").append(toIndentedString(extensionVersion)).append("\n");
sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n");
sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).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 ");
}
}