oh-my-muse/docs/api-contracts/generated/java/com/muse/dto/IntegrationCallDetail.java

396 lines
11 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.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
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;
/**
* 外部调用详情
*/
@Schema(name = "IntegrationCallDetail", description = "外部调用详情")
@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 IntegrationCallDetail implements Serializable {
private static final long serialVersionUID = 1L;
private String correlationId;
/**
* 调用状态
*/
public enum StatusEnum {
SUCCESS("success"),
FAILED("failed"),
RETRYING("retrying"),
DEDUPLICATED("deduplicated"),
ATTRIBUTED("attributed"),
PENDING_ATTRIBUTION("pending_attribution");
private final 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) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private StatusEnum status;
private @Nullable String requestType;
@Valid
private List<String> retryGroup = new ArrayList<>();
/**
* 归属状态
*/
public enum AttributionStatusEnum {
ATTRIBUTED("attributed"),
PENDING("pending"),
FAILED("failed");
private final String value;
AttributionStatusEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static AttributionStatusEnum fromValue(String value) {
for (AttributionStatusEnum b : AttributionStatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Nullable AttributionStatusEnum attributionStatus;
private @Nullable String attributedUserId;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime createdAt;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private @Nullable OffsetDateTime lastRetryAt;
private @Nullable String errorMessage;
public IntegrationCallDetail() {
super();
}
/**
* Constructor with only required parameters
*/
public IntegrationCallDetail(String correlationId, StatusEnum status, OffsetDateTime createdAt) {
this.correlationId = correlationId;
this.status = status;
this.createdAt = createdAt;
}
public IntegrationCallDetail correlationId(String correlationId) {
this.correlationId = correlationId;
return this;
}
/**
* 外部调用关联 ID
* @return correlationId
*/
@NotNull
@Schema(name = "correlationId", description = "外部调用关联 ID", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("correlationId")
public String getCorrelationId() {
return correlationId;
}
@JsonProperty("correlationId")
public void setCorrelationId(String correlationId) {
this.correlationId = correlationId;
}
public IntegrationCallDetail status(StatusEnum status) {
this.status = status;
return this;
}
/**
* 调用状态
* @return status
*/
@NotNull
@Schema(name = "status", description = "调用状态", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
}
@JsonProperty("status")
public void setStatus(StatusEnum status) {
this.status = status;
}
public IntegrationCallDetail requestType(@Nullable String requestType) {
this.requestType = requestType;
return this;
}
/**
* 请求类型(额度配置/余额查询等)
* @return requestType
*/
@Schema(name = "requestType", description = "请求类型(额度配置/余额查询等)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("requestType")
public @Nullable String getRequestType() {
return requestType;
}
@JsonProperty("requestType")
public void setRequestType(@Nullable String requestType) {
this.requestType = requestType;
}
public IntegrationCallDetail retryGroup(List<String> retryGroup) {
this.retryGroup = retryGroup;
return this;
}
public IntegrationCallDetail addRetryGroupItem(String retryGroupItem) {
if (this.retryGroup == null) {
this.retryGroup = new ArrayList<>();
}
this.retryGroup.add(retryGroupItem);
return this;
}
/**
* 重试组内的调用 ID 列表
* @return retryGroup
*/
@Schema(name = "retryGroup", description = "重试组内的调用 ID 列表", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("retryGroup")
public List<String> getRetryGroup() {
return retryGroup;
}
@JsonProperty("retryGroup")
public void setRetryGroup(List<String> retryGroup) {
this.retryGroup = retryGroup;
}
public IntegrationCallDetail attributionStatus(@Nullable AttributionStatusEnum attributionStatus) {
this.attributionStatus = attributionStatus;
return this;
}
/**
* 归属状态
* @return attributionStatus
*/
@Schema(name = "attributionStatus", description = "归属状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("attributionStatus")
public @Nullable AttributionStatusEnum getAttributionStatus() {
return attributionStatus;
}
@JsonProperty("attributionStatus")
public void setAttributionStatus(@Nullable AttributionStatusEnum attributionStatus) {
this.attributionStatus = attributionStatus;
}
public IntegrationCallDetail attributedUserId(@Nullable String attributedUserId) {
this.attributedUserId = attributedUserId;
return this;
}
/**
* 归属用户 ID
* @return attributedUserId
*/
@Schema(name = "attributedUserId", description = "归属用户 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("attributedUserId")
public @Nullable String getAttributedUserId() {
return attributedUserId;
}
@JsonProperty("attributedUserId")
public void setAttributedUserId(@Nullable String attributedUserId) {
this.attributedUserId = attributedUserId;
}
public IntegrationCallDetail createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* 首次调用时间
* @return createdAt
*/
@NotNull @Valid
@Schema(name = "createdAt", description = "首次调用时间", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("createdAt")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
@JsonProperty("createdAt")
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public IntegrationCallDetail lastRetryAt(@Nullable OffsetDateTime lastRetryAt) {
this.lastRetryAt = lastRetryAt;
return this;
}
/**
* 最近重试时间
* @return lastRetryAt
*/
@Valid
@Schema(name = "lastRetryAt", description = "最近重试时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("lastRetryAt")
public @Nullable OffsetDateTime getLastRetryAt() {
return lastRetryAt;
}
@JsonProperty("lastRetryAt")
public void setLastRetryAt(@Nullable OffsetDateTime lastRetryAt) {
this.lastRetryAt = lastRetryAt;
}
public IntegrationCallDetail errorMessage(@Nullable String errorMessage) {
this.errorMessage = errorMessage;
return this;
}
/**
* 错误信息(仅失败时返回)
* @return errorMessage
*/
@Schema(name = "errorMessage", description = "错误信息(仅失败时返回)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("errorMessage")
public @Nullable String getErrorMessage() {
return errorMessage;
}
@JsonProperty("errorMessage")
public void setErrorMessage(@Nullable String errorMessage) {
this.errorMessage = errorMessage;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
IntegrationCallDetail integrationCallDetail = (IntegrationCallDetail) o;
return Objects.equals(this.correlationId, integrationCallDetail.correlationId) &&
Objects.equals(this.status, integrationCallDetail.status) &&
Objects.equals(this.requestType, integrationCallDetail.requestType) &&
Objects.equals(this.retryGroup, integrationCallDetail.retryGroup) &&
Objects.equals(this.attributionStatus, integrationCallDetail.attributionStatus) &&
Objects.equals(this.attributedUserId, integrationCallDetail.attributedUserId) &&
Objects.equals(this.createdAt, integrationCallDetail.createdAt) &&
Objects.equals(this.lastRetryAt, integrationCallDetail.lastRetryAt) &&
Objects.equals(this.errorMessage, integrationCallDetail.errorMessage);
}
@Override
public int hashCode() {
return Objects.hash(correlationId, status, requestType, retryGroup, attributionStatus, attributedUserId, createdAt, lastRetryAt, errorMessage);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class IntegrationCallDetail {\n");
sb.append(" correlationId: ").append(toIndentedString(correlationId)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n");
sb.append(" retryGroup: ").append(toIndentedString(retryGroup)).append("\n");
sb.append(" attributionStatus: ").append(toIndentedString(attributionStatus)).append("\n");
sb.append(" attributedUserId: ").append(toIndentedString(attributedUserId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" lastRetryAt: ").append(toIndentedString(lastRetryAt)).append("\n");
sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).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 ");
}
}