com.mypurecloud.sdk.v2.model.CopilotAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-client-v2 Show documentation
Show all versions of platform-client-v2 Show documentation
A Java package to interface with the PureCloud Platform API
The newest version!
package com.mypurecloud.sdk.v2.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.util.Objects;
import java.util.ArrayList;
import java.io.IOException;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.Serializable;
/**
* CopilotAction
*/
public class CopilotAction implements Serializable {
private static class ActionTypeEnumDeserializer extends StdDeserializer {
public ActionTypeEnumDeserializer() {
super(ActionTypeEnumDeserializer.class);
}
@Override
public ActionTypeEnum deserialize(JsonParser jsonParser, DeserializationContext ctxt)
throws IOException {
JsonNode node = jsonParser.getCodec().readTree(jsonParser);
return ActionTypeEnum.fromString(node.toString().replace("\"", ""));
}
}
/**
* Type of action.
*/
@JsonDeserialize(using = ActionTypeEnumDeserializer.class)
public enum ActionTypeEnum {
OUTDATEDSDKVERSION("OutdatedSdkVersion"),
KNOWLEDGEARTICLE("KnowledgeArticle"),
CANNEDRESPONSE("CannedResponse"),
SCRIPT("Script");
private String value;
ActionTypeEnum(String value) {
this.value = value;
}
@JsonCreator
public static ActionTypeEnum fromString(String key) {
if (key == null) return null;
for (ActionTypeEnum value : ActionTypeEnum.values()) {
if (key.equalsIgnoreCase(value.toString())) {
return value;
}
}
return ActionTypeEnum.values()[0];
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
}
private ActionTypeEnum actionType = null;
private Map attributes = null;
/**
* Type of action.
**/
public CopilotAction actionType(ActionTypeEnum actionType) {
this.actionType = actionType;
return this;
}
@ApiModelProperty(example = "null", required = true, value = "Type of action.")
@JsonProperty("actionType")
public ActionTypeEnum getActionType() {
return actionType;
}
public void setActionType(ActionTypeEnum actionType) {
this.actionType = actionType;
}
/**
* Action specific attributes, if any. Maximum 100 of string key-value pair allowed.
**/
public CopilotAction attributes(Map attributes) {
this.attributes = attributes;
return this;
}
@ApiModelProperty(example = "null", value = "Action specific attributes, if any. Maximum 100 of string key-value pair allowed.")
@JsonProperty("attributes")
public Map getAttributes() {
return attributes;
}
public void setAttributes(Map attributes) {
this.attributes = attributes;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CopilotAction copilotAction = (CopilotAction) o;
return Objects.equals(this.actionType, copilotAction.actionType) &&
Objects.equals(this.attributes, copilotAction.attributes);
}
@Override
public int hashCode() {
return Objects.hash(actionType, attributes);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CopilotAction {\n");
sb.append(" actionType: ").append(toIndentedString(actionType)).append("\n");
sb.append(" attributes: ").append(toIndentedString(attributes)).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 ");
}
}