package com.jihe.punchnet.api

import com.google.gson.annotations.SerializedName

data class AuthTokenRequest(
    @SerializedName("client_id") val clientId: String,
    @SerializedName("token") val token: String,
    @SerializedName("mac") val mac: String? = null,
    @SerializedName("system") val system: String? = null,
    @SerializedName("version") val version: String? = null,
    @SerializedName("hostname") val hostname: String? = null
)

data class NetworkItem(
    @SerializedName("network_id") val networkId: Int,
    @SerializedName("network_name") val networkName: String
)

data class AuthResponseData(
    @SerializedName("access_token") val accessToken: String,
    @SerializedName("username") val username: String,
    @SerializedName("user_type") val userType: String,
    @SerializedName("audit") val audit: Int,
    @SerializedName("network_id") val networkId: Int,
    @SerializedName("network_name") val networkName: String,
    @SerializedName("network_domain") val networkDomain: String,
    @SerializedName("domain") val domain: String?,
    @SerializedName("my_network_list") val myNetworkList: List<NetworkItem>?
)

data class BaseResponse<T>(
    @SerializedName("code") val code: Int,
    @SerializedName("message") val message: String,
    @SerializedName("data") val data: T?
)

data class ConnectRequest(
    @SerializedName("client_id") val clientId: String,
    @SerializedName("access_token") val accessToken: String,
    @SerializedName("version") val version: String? = null
)

data class ResourceItem(
    @SerializedName("id") val id: Int,
    @SerializedName("name") val name: String,
    @SerializedName("url") val url: String,
    @SerializedName("connection_status") val connectionStatus: String
)

data class NodeItem(
    @SerializedName("id") val id: Int,
    @SerializedName("name") val name: String,
    @SerializedName("ip") val ip: String,
    @SerializedName("system") val system: String?,
    @SerializedName("connection_status") val connectionStatus: String
)

data class ExitNodeItem(
    @SerializedName("node_id") val nodeId: Int,
    @SerializedName("node_name") val nodeName: String,
    @SerializedName("gateway") val gateway: String,
    @SerializedName("target_network") val targetNetwork: String
)

data class ConnectResponseData(
    @SerializedName("ip") val ip: String,
    @SerializedName("mask_len") val maskLen: Int,
    @SerializedName("hostname") val hostname: String,
    @SerializedName("identity_id") val identityId: Int,
    @SerializedName("resource_list") val resourceList: List<ResourceItem>?,
    @SerializedName("node_list") val nodeList: List<NodeItem>?,
    @SerializedName("acl") val acl: com.google.gson.JsonElement?,
    @SerializedName("exit_node") val exitNode: List<ExitNodeItem>?
)

data class AuthLoginRequest(
    @SerializedName("client_id") val clientId: String,
    @SerializedName("username") val username: String,
    @SerializedName("password") val password: String,
    @SerializedName("mac") val mac: String? = null,
    @SerializedName("system") val system: String? = null,
    @SerializedName("version") val version: String? = null,
    @SerializedName("hostname") val hostname: String? = null
)

data class GetNodeResourcesRequest(
    @SerializedName("client_id") val clientId: String,
    @SerializedName("access_token") val accessToken: String,
    @SerializedName("id") val id: Int
)

data class GetNodeResourcesResponseData(
    @SerializedName("id") val id: Int,
    @SerializedName("name") val name: String,
    @SerializedName("ip") val ip: String,
    @SerializedName("system") val system: String?,
    @SerializedName("connection_status") val connectionStatus: String,
    @SerializedName("resource_list") val resourceList: List<ResourceItem>?
)

data class AclRequest(
    @SerializedName("client_id") val clientId: String,
    @SerializedName("access_token") val accessToken: String,
    @SerializedName("network_id") val networkId: Int? = null
)

data class AclResponseData(
    @SerializedName("tcp") val tcp: List<Int>?,
    @SerializedName("udp") val udp: List<Int>?
)

data class DisconnectRequest(
    @SerializedName("client_id") val clientId: String,
    @SerializedName("access_token") val accessToken: String
)
