package com.sino.mci.policy.engine;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Policy {

    private PolicyType type;

    // rate_limit
    @JsonProperty("scope")
    private String scope;

    @JsonProperty("limit")
    private Integer limit;

    @JsonProperty("window")
    private String window;

    // time_window
    @JsonProperty("allow")
    private List<String> allow;

    // blacklist
    @JsonProperty("person_ids")
    private List<Long> personIds;

    @JsonProperty("conversation_ids")
    private List<Long> conversationIds;

    // retry
    @JsonProperty("max_retry")
    private Integer maxRetry;

    @JsonProperty("interval")
    private List<Integer> intervals;
}
