/*
 * Copyright (c) 2025 SimcuTeam. All rights reserved.
 * 遵循 MIT 许可证。
 * AuthSDK 用到的 DTO。
 *
 * 说明：原版中这些 DTO 是 SimApiAuthCenterDto / SimApiAuthIamDto 的嵌套类；
 * 仓颉不支持在类体内声明嵌套类（unexpected class declaration in class body），
 * 故拍平为顶层类，语义与字段保持一致。
 *
 * 序列化/反序列化由 simapi_serialization 反射处理（免标注、免约束）。
 */

package simcu::simapi.authsdk

import std.collection.*

/**
 * 应用/Profile 通用项。
 */
public class AppAndProfileItem {
    public var id: String = ""
    public var name: String = ""
    public var image: ?String = None
    public var description: ?String = None
}

/**
 * 安全确认响应。
 * data 用 ?HashMap<String, Any> 表示任意 JSON 对象。
 */
public class ConfirmResponse {
    public var applicationId: String = ""
    public var profileId: String = ""
    public var scene: ?String = None
    public var data: ?HashMap<String, Any> = None
}

/**
 * 登录信息响应。
 */
public class LoginInfoResponse {
    public var scene: ?String = None
    public var data: ?HashMap<String, Any> = None
    public var profileId: String = ""
    public var name: String = ""
    public var image: ?String = None
    public var description: ?String = None
}

/**
 * 获取授权码响应。
 */
public class GetCodeResponse {
    public var code: String = ""
    public var server: String = ""
    public var fullUrl: String = ""

    public init() {}

    public init(code: String, server: String, fullUrl: String) {
        this.code = code
        this.server = server
        this.fullUrl = fullUrl
    }
}

/**
 * 群组关联项。
 */
public class GroupRelatedItem {
    public var id: String = ""
    public var name: String = ""
    public var image: ?String = None
    public var description: ?String = None
    public var isOwner: Bool = false
    public var isAdmin: Bool = false
    public var isMember: Bool = false
}

/**
 * 群组详情树节点。
 */
public class GroupDetailTreeNode {
    public var id: String = ""
    public var name: String = ""
    public var image: ?String = None
    public var description: ?String = None
    public var sort: Int64 = 0
    public var children: Array<GroupDetailTreeNode> = []
}

/**
 * 权限项。
 */
public class PermissionItem {
    public var identifier: String = ""
    public var name: String = ""
    public var group: String = ""
    public var description: String = ""

    public init() {}

    public init(identifier: String, name: String, group: String, description: String) {
        this.identifier = identifier
        this.name = name
        this.group = group
        this.description = description
    }
}
