using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Flurl;
using Flurl.Http;

namespace SKIT.FlurlHttpClient.Wechat.Work
{
    public static class WechatWorkClientExecuteCgibinReportExtensions
    {
        #region Grid
        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/grid/add 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/94478 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportGridAddResponse> ExecuteCgibinReportGridAddAsync(this WechatWorkClient client, Models.CgibinReportGridAddRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "grid", "add")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportGridAddResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/grid/update 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/94479 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportGridUpdateResponse> ExecuteCgibinReportGridUpdateAsync(this WechatWorkClient client, Models.CgibinReportGridUpdateRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "grid", "update")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportGridUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/grid/delete 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/94480 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportGridDeleteResponse> ExecuteCgibinReportGridDeleteAsync(this WechatWorkClient client, Models.CgibinReportGridDeleteRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "grid", "delete")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportGridDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/grid/list 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/94481 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportGridListResponse> ExecuteCgibinReportGridListAsync(this WechatWorkClient client, Models.CgibinReportGridListRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "grid", "list")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportGridListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/grid/get_user_grid_info 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/94482 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportGridGetUserGridInfoResponse> ExecuteCgibinReportGridGetUserGridInfoAsync(this WechatWorkClient client, Models.CgibinReportGridGetUserGridInfoRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "grid", "get_user_grid_info")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportGridGetUserGridInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }
        #endregion

        #region GridCategory
        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/grid/add_cata 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/94536 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportGridAddCategoryResponse> ExecuteCgibinReportGridAddCategoryAsync(this WechatWorkClient client, Models.CgibinReportGridAddCategoryRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "grid", "add_cata")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportGridAddCategoryResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/grid/update_cata 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/94537 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportGridUpdateCategoryResponse> ExecuteCgibinReportGridUpdateCategoryAsync(this WechatWorkClient client, Models.CgibinReportGridUpdateCategoryRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "grid", "update_cata")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportGridUpdateCategoryResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/grid/delete_cata 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/94538 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportGridDeleteCategoryResponse> ExecuteCgibinReportGridDeleteCategoryAsync(this WechatWorkClient client, Models.CgibinReportGridDeleteCategoryRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "grid", "delete_cata")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportGridDeleteCategoryResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/grid/list_cata 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/94540 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportGridListCategoryResponse> ExecuteCgibinReportGridListCategoryAsync(this WechatWorkClient client, Models.CgibinReportGridListCategoryRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "grid", "list_cata")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportGridListCategoryResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }
        #endregion

        #region Patrol
        /// <summary>
        /// <para>异步调用 [GET] /cgi-bin/report/patrol/get_grid_info 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93531 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportPatrolGetGridInfoResponse> ExecuteCgibinReportPatrolGetGridInfoAsync(this WechatWorkClient client, Models.CgibinReportPatrolGetGridInfoRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Get, "cgi-bin", "report", "patrol", "get_grid_info")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportPatrolGetGridInfoResponse>(flurlReq, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/patrol/get_corp_status 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93532 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportPatrolGetCorpStatusResponse> ExecuteCgibinReportPatrolGetCorpStatusAsync(this WechatWorkClient client, Models.CgibinReportPatrolGetCorpStatusRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "patrol", "get_corp_status")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportPatrolGetCorpStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/patrol/get_user_status 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93533 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportPatrolGetUserStatusResponse> ExecuteCgibinReportPatrolGetUserStatusAsync(this WechatWorkClient client, Models.CgibinReportPatrolGetUserStatusRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "patrol", "get_user_status")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportPatrolGetUserStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/patrol/category_statistic 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93534 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportPatrolCategoryStatisticsResponse> ExecuteCgibinReportPatrolCategoryStatisticsAsync(this WechatWorkClient client, Models.CgibinReportPatrolCategoryStatisticsRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "patrol", "category_statistic")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportPatrolCategoryStatisticsResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/patrol/get_order_list 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93536 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportPatrolGetOrderListResponse> ExecuteCgibinReportPatrolGetOrderListAsync(this WechatWorkClient client, Models.CgibinReportPatrolGetOrderListRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "patrol", "get_order_list")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportPatrolGetOrderListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/patrol/get_order_info 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93535 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportPatrolGetOrderInfoResponse> ExecuteCgibinReportPatrolGetOrderInfoAsync(this WechatWorkClient client, Models.CgibinReportPatrolGetOrderInfoRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "patrol", "get_order_info")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportPatrolGetOrderInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }
        #endregion

        #region Resident
        /// <summary>
        /// <para>异步调用 [GET] /cgi-bin/report/resident/get_grid_info 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93514 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportResidentGetGridInfoResponse> ExecuteCgibinReportResidentGetGridInfoAsync(this WechatWorkClient client, Models.CgibinReportResidentGetGridInfoRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Get, "cgi-bin", "report", "resident", "get_grid_info")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportResidentGetGridInfoResponse>(flurlReq, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/resident/get_corp_status 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93515 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportResidentGetCorpStatusResponse> ExecuteCgibinReportResidentGetCorpStatusAsync(this WechatWorkClient client, Models.CgibinReportResidentGetCorpStatusRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "resident", "get_corp_status")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportResidentGetCorpStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/resident/get_user_status 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93516 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportResidentGetUserStatusResponse> ExecuteCgibinReportResidentGetUserStatusAsync(this WechatWorkClient client, Models.CgibinReportResidentGetUserStatusRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "resident", "get_user_status")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportResidentGetUserStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/resident/category_statistic 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93517 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportResidentCategoryStatisticsResponse> ExecuteCgibinReportResidentCategoryStatisticsAsync(this WechatWorkClient client, Models.CgibinReportResidentCategoryStatisticsRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "resident", "category_statistic")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportResidentCategoryStatisticsResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/resident/get_order_list 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93518 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportResidentGetOrderListResponse> ExecuteCgibinReportResidentGetOrderListAsync(this WechatWorkClient client, Models.CgibinReportResidentGetOrderListRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "resident", "get_order_list")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportResidentGetOrderListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/resident/get_order_info 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93519 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportResidentGetOrderInfoResponse> ExecuteCgibinReportResidentGetOrderInfoAsync(this WechatWorkClient client, Models.CgibinReportResidentGetOrderInfoRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "resident", "get_order_info")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportResidentGetOrderInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
        }
        #endregion

        #region SiteCode
        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/sitecode/list 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/93514 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportSiteCodeListResponse> ExecuteCgibinReportSiteCodeListAsync(this WechatWorkClient client, Models.CgibinReportSiteCodeListRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "sitecode", "list")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportSiteCodeListResponse>(flurlReq, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/sitecode/get_site_report_info 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/95461 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportSiteCodeGetSiteReportInfoResponse> ExecuteCgibinReportSiteCodeGetSiteReportInfoAsync(this WechatWorkClient client, Models.CgibinReportSiteCodeGetSiteReportInfoRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "sitecode", "get_site_report_info")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportSiteCodeGetSiteReportInfoResponse>(flurlReq, cancellationToken: cancellationToken);
        }

        /// <summary>
        /// <para>异步调用 [POST] /cgi-bin/report/sitecode/get_report_answer 接口。</para>
        /// <para>REF: https://developer.work.weixin.qq.com/document/path/95464 </para>
        /// </summary>
        /// <param name="client"></param>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static async Task<Models.CgibinReportSiteCodeGetReportAnswerResponse> ExecuteCgibinReportSiteCodeGetReportAnswerAsync(this WechatWorkClient client, Models.CgibinReportSiteCodeGetReportAnswerRequest request, CancellationToken cancellationToken = default)
        {
            if (client is null) throw new ArgumentNullException(nameof(client));
            if (request is null) throw new ArgumentNullException(nameof(request));

            IFlurlRequest flurlReq = client
                .CreateRequest(request, HttpMethod.Post, "cgi-bin", "report", "sitecode", "get_report_answer")
                .SetQueryParam("access_token", request.AccessToken);

            return await client.SendRequestWithJsonAsync<Models.CgibinReportSiteCodeGetReportAnswerResponse>(flurlReq, cancellationToken: cancellationToken);
        }
        #endregion
    }
}
