package com.usoftchina.qywx.sdk.config;

/**
 * @author yingp
 */
public class Agent {
    /**
     * 编号，统一友好命名。代码里面直接使用
     */
    private final String code;
    /**
     * agentId
     */
    private final Integer id;
    /**
     * 私钥
     */
    private final String secret;
    /**
     * 用于通讯录应用，通讯录应用的secret具有全部api权限，使用自建应用的secret只能调用通讯录读api
     */
    private boolean readonly;

    public Agent(String code, Integer id, String secret) {
        this(code, id, secret, false);
    }

    public Agent(String code, Integer id, String secret, boolean readonly) {
        this.code = code;
        this.id = id;
        this.secret = secret;
        this.readonly = readonly;
    }

    public String getCode() {
        return code;
    }

    public Integer getId() {
        return id;
    }

    public String getSecret() {
        return secret;
    }

    public boolean isReadonly() {
        return readonly;
    }

    public void setReadonly(boolean readonly) {
        this.readonly = readonly;
    }
}
