using NewRock.Sdk.Accept.Request;
using NewRock.Sdk.Control.Request;
using NewRock.Sdk.Control.Response;
using System.Linq.Expressions;

namespace NewRock.Sdk;

public partial interface INewRockClient
{
    #region 设备查询
    
    /// <summary>
    /// 查询设备信息
    /// </summary>
    /// <param name="request"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <param name="key"></param>
    /// <see href="http://app.newrocktech.com/omapi/chapter2/control/query/queryDeviceinfo.html"></see>
    /// <returns></returns>
    Task<QueryDeviceInfoResponse?> QueryDeviceInfo(QueryDeviceInfoRequest request, string key, int expired, CancellationToken cancellationToken)
        => ExecuteAsync<QueryDeviceInfoRequest, QueryDeviceInfoResponse>(request, key, expired, cancellationToken);

    /// <summary>
    /// 查询分机
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<QueryExtResponse?> QueryExt(QueryExtRequest request, string key, int expired, CancellationToken cancellationToken) 
        => ExecuteAsync<QueryExtRequest, QueryExtResponse>(request, key, expired, cancellationToken);

    /// <summary>
    /// 查询分机组
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<QueryExtGroupResponse?> QueryExtGroup(QueryExtGroupRequest request, string key, int expired,CancellationToken cancellationToken) 
        => ExecuteAsync<QueryExtGroupRequest, QueryExtGroupResponse>(request, key,expired, cancellationToken);


    /// <summary>
    /// 查询语音菜单
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<QueryMenuResponse?> QueryMenu(QueryMenuRequest request, string key, int expired, CancellationToken cancellationToken)
        => ExecuteAsync<QueryMenuRequest, QueryMenuResponse>(request, key, expired, cancellationToken);

    /// <summary>
    /// 查询中继
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<QueryTrunkResponse?> QueryTrunk(QueryTrunkRequest request, string key, int expired,CancellationToken cancellationToken)
        => ExecuteAsync<QueryTrunkRequest, QueryTrunkResponse>(request, key, expired, cancellationToken);

    /// <summary>
    /// 查询来电
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<QueryVisitorResponse?> QueryVisitor(QueryVisitorRequest request, string key, int expired, CancellationToken cancellationToken)
        => ExecuteAsync<QueryVisitorRequest, QueryVisitorResponse>(request, key, expired, cancellationToken);

    /// <summary>
    /// 查询去电
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<QueryOuterResponse?> QueryOuter(QueryOuterRequest request, string key, int expired, CancellationToken cancellationToken)
        => ExecuteAsync<QueryOuterRequest, QueryOuterResponse>(request, key, expired, cancellationToken);

    #endregion

    #region 强拆

    /// <summary>
    /// 强拆
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<NewRockResponse?> ClearCall(ClearCallRequest request, string key, int expired,
        CancellationToken cancellationToken) =>
        ExecuteAsync<ClearCallRequest, NewRockResponse>(request, key, expired, cancellationToken);

    #endregion

    #region 呼叫保持和接回

    /// <summary>
    /// 呼叫保持
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<NewRockResponse?> HoldOrUnHold(HoldSetRequest request, string key, int expired, CancellationToken cancellationToken)
        => ExecuteAsync<HoldSetRequest, NewRockResponse>(request, key, expired, cancellationToken);



    #endregion

    #region 静音开启和解除

    /// <summary>
    /// 静音开启和解除
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<NewRockResponse?> MuteOrUnMute(MuteSetRequest request, string key, int expired,CancellationToken cancellationToken)
        => ExecuteAsync<MuteSetRequest, NewRockResponse>(request, key, expired, cancellationToken);

    #endregion

    #region 配置（Assign）

    /// <summary>
    /// 配置分机
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<AssginConfigExtResponse?> ConfigExt(AssginConfigExtRequest request, string key, int expired,CancellationToken cancellationToken)
        => ExecuteAsync<AssginConfigExtRequest, AssginConfigExtResponse>(request, key, expired, cancellationToken);


    /// <summary>
    /// 配置分机组
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<AssginConfigGroupResponse?> ConfigExtGroup(AssginConfigGroupRequest request, string key, int expired,CancellationToken cancellationToken)
        => ExecuteAsync<AssginConfigGroupRequest, AssginConfigGroupResponse>(request, key, expired, cancellationToken);

    /// <summary>
    /// 配置语音菜单
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<AssginConfigMenuResponse?> ConfigMenu(AssginConfigMenuRequest request, string key, int expired,CancellationToken cancellationToken)
        => ExecuteAsync<AssginConfigMenuRequest, AssginConfigMenuResponse>(request, key, expired, cancellationToken);


    #endregion

    #region 监听和插播


    /// <summary>
    /// 监听
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<NewRockResponse?> MonitorExt(MonitorExtRequest request, string key, int expired, CancellationToken cancellationToken)
        => ExecuteAsync<MonitorExtRequest, NewRockResponse>(request, key, expired, cancellationToken);


    /// <summary>
    /// 从监听到插播状态变换
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<NewRockResponse?> MonitorExtToTalk(MonitorExtToTalkRequest request, string key, int expired, CancellationToken cancellationToken)
        => ExecuteAsync<MonitorExtToTalkRequest, NewRockResponse>(request, key, expired, cancellationToken);


    /// <summary>
    /// 从插播到监听状态变换
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<NewRockResponse?> MonitorExtToListen(MonitorExtToListenRequest request, string key, int expired, CancellationToken cancellationToken)
        => ExecuteAsync<MonitorExtToListenRequest, NewRockResponse>(request, key, expired, cancellationToken);


    #endregion


    #region 强插

    /// <summary>
    /// 强插
    /// </summary>
    /// <param name="request"></param>
    /// <param name="key"></param>
    /// <param name="expired"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<NewRockResponse?> BargeinExt(BargeinExtRequest request, string key, int expired, CancellationToken cancellationToken)
        => ExecuteAsync<BargeinExtRequest, NewRockResponse>(request, key, expired, cancellationToken);


    #endregion
}
