mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 23:13:32 +08:00
feat(work): 导入企业微信 API 客户端项目
This commit is contained in:
parent
f4932b2f89
commit
9b208d66cc
@ -16,12 +16,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SKIT.FlurlHttpClient.Wechat
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SKIT.FlurlHttpClient.Wechat.TenpayV3", "src\SKIT.FlurlHttpClient.Wechat.TenpayV3\SKIT.FlurlHttpClient.Wechat.TenpayV3.csproj", "{6FE502D4-C43D-49C9-9E57-D1EE566FD1C3}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SKIT.FlurlHttpClient.Wechat.Work", "src\SKIT.FlurlHttpClient.Wechat.Work\SKIT.FlurlHttpClient.Wechat.Work.csproj", "{CDD123E6-2622-4368-BAEE-8B95F05F1AB2}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{C95AF531-CF44-44AA-AC90-F4DF9F941674}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SKIT.FlurlHttpClient.Wechat.Api.UnitTests", "test\SKIT.FlurlHttpClient.Wechat.Api.UnitTests\SKIT.FlurlHttpClient.Wechat.Api.UnitTests.csproj", "{0C87A7D9-26EA-4821-AF3F-6D28B3006B24}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests", "test\SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests\SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests.csproj", "{5ECE2E7A-9AE8-49BF-902D-41A7756C3E78}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SKIT.FlurlHttpClient.Wechat.Work.UnitTests", "test\SKIT.FlurlHttpClient.Wechat.Work.UnitTests\SKIT.FlurlHttpClient.Wechat.Work.UnitTests.csproj", "{DBF84F66-1436-4599-93AB-7C16A3A2C3A4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -48,6 +52,14 @@ Global
|
||||
{5ECE2E7A-9AE8-49BF-902D-41A7756C3E78}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5ECE2E7A-9AE8-49BF-902D-41A7756C3E78}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5ECE2E7A-9AE8-49BF-902D-41A7756C3E78}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CDD123E6-2622-4368-BAEE-8B95F05F1AB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CDD123E6-2622-4368-BAEE-8B95F05F1AB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CDD123E6-2622-4368-BAEE-8B95F05F1AB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CDD123E6-2622-4368-BAEE-8B95F05F1AB2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DBF84F66-1436-4599-93AB-7C16A3A2C3A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DBF84F66-1436-4599-93AB-7C16A3A2C3A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DBF84F66-1436-4599-93AB-7C16A3A2C3A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DBF84F66-1436-4599-93AB-7C16A3A2C3A4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@ -58,6 +70,8 @@ Global
|
||||
{6FE502D4-C43D-49C9-9E57-D1EE566FD1C3} = {3E34ADB9-1F52-4C96-9A42-DE782DE1AAA3}
|
||||
{0C87A7D9-26EA-4821-AF3F-6D28B3006B24} = {C95AF531-CF44-44AA-AC90-F4DF9F941674}
|
||||
{5ECE2E7A-9AE8-49BF-902D-41A7756C3E78} = {C95AF531-CF44-44AA-AC90-F4DF9F941674}
|
||||
{CDD123E6-2622-4368-BAEE-8B95F05F1AB2} = {3E34ADB9-1F52-4C96-9A42-DE782DE1AAA3}
|
||||
{DBF84F66-1436-4599-93AB-7C16A3A2C3A4} = {C95AF531-CF44-44AA-AC90-F4DF9F941674}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F08ED64E-2517-4B51-A4BE-D33D56CC7B39}
|
||||
|
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
internal static class FlurlHttpRequestOptionsExtensions
|
||||
{
|
||||
public static IFlurlRequest SetOptions(this IFlurlRequest request, WechatWorkRequest options)
|
||||
{
|
||||
if (request == null) throw new ArgumentNullException(nameof(request));
|
||||
if (options == null) throw new ArgumentNullException(nameof(options));
|
||||
|
||||
if (options.Timeout.HasValue)
|
||||
{
|
||||
request.WithTimeout(TimeSpan.FromMilliseconds(options.Timeout.Value));
|
||||
}
|
||||
|
||||
return request;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,158 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinAgentExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/agent/get 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90227 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinAgentGetResponse> ExecuteCgibinAgentGetAsync(this WechatWorkClient client, Models.CgibinAgentGetRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (!request.AgentId.HasValue)
|
||||
request.AgentId = client.AgentId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(HttpMethod.Get, "cgi-bin", "agent", "get")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("agentid", request.AgentId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinAgentGetResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/agent/list 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90227 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinAgentListResponse> ExecuteCgibinAgentListAsync(this WechatWorkClient client, Models.CgibinAgentListRequest 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(HttpMethod.Get, "cgi-bin", "agent", "list")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinAgentListResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/agent/set 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90228 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinAgentSetResponse> ExecuteCgibinAgentSetAsync(this WechatWorkClient client, Models.CgibinAgentSetRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (!request.AgentId.HasValue)
|
||||
request.AgentId = client.AgentId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(HttpMethod.Post, "cgi-bin", "agent", "set")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinAgentSetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
#region Workbench
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/agent/set_workbench_template 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92535 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinAgentSetWorkbenchTemplateResponse> ExecuteCgibinAgentSetWorkbenchTemplateAsync(this WechatWorkClient client, Models.CgibinAgentSetWorkbenchTemplateRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (!request.AgentId.HasValue)
|
||||
request.AgentId = client.AgentId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(HttpMethod.Post, "cgi-bin", "agent", "set_workbench_template")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinAgentSetWorkbenchTemplateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/agent/get_workbench_template 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92535 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinAgentGetWorkbenchTemplateResponse> ExecuteCgibinAgentGetWorkbenchTemplateAsync(this WechatWorkClient client, Models.CgibinAgentGetWorkbenchTemplateRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (!request.AgentId.HasValue)
|
||||
request.AgentId = client.AgentId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(HttpMethod.Post, "cgi-bin", "agent", "get_workbench_template")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinAgentGetWorkbenchTemplateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/agent/set_workbench_data 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92535 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinAgentSetWorkbenchDataResponse> ExecuteCgibinAgentSetWorkbenchDataAsync(this WechatWorkClient client, Models.CgibinAgentSetWorkbenchDataRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (!request.AgentId.HasValue)
|
||||
request.AgentId = client.AgentId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(HttpMethod.Post, "cgi-bin", "agent", "set_workbench_data")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinAgentSetWorkbenchDataResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinBatchExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/batch/invite 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90975 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinBatchInviteResponse> ExecuteCgibinBatchInviteAsync(this WechatWorkClient client, Models.CgibinBatchInviteRequest 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(HttpMethod.Post, "cgi-bin", "batch", "invite")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinBatchInviteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/batch/syncuser 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90980 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinBatchSyncUserResponse> ExecuteCgibinBatchSyncUserAsync(this WechatWorkClient client, Models.CgibinBatchSyncUserRequest 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(HttpMethod.Post, "cgi-bin", "batch", "syncuser")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinBatchSyncUserResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/batch/replaceuser 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90981 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinBatchReplaceUserResponse> ExecuteCgibinBatchReplaceUserAsync(this WechatWorkClient client, Models.CgibinBatchReplaceUserRequest 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(HttpMethod.Post, "cgi-bin", "batch", "replaceuser")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinBatchReplaceUserResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/batch/replaceparty 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90981 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinBatchReplaceDepartmentResponse> ExecuteCgibinBatchReplaceDepartmentAsync(this WechatWorkClient client, Models.CgibinBatchReplaceDepartmentRequest 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(HttpMethod.Post, "cgi-bin", "batch", "replaceparty")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinBatchReplaceDepartmentResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/batch/getresult 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90983 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinBatchGetResultResponse> ExecuteCgibinBatchGetResultAsync(this WechatWorkClient client, Models.CgibinBatchGetResultRequest 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(HttpMethod.Get, "cgi-bin", "batch", "getresult")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("jobid", request.JobId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinBatchGetResultResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinCorpExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/corp/get_join_qrcode 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/91039 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinCorpGetJoinQrcodeResponse> ExecuteCgibinCorpGetJoinQrcodeAsync(this WechatWorkClient client, Models.CgibinCorpGetJoinQrcodeRequest 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(HttpMethod.Get, "cgi-bin", "corp", "get_join_qrcode")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
if (request.SizeType.HasValue)
|
||||
flurlReq.SetQueryParam("size_type", request.SizeType.Value);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinCorpGetJoinQrcodeResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinCorpGroupExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/list_app_share_info 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93403 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinCorpGroupCropListAppShareInfoResponse> ExecuteCgibinCorpGroupCropListAppShareInfoAsync(this WechatWorkClient client, Models.CgibinCorpGroupCropListAppShareInfoRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (!request.AgentId.HasValue)
|
||||
request.AgentId = client.AgentId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(HttpMethod.Post, "cgi-bin", "corpgroup", "corp", "list_app_share_info")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCropListAppShareInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/gettoken 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93359 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinCorpGroupCropGetTokenResponse> ExecuteCgibinCorpGroupCropGetTokenAsync(this WechatWorkClient client, Models.CgibinCorpGroupCropGetTokenRequest 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(HttpMethod.Post, "cgi-bin", "corpgroup", "corp", "gettoken")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCropGetTokenResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinDepartmentExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/department/create 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90205 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinDepartmentCreateResponse> ExecuteCgibinDepartmentCreateAsync(this WechatWorkClient client, Models.CgibinDepartmentCreateRequest 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(HttpMethod.Post, "cgi-bin", "department", "create")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinDepartmentCreateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/department/update 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90206 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinDepartmentUpdateResponse> ExecuteCgibinDepartmentUpdateAsync(this WechatWorkClient client, Models.CgibinDepartmentUpdateRequest 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(HttpMethod.Post, "cgi-bin", "department", "update")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinDepartmentUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/department/delete 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90206 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinDepartmentDeleteResponse> ExecuteCgibinDepartmentDeleteAsync(this WechatWorkClient client, Models.CgibinDepartmentDeleteRequest 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(HttpMethod.Get, "cgi-bin", "department", "delete")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("id", request.DepartmentId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinDepartmentDeleteResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/department/list 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90208 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinDepartmentListResponse> ExecuteCgibinDepartmentListAsync(this WechatWorkClient client, Models.CgibinDepartmentListRequest 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(HttpMethod.Get, "cgi-bin", "department", "list")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
if (request.ParentDepartmentId.HasValue)
|
||||
flurlReq.SetQueryParam("id", request.ParentDepartmentId.Value);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinDepartmentListResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/gettoken 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/91039 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinGetTokenResponse> ExecuteCgibinGetTokenAsync(this WechatWorkClient client, Models.CgibinGetTokenRequest 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(HttpMethod.Get, "cgi-bin", "token")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("corpid", client.CorpId)
|
||||
.SetQueryParam("corpsecret", client.AgentSecret);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinGetTokenResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/get_api_domain_ip 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92520 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinGetApiDomainIpResponse> ExecuteCgibinGetApiDomainIpAsync(this WechatWorkClient client, Models.CgibinGetApiDomainIpRequest 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(HttpMethod.Get, "cgi-bin", "get_api_domain_ip")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinGetApiDomainIpResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinExternalContactExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/externalcontact/get_follow_user_list 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92571 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExternalContactGetFollowUserListResponse> ExecuteCgibinExternalContactGetFollowUserListAsync(this WechatWorkClient client, Models.CgibinExternalContactGetFollowUserListRequest 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(HttpMethod.Get, "cgi-bin", "externalcontact", "get_follow_user_list")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinExternalContactGetFollowUserListResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/close_temp_chat 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92572 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExternalContactCloseTempChatResponse> ExecuteCgibinExternalContactCloseTempChatAsync(this WechatWorkClient client, Models.CgibinExternalContactCloseTempChatRequest 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(HttpMethod.Post, "cgi-bin", "externalcontact", "close_temp_chat")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactCloseTempChatResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
#region ContactWay
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/add_contact_way 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92572 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExternalContactAddContactWayResponse> ExecuteCgibinExternalContactAddContactWayAsync(this WechatWorkClient client, Models.CgibinExternalContactAddContactWayRequest 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(HttpMethod.Post, "cgi-bin", "externalcontact", "add_contact_way")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactAddContactWayResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/get_contact_way 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92572 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExternalContactGetContactWayResponse> ExecuteCgibinExternalContactGetContactWayAsync(this WechatWorkClient client, Models.CgibinExternalContactGetContactWayRequest 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(HttpMethod.Post, "cgi-bin", "externalcontact", "get_contact_way")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactGetContactWayResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/update_contact_way 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92572 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExternalContactUpdateContactWayResponse> ExecuteCgibinExternalContactUpdateContactWayAsync(this WechatWorkClient client, Models.CgibinExternalContactUpdateContactWayRequest 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(HttpMethod.Post, "cgi-bin", "externalcontact", "update_contact_way")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactUpdateContactWayResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/del_contact_way 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92572 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExternalContactDeleteContactWayResponse> ExecuteCgibinExternalContactDeleteContactWayAsync(this WechatWorkClient client, Models.CgibinExternalContactDeleteContactWayRequest 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(HttpMethod.Post, "cgi-bin", "externalcontact", "del_contact_way")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactDeleteContactWayResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinLinkedCorpExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/linkedcorp/agent/get_perm_list 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93172 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLinkedCorpAgentGetPermissionListResponse> ExecuteCgibinLinkedCorpAgentGetPermissionListAsync(this WechatWorkClient client, Models.CgibinLinkedCorpAgentGetPermissionListRequest 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(HttpMethod.Post, "cgi-bin", "linkedcorp", "agent", "get_perm_list")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLinkedCorpAgentGetPermissionListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/linkedcorp/user/get 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93171 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLinkedCorpUserGetResponse> ExecuteCgibinLinkedCorpUserGetAsync(this WechatWorkClient client, Models.CgibinLinkedCorpUserGetRequest 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(HttpMethod.Post, "cgi-bin", "linkedcorp", "user", "get")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLinkedCorpUserGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/linkedcorp/user/simplelist 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93168 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLinkedCorpUserSimpleListResponse> ExecuteCgibinLinkedCorpUserSimpleListAsync(this WechatWorkClient client, Models.CgibinLinkedCorpUserSimpleListRequest 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(HttpMethod.Post, "cgi-bin", "linkedcorp", "user", "simplelist")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLinkedCorpUserSimpleListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/linkedcorp/user/list 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93169 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLinkedCorpUserListResponse> ExecuteCgibinLinkedCorpUserListAsync(this WechatWorkClient client, Models.CgibinLinkedCorpUserListRequest 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(HttpMethod.Post, "cgi-bin", "linkedcorp", "user", "list")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLinkedCorpUserListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/linkedcorp/department/list 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93170 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinLinkedCorpDepartmentListResponse> ExecuteCgibinLinkedCorpDepartmentListAsync(this WechatWorkClient client, Models.CgibinLinkedCorpDepartmentListRequest 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(HttpMethod.Post, "cgi-bin", "linkedcorp", "department", "list")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinLinkedCorpDepartmentListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,162 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinMediaExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/media/upload 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90253 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMediaUploadResponse> ExecuteCgibinMediaUploadAsync(this WechatWorkClient client, Models.CgibinMediaUploadRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileName))
|
||||
{
|
||||
string ext = "";
|
||||
if ("image".Equals(request.Type))
|
||||
ext = ".png";
|
||||
else if ("voice".Equals(request.Type))
|
||||
ext = ".mp3";
|
||||
else if ("video".Equals(request.Type))
|
||||
ext = ".mp4";
|
||||
|
||||
request.FileName = Guid.NewGuid().ToString("N").ToLower() + ext;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileContentType))
|
||||
{
|
||||
if (request.FileName!.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase))
|
||||
request.FileContentType = "image/jpeg";
|
||||
else if (request.FileName!.EndsWith(".jpeg", StringComparison.OrdinalIgnoreCase))
|
||||
request.FileContentType = "image/jpeg";
|
||||
else if (request.FileName!.EndsWith(".png", StringComparison.OrdinalIgnoreCase))
|
||||
request.FileContentType = "image/png";
|
||||
else if (request.FileName!.EndsWith(".gif", StringComparison.OrdinalIgnoreCase))
|
||||
request.FileContentType = "image/gif";
|
||||
else if (request.FileName!.EndsWith(".mp3", StringComparison.OrdinalIgnoreCase))
|
||||
request.FileContentType = "audio/mpeg";
|
||||
else if (request.FileName!.EndsWith(".amr", StringComparison.OrdinalIgnoreCase))
|
||||
request.FileContentType = "audio/amr";
|
||||
else if (request.FileName!.EndsWith(".mp4", StringComparison.OrdinalIgnoreCase))
|
||||
request.FileContentType = "video/mp4";
|
||||
else
|
||||
request.FileContentType = "application/octet-stream";
|
||||
}
|
||||
|
||||
string boundary = "--BOUNDARY--" + DateTimeOffset.Now.Ticks.ToString("x");
|
||||
using var fileContent = new ByteArrayContent(request.FileBytes ?? new byte[0]);
|
||||
using var httpContent = new MultipartFormDataContent(boundary);
|
||||
httpContent.Add(fileContent, "\"media\"", "\"" + request.FileName + "\"");
|
||||
httpContent.Headers.ContentType = MediaTypeHeaderValue.Parse("multipart/form-data; boundary=" + boundary);
|
||||
fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse(request.FileContentType);
|
||||
fileContent.Headers.ContentLength = request.FileBytes?.Length;
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(HttpMethod.Post, "cgi-bin", "media", "upload")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("type", request.Type);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinMediaUploadResponse>(flurlReq, content: httpContent, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/media/uploadimg 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90256 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMediaUploadImageResponse> ExecuteCgibinMediaUploadImageAsync(this WechatWorkClient client, Models.CgibinMediaUploadImageRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileName))
|
||||
request.FileName = Guid.NewGuid().ToString("N").ToLower() + ".png";
|
||||
|
||||
if (string.IsNullOrEmpty(request.FileContentType))
|
||||
{
|
||||
if (request.FileName!.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase))
|
||||
request.FileContentType = "image/jpeg";
|
||||
else if (request.FileName!.EndsWith(".jpeg", StringComparison.OrdinalIgnoreCase))
|
||||
request.FileContentType = "image/jpeg";
|
||||
else
|
||||
request.FileContentType = "image/png";
|
||||
}
|
||||
|
||||
string boundary = "--BOUNDARY--" + DateTimeOffset.Now.Ticks.ToString("x");
|
||||
using var fileContent = new ByteArrayContent(request.FileBytes ?? new byte[0]);
|
||||
using var httpContent = new MultipartFormDataContent(boundary);
|
||||
httpContent.Add(fileContent, "\"media\"", "\"" + request.FileName + "\"");
|
||||
httpContent.Headers.ContentType = MediaTypeHeaderValue.Parse("multipart/form-data; boundary=" + boundary);
|
||||
fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse(request.FileContentType);
|
||||
fileContent.Headers.ContentLength = request.FileBytes?.Length;
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(HttpMethod.Post, "cgi-bin", "media", "uploadimg")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinMediaUploadImageResponse>(flurlReq, content: httpContent, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/media/get 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90254 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMediaGetResponse> ExecuteCgibinMediaGetAsync(this WechatWorkClient client, Models.CgibinMediaGetRequest 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(HttpMethod.Get, "cgi-bin", "media", "get")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("media_id", request.MediaId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinMediaGetResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/media/get/jssdk 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90255 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMediaGetJssdkResponse> ExecuteCgibinMediaGetJssdkAsync(this WechatWorkClient client, Models.CgibinMediaGetJssdkRequest 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(HttpMethod.Get, "cgi-bin", "media", "get", "jssdk")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("media_id", request.MediaId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinMediaGetJssdkResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinMenuExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/menu/create 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90231 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMenuCreateResponse> ExecuteCgibinMenuCreateAsync(this WechatWorkClient client, Models.CgibinMenuCreateRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (!request.AgentId.HasValue)
|
||||
request.AgentId = client.AgentId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(HttpMethod.Post, "cgi-bin", "menu", "create")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("agentid", request.AgentId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMenuCreateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/menu/get 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90232 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMenuGetResponse> ExecuteCgibinMenuGetAsync(this WechatWorkClient client, Models.CgibinMenuGetRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (!request.AgentId.HasValue)
|
||||
request.AgentId = client.AgentId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(HttpMethod.Get, "cgi-bin", "menu", "get")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("agentid", request.AgentId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinMenuGetResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/menu/delete 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90233 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMenuDeleteResponse> ExecuteCgibinMenuDeleteAsync(this WechatWorkClient client, Models.CgibinMenuDeleteRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (!request.AgentId.HasValue)
|
||||
request.AgentId = client.AgentId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(HttpMethod.Get, "cgi-bin", "menu", "delete")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("agentid", request.AgentId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinMenuDeleteResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinMiniProgramExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/miniprogram/transfer_session 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93403 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMiniProgramTransferSessionResponse> ExecuteCgibinMiniProgramTransferSessionAsync(this WechatWorkClient client, Models.CgibinMiniProgramTransferSessionRequest 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(HttpMethod.Post, "cgi-bin", "miniprogram", "transfer_session")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMiniProgramTransferSessionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinTagExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/tag/create 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90210 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinTagCreateResponse> ExecuteCgibinTagCreateAsync(this WechatWorkClient client, Models.CgibinTagCreateRequest 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(HttpMethod.Post, "cgi-bin", "tag", "create")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinTagCreateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/tag/update 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90211 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinTagUpdateResponse> ExecuteCgibinTagUpdateAsync(this WechatWorkClient client, Models.CgibinTagUpdateRequest 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(HttpMethod.Post, "cgi-bin", "tag", "update")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinTagUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/tag/delete 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90212 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinTagDeleteResponse> ExecuteCgibinTagDeleteAsync(this WechatWorkClient client, Models.CgibinTagDeleteRequest 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(HttpMethod.Get, "cgi-bin", "tag", "delete")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("tagid", request.TagId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinTagDeleteResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/tag/list 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90216 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinTagListResponse> ExecuteCgibinTagListAsync(this WechatWorkClient client, Models.CgibinTagListRequest 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(HttpMethod.Get, "cgi-bin", "tag", "list")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinTagListResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/tag/get 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90213 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinTagGetResponse> ExecuteCgibinTagGetAsync(this WechatWorkClient client, Models.CgibinTagGetRequest 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(HttpMethod.Get, "cgi-bin", "tag", "get")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("tagid", request.TagId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinTagGetResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
#region TagUser
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/tag/addtagusers 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90214 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinTagAddTagUsersResponse> ExecuteCgibinTagAddTagUsersAsync(this WechatWorkClient client, Models.CgibinTagAddTagUsersRequest 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(HttpMethod.Post, "cgi-bin", "tag", "addtagusers")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinTagAddTagUsersResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/tag/deltagusers 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90215 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinTagDeleteTagUsersResponse> ExecuteCgibinTagDeleteTagUsersAsync(this WechatWorkClient client, Models.CgibinTagDeleteTagUsersRequest 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(HttpMethod.Post, "cgi-bin", "tag", "deltagusers")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinTagDeleteTagUsersResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -0,0 +1,279 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinUserExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/user/create 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90195 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserCreateResponse> ExecuteCgibinUserCreateAsync(this WechatWorkClient client, Models.CgibinUserCreateRequest 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(HttpMethod.Post, "cgi-bin", "user", "create")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinUserCreateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/user/get 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90196 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserGetResponse> ExecuteCgibinUserGetAsync(this WechatWorkClient client, Models.CgibinUserGetRequest 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(HttpMethod.Get, "cgi-bin", "user", "get")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("userid", request.UserId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinUserGetResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/user/update 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90197 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserUpdateResponse> ExecuteCgibinUserUpdateAsync(this WechatWorkClient client, Models.CgibinUserUpdateRequest 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(HttpMethod.Post, "cgi-bin", "user", "update")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinUserUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/user/delete 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90198 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserDeleteResponse> ExecuteCgibinUserDeleteAsync(this WechatWorkClient client, Models.CgibinUserDeleteRequest 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(HttpMethod.Get, "cgi-bin", "user", "delete")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("userid", request.UserId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinUserDeleteResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/user/batchdelete 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90199 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserBatchDeleteResponse> ExecuteCgibinUserBatchDeleteAsync(this WechatWorkClient client, Models.CgibinUserBatchDeleteRequest 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(HttpMethod.Post, "cgi-bin", "user", "batchdelete")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinUserBatchDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/user/simplelist 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90200 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserSimpleListResponse> ExecuteCgibinUserSimpleListAsync(this WechatWorkClient client, Models.CgibinUserSimpleListRequest 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(HttpMethod.Get, "cgi-bin", "user", "simplelist")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("department_id", request.DepartmentId);
|
||||
|
||||
if (request.RequireFetchChild.HasValue)
|
||||
flurlReq.SetQueryParam("fetch_child", request.RequireFetchChild.Value ? 1 : 0);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinUserSimpleListResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/user/list 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90201 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserListResponse> ExecuteCgibinUserListAsync(this WechatWorkClient client, Models.CgibinUserListRequest 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(HttpMethod.Get, "cgi-bin", "user", "list")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("department_id", request.DepartmentId);
|
||||
|
||||
if (request.RequireFetchChild.HasValue)
|
||||
flurlReq.SetQueryParam("fetch_child", request.RequireFetchChild.Value ? 1 : 0);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinUserListResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/user/convert_to_openid 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90202 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserConvertToOpenIdResponse> ExecuteCgibinUserConvertToOpenIdAsync(this WechatWorkClient client, Models.CgibinUserConvertToOpenIdRequest 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(HttpMethod.Post, "cgi-bin", "user", "convert_to_openid")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinUserConvertToOpenIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/user/convert_to_userid 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90202 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserConvertToUserIdResponse> ExecuteCgibinUserConvertToUserIdAsync(this WechatWorkClient client, Models.CgibinUserConvertToUserIdRequest 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(HttpMethod.Post, "cgi-bin", "user", "convert_to_userid")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinUserConvertToUserIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/user/authsucc 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90203 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserAuthSuccessResponse> ExecuteCgibinUserAuthSuccessAsync(this WechatWorkClient client, Models.CgibinUserAuthSuccessRequest 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(HttpMethod.Get, "cgi-bin", "user", "authsucc")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("userid", request.UserId);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinUserAuthSuccessResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/user/getuserinfo 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/91023 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/91437 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserGetUserInfoResponse> ExecuteCgibinUserGetUserInfoAsync(this WechatWorkClient client, Models.CgibinUserGetUserInfoRequest 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(HttpMethod.Get, "cgi-bin", "user", "getuserinfo")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("code", request.Code);
|
||||
|
||||
return await client.SendRequestAsync<Models.CgibinUserGetUserInfoResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/user/get_active_stat 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92714 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinUserGetActiveStatResponse> ExecuteCgibinUserGetActiveStatAsync(this WechatWorkClient client, Models.CgibinUserGetActiveStatRequest 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(HttpMethod.Post, "cgi-bin", "user", "get_active_stat")
|
||||
.SetOptions(request)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinUserGetActiveStatResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/get_api_domain_ip 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinGetApiDomainIpRequest : WechatWorkRequest
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/get_api_domain_ip 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinGetApiDomainIpResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信服务器 IP 地址列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ip_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ip_list")]
|
||||
public string[] IPList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/gettoken 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinGetTokenRequest : WechatWorkRequest
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/gettoken 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinGetTokenResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置凭证。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("access_token")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("access_token")]
|
||||
public string AccessToken { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置凭证有效时间(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||
public int ExpiresIn { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/agent/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentGetRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。如果不指定将使用构造 <see cref="WechatWorkClient"/> 时的 <see cref="WechatWorkClientOptions.AgentId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int? AgentId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/agent/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentGetResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class AllowedUser
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class User
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user")]
|
||||
public Types.User[] UserList { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class AllowedDepartment
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("partyid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("partyid")]
|
||||
public int[] DepartmentIdList { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class AllowedTag
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置标签 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tagid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tagid")]
|
||||
public int[] TagIdList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用方形头像 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("square_logo_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("square_logo_url")]
|
||||
public string SquareLogoUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用详情。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string Description { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置可见人员范围信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("allow_userinfos")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("allow_userinfos")]
|
||||
public Types.AllowedUser AllowedUser { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置可见部门范围信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("allow_partys")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("allow_partys")]
|
||||
public Types.AllowedDepartment AllowedDepartment { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置可见标签范围信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("allow_tags")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("allow_tags")]
|
||||
public Types.AllowedTag AllowedTag { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否被停用。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("close")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumberTypedBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("close")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumberTypedBooleanConverter))]
|
||||
public bool IsClosed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否上报用户地理位置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("report_location_flag")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumberTypedBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("report_location_flag")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumberTypedBooleanConverter))]
|
||||
public bool IsReportLocation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否上报用户进入事件。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("isreportenter")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumberTypedBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("isreportenter")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumberTypedBooleanConverter))]
|
||||
public bool IsReportEnter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置可信域名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("redirect_domain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("redirect_domain")]
|
||||
public string? RedirectDomain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用主页。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("home_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("home_url")]
|
||||
public string? HomeUrl { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/agent/list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentListRequest : WechatWorkRequest
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/agent/list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentListResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Agent
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用方形头像 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("square_logo_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("square_logo_url")]
|
||||
public string SquareLogoUrl { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agentlist")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agentlist")]
|
||||
public Types.Agent[] AgentList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/set 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentSetRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。如果不指定将使用构造 <see cref="WechatWorkClient"/> 时的 <see cref="WechatWorkClientOptions.AgentId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
|
||||
public int? AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置头像 LogoMediaId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("logo_mediaid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("logo_mediaid")]
|
||||
public string? LogoMediaId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用详情。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否上报用户地理位置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("report_location_flag")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumberTypedNullableBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("report_location_flag")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumberTypedNullableBooleanConverter))]
|
||||
public bool? IsReportLocation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否上报用户进入事件。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("isreportenter")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumberTypedNullableBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("isreportenter")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumberTypedNullableBooleanConverter))]
|
||||
public bool? IsReportEnter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置可信域名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("redirect_domain")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("redirect_domain")]
|
||||
public string? RedirectDomain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用主页。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("home_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("home_url")]
|
||||
public string? HomeUrl { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/set 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentSetResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/get_workbench_template 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentGetWorkbenchTemplateRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。如果不指定将使用构造 <see cref="WechatWorkClient"/> 时的 <see cref="WechatWorkClientOptions.AgentId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
|
||||
public int? AgentId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,185 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/get_workbench_template 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentGetWorkbenchTemplateResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class KeyDataTemplate
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class KeyDataItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键数据名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("key")]
|
||||
public string? Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public string Data { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置点击跳转链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jump_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jump_url")]
|
||||
public string? JumpUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pagepath")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pagepath")]
|
||||
public string? MiniProgramPagePath { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键数据项。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("items")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("items")]
|
||||
public Types.KeyDataItem[] Items { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class ImageTemplate
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图片 Url。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string? Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置点击跳转链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jump_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jump_url")]
|
||||
public string? JumpUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pagepath")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pagepath")]
|
||||
public string? MiniProgramPagePath { get; set; }
|
||||
}
|
||||
|
||||
public class WebviewTemplate
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置渲染展示 Url。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string? Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置点击跳转链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jump_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jump_url")]
|
||||
public string? JumpUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pagepath")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pagepath")]
|
||||
public string? MiniProgramPagePath { get; set; }
|
||||
}
|
||||
|
||||
public class ListTemplate
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ListItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置列表显示文字。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public string Title { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置点击跳转链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jump_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jump_url")]
|
||||
public string? JumpUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pagepath")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pagepath")]
|
||||
public string? MiniProgramPagePath { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置列表项。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("items")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("items")]
|
||||
public Types.ListItem[] Items { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模版类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键数据型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("keydata")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("keydata")]
|
||||
public Types.KeyDataTemplate? KeyDataTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("image")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("image")]
|
||||
public Types.ImageTemplate? ImageTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置列表型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("list")]
|
||||
public Types.ListTemplate? ListTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置网页型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("webview")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("webview")]
|
||||
public Types.WebviewTemplate? WebviewTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否覆盖用户工作台的数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("replace_user_data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("replace_user_data")]
|
||||
public bool IsReplaceUserData { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/set_workbench_data 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentSetWorkbenchDataRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class KeyDataTemplate : CgibinAgentSetWorkbenchTemplateRequest.Types.KeyDataTemplate
|
||||
{
|
||||
}
|
||||
|
||||
public class ImageTemplate : CgibinAgentSetWorkbenchTemplateRequest.Types.ImageTemplate
|
||||
{
|
||||
}
|
||||
|
||||
public class WebviewTemplate : CgibinAgentSetWorkbenchTemplateRequest.Types.WebviewTemplate
|
||||
{
|
||||
}
|
||||
|
||||
public class ListTemplate : CgibinAgentSetWorkbenchTemplateRequest.Types.ListTemplate
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。如果不指定将使用构造 <see cref="WechatWorkClient"/> 时的 <see cref="WechatWorkClientOptions.AgentId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
|
||||
public int? AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模版类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键数据型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("keydata")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("keydata")]
|
||||
public Types.KeyDataTemplate? KeyDataTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("image")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("image")]
|
||||
public Types.ImageTemplate? ImageTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置列表型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("list")]
|
||||
public Types.ListTemplate? ListTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置网页型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("webview")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("webview")]
|
||||
public Types.WebviewTemplate? WebviewTemplate { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/set_workbench_data 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentSetWorkbenchDataResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,192 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/set_workbench_template 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentSetWorkbenchTemplateRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class KeyDataTemplate
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class KeyDataItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键数据名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("key")]
|
||||
public string? Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public string Data { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置点击跳转链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jump_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jump_url")]
|
||||
public string? JumpUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pagepath")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pagepath")]
|
||||
public string? MiniProgramPagePath { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键数据项。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("items")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("items")]
|
||||
public IList<Types.KeyDataItem> Items { get; set; } = new List<Types.KeyDataItem>();
|
||||
}
|
||||
|
||||
public class ImageTemplate
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图片 Url。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string? Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置点击跳转链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jump_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jump_url")]
|
||||
public string? JumpUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pagepath")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pagepath")]
|
||||
public string? MiniProgramPagePath { get; set; }
|
||||
}
|
||||
|
||||
public class WebviewTemplate
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置渲染展示 Url。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string? Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置点击跳转链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jump_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jump_url")]
|
||||
public string? JumpUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pagepath")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pagepath")]
|
||||
public string? MiniProgramPagePath { get; set; }
|
||||
}
|
||||
|
||||
public class ListTemplate
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ListItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置列表显示文字。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置点击跳转链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jump_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jump_url")]
|
||||
public string? JumpUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pagepath")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pagepath")]
|
||||
public string? MiniProgramPagePath { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置列表项。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("items")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("items")]
|
||||
public IList<Types.ListItem> Items { get; set; } = new List<Types.ListItem>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。如果不指定将使用构造 <see cref="WechatWorkClient"/> 时的 <see cref="WechatWorkClientOptions.AgentId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
|
||||
public int? AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模版类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键数据型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("keydata")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("keydata")]
|
||||
public Types.KeyDataTemplate? KeyDataTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("image")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("image")]
|
||||
public Types.ImageTemplate? ImageTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置列表型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("list")]
|
||||
public Types.ListTemplate? ListTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置网页型模版数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("webview")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("webview")]
|
||||
public Types.WebviewTemplate? WebviewTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否覆盖用户工作台的数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("replace_user_data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("replace_user_data")]
|
||||
public bool? IsReplaceUserData { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/agent/set_workbench_template 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinAgentSetWorkbenchTemplateResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/batch/getresult 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinBatchGetResultRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置异步任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string JobId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/batch/getresult 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinBatchGetResultResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置错误码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errcode")]
|
||||
public int ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errmsg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errmsg")]
|
||||
public string? ErrorMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("action")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("action")]
|
||||
public int? Action { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string? UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("partyid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("partyid")]
|
||||
public int? DepartmentId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务运行总条数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total")]
|
||||
public int TotalCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置目前运行百分比。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("percentage")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("percentage")]
|
||||
public int Percentage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置处理结果列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result")]
|
||||
public Types.Result[] ResultList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/batch/invite 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinBatchInviteRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user")]
|
||||
public IList<string>? UserIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("party")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("party")]
|
||||
public IList<int>? DepartmentIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标签 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tag")]
|
||||
public IList<int>? TagIdList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/batch/invite 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinBatchInviteResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置非法成员账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("invaliduser")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("invaliduser")]
|
||||
public string[]? InvalidUserIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置非法部门 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("invalidparty")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("invalidparty")]
|
||||
public int[]? InvalidDepartmentIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置非法标签 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("invalidtag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("invalidtag")]
|
||||
public int[]? InvalidTagIdList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/batch/replaceparty 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinBatchReplaceDepartmentRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Callback : CgibinBatchSyncUserRequest.Types.Callback
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 CSV 文件 MediaId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置回调信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("callback")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("callback")]
|
||||
public Types.Callback? Callback { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/batch/replaceparty 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinBatchReplaceDepartmentResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置异步任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/batch/replaceuser 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinBatchReplaceUserRequest : CgibinBatchSyncUserRequest
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/batch/replaceuser 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinBatchReplaceUserResponse : CgibinBatchSyncUserResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/batch/syncuser 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinBatchSyncUserRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Callback
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置回调通知地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string NotifyUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用于生成签名的 Token。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("token")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("token")]
|
||||
public string Token { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置经过 Base64 编码的 AES 密钥。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("encodingaeskey")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("encodingaeskey")]
|
||||
public string EncodingAesKey { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 CSV 文件 MediaId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否邀请成员。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("to_invite")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("to_invite")]
|
||||
public bool? RequireInvite { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置回调信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("callback")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("callback")]
|
||||
public Types.Callback? Callback { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/batch/syncuser 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinBatchSyncUserResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置异步任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/corp/get_join_qrcode 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinCorpGetJoinQrcodeRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置二维码尺寸类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int? SizeType { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/corp/get_join_qrcode 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinCorpGetJoinQrcodeResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置二维码 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("join_qrcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("join_qrcode")]
|
||||
public string QrcodeUrl { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/corpgroup/corp/gettoken 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinCorpGroupCropGetTokenRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置下级企业 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置下级企业应用 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
|
||||
public int AgentId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/corpgroup/corp/gettoken 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinCorpGroupCropGetTokenResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置下级企业 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("access_token")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("access_token")]
|
||||
public string AccessToken { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置下级企业 AccessToken 有效时间(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||
public int ExpiresIn { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/corpgroup/corp/list_app_share_info 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinCorpGroupCropListAppShareInfoRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置上级企业应用 ID。如果不指定将使用构造 <see cref="WechatWorkClient"/> 时的 <see cref="WechatWorkClientOptions.AgentId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
|
||||
public int? AgentId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/corpgroup/corp/list_app_share_info 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinCorpGroupCropListAppShareInfoResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Agent
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置下级企业 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置下级企业名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corp_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corp_name")]
|
||||
public string CorpName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置下级企业应用 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
|
||||
public int AgentId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置下级企业应用列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corp_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corp_list")]
|
||||
public Types.Agent[] AgentList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/department/create 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinDepartmentCreateRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public int? DepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门英文名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name_en")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name_en")]
|
||||
public string? EnglishName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置上级部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parentid")]
|
||||
public int? ParentDepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置在上级部门中的次序值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order")]
|
||||
public int? DepartmentOrder { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/department/create 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinDepartmentCreateResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public int DepartmentId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/department/delete 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinDepartmentDeleteRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int DepartmentId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/department/delete 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinDepartmentDeleteResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/department/list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinDepartmentListRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置指定上级部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int? ParentDepartmentId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/department/list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinDepartmentListResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Department
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public int DepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门英文名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name_en")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name_en")]
|
||||
public string? EnglishName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置上级部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parentid")]
|
||||
public int ParentDepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置在上级部门中的次序值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order")]
|
||||
public int DepartmentOrder { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department")]
|
||||
public Types.Department[] DepartmentList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/department/update 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinDepartmentUpdateRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public int DepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门英文名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name_en")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name_en")]
|
||||
public string? EnglishName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置上级部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parentid")]
|
||||
public int? ParentDepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置在上级部门中的次序值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order")]
|
||||
public int? DepartmentOrder { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/department/update 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinDepartmentUpdateResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/close_temp_chat 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactCloseTempChatRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置外部联系人账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_userid")]
|
||||
public string ExternalUserId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/close_temp_chat 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactCloseTempChatResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/externalcontact/get_follow_user_list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactGetFollowUserListRequest : WechatWorkRequest
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/externalcontact/get_follow_user_list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactGetFollowUserListResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置配置了客户联系功能的成员账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("follow_user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("follow_user")]
|
||||
public string[] FollowUserIdList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,221 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/add_contact_way 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactAddContactWayRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Conclusion
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Text
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文本内容。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("content")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("content")]
|
||||
public string Content { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class Image
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图片 MediaId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class Link
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string Url { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息标题。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("desc")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("desc")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息封面 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("picurl")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("picurl")]
|
||||
public string? PictureUrl { get; set; }
|
||||
}
|
||||
|
||||
public class MiniProgram
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置小程序 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page")]
|
||||
public string PagePath { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序标题。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序缩略图 MediaId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pic_media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pic_media_id")]
|
||||
public string? PictureMediaId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文本类型结束语。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("text")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("text")]
|
||||
public Types.Text? Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片类型结束语。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("image")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("image")]
|
||||
public Types.Image? Image { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置链接类型结束语。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("link")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("link")]
|
||||
public Types.Link? Link { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序类型结束语。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("miniprogram")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("miniprogram")]
|
||||
public Types.MiniProgram? MiniProgram { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系方式类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置场景。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scene")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scene")]
|
||||
public int Scene { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置控件样式。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("style")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("style")]
|
||||
public int? Style { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置备注信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("remark")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("remark")]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否无需验证。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("skip_verify")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("skip_verify")]
|
||||
public bool? IsSkipVerify { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业自定义的渠道参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("state")]
|
||||
public string? State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置使用该联系方式的成员账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user")]
|
||||
public IList<string>? UserIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置使用该联系方式的部门 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("party")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("party")]
|
||||
public IList<int>? DepartmentIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否临时会话模式。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("is_temp")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("is_temp")]
|
||||
public bool? IsTemp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置临时会话二维码有效期(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||
public int? TempQrcodeExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置临时会话有效期有效期(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_expires_in")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_expires_in")]
|
||||
public int? TempChatExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置可进行临时会话的客户 UnionId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unionid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unionid")]
|
||||
public string? UnionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结束语信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("conclusions")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("conclusions")]
|
||||
public Types.Conclusion? Conclusions { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/add_contact_way 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactAddContactWayResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置配置 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config_id")]
|
||||
public string ConfigId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系我的二维码链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("qr_code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("qr_code")]
|
||||
public string? QrcodeUrl { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/del_contact_way 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactDeleteContactWayRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置配置 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config_id")]
|
||||
public string ConfigId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/del_contact_way 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactDeleteContactWayResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/get_contact_way 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactGetContactWayRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置配置 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config_id")]
|
||||
public string ConfigId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,248 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/get_contact_way 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactGetContactWayResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ContactWay
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Conclusion
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Text
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文本内容。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("content")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("content")]
|
||||
public string Content { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class Image
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图片 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pic_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pic_url")]
|
||||
public string PictureUrl { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class Link
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string Url { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息标题。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("desc")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("desc")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文消息封面 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("picurl")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("picurl")]
|
||||
public string? PictureUrl { get; set; }
|
||||
}
|
||||
|
||||
public class MiniProgram
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置小程序 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string AppId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page")]
|
||||
public string PagePath { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序标题。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序缩略图 MediaId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pic_media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pic_media_id")]
|
||||
public string? PictureMediaId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文本类型结束语。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("text")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("text")]
|
||||
public Types.Text? Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片类型结束语。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("image")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("image")]
|
||||
public Types.Image? Image { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置链接类型结束语。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("link")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("link")]
|
||||
public Types.Link? Link { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序类型结束语。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("miniprogram")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("miniprogram")]
|
||||
public Types.MiniProgram? MiniProgram { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置配置 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config_id")]
|
||||
public string ConfigId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系方式类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置场景。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scene")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scene")]
|
||||
public int Scene { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置控件样式。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("style")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("style")]
|
||||
public int Style { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置备注信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("remark")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("remark")]
|
||||
public string Remark { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否无需验证。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("skip_verify")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("skip_verify")]
|
||||
public bool IsSkipVerify { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业自定义的渠道参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("state")]
|
||||
public string State { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系我的二维码链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("qr_code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("qr_code")]
|
||||
public string? QrcodeUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置使用该联系方式的成员账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user")]
|
||||
public string[]? UserIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置使用该联系方式的部门 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("party")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("party")]
|
||||
public int[]? DepartmentIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否临时会话模式。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("is_temp")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("is_temp")]
|
||||
public bool IsTemp { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置临时会话二维码有效期(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||
public int? TempQrcodeExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置临时会话有效期有效期(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_expires_in")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_expires_in")]
|
||||
public int? TempChatExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置可进行临时会话的客户 UnionId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unionid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unionid")]
|
||||
public string? UnionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结束语信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("conclusions")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("conclusions")]
|
||||
public Types.Conclusion Conclusions { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系方式信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_way")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_way")]
|
||||
public Types.ContactWay? ContactWay { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/update_contact_way 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactUpdateContactWayRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Conclusion : CgibinExternalContactAddContactWayRequest.Types.Conclusion
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置配置 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config_id")]
|
||||
public string ConfigId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置控件样式。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("style")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("style")]
|
||||
public int? Style { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置备注信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("remark")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("remark")]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否无需验证。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("skip_verify")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("skip_verify")]
|
||||
public bool? IsSkipVerify { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业自定义的渠道参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("state")]
|
||||
public string? State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置使用该联系方式的成员账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user")]
|
||||
public IList<string>? UserIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置使用该联系方式的部门 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("party")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("party")]
|
||||
public IList<int>? DepartmentIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否临时会话模式。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("is_temp")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("is_temp")]
|
||||
public bool? IsTemp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置临时会话二维码有效期(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||
public int? TempQrcodeExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置临时会话有效期有效期(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_expires_in")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_expires_in")]
|
||||
public int? TempChatExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置可进行临时会话的客户 UnionId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unionid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unionid")]
|
||||
public string? UnionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结束语信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("conclusions")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("conclusions")]
|
||||
public Types.Conclusion? Conclusions { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/update_contact_way 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactUpdateContactWayResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/linkedcorp/agent/get_perm_list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLinkedCorpAgentGetPermissionListRequest : WechatWorkRequest
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/linkedcorp/agent/get_perm_list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLinkedCorpAgentGetPermissionListResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置可见的互联企业成员账号(格式:"CorpId/UserId")列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userids")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userids")]
|
||||
public string[]? CorpUserIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置可见的互联企业部门 ID(格式:"LinkedId/DepartmentId")列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department_ids")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department_ids")]
|
||||
public string[]? LinkedDepartmentIdList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/linkedcorp/department/list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLinkedCorpDepartmentListRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置互联企业部门 ID(格式:"LinkedId/DepartmentId")。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department_id")]
|
||||
public string LinkedDepartmentId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/linkedcorp/department/list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLinkedCorpDepartmentListResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class LinkedDepartment
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department_id")]
|
||||
public int DepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department_name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置上级部门 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parentid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parentid")]
|
||||
public int ParentDepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置在上级部门中的次序值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order")]
|
||||
public int DepartmentOrder { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置互联企业部门列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department_list")]
|
||||
public Types.LinkedDepartment[] LinkedDepartmentList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/linkedcorp/user/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLinkedCorpUserGetRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置互联企业成员账号(格式:"CorpId/UserId")。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string CorpUserId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/linkedcorp/user/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLinkedCorpUserGetResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class CorpUser : CgibinLinkedCorpUserListResponse.Types.CorpUser
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置互联企业成员信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_info")]
|
||||
public Types.CorpUser CorpUser { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/linkedcorp/user/list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLinkedCorpUserListRequest : CgibinLinkedCorpUserSimpleListRequest
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/linkedcorp/user/list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLinkedCorpUserListResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class CorpUser
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ExtendedAttribute : CgibinUserGetResponse.Types.ExtendedAttribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置所属企业 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置手机号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mobile")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mobile")]
|
||||
public string? MobileNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置座机号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("telephone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("telephone")]
|
||||
public string? TeleNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置邮箱。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("email")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("email")]
|
||||
public string? Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置职务。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("position")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("position")]
|
||||
public string? Position { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置互联企业部门 ID(格式:"LinkedId/DepartmentId")列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department")]
|
||||
public string[]? LinkedDepartmentIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置自定义字段信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("extattr")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("extattr")]
|
||||
public Types.ExtendedAttribute? ExtendedAttribute { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置互联企业成员列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userlist")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userlist")]
|
||||
public Types.CorpUser[] CorpUserList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/linkedcorp/user/simplelist 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinLinkedCorpUserSimpleListRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置互联企业部门 ID(格式:"LinkedId/DepartmentId")。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department_id")]
|
||||
public string LinkedDepartmentId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否递归获取子部门成员。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fetch_child")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fetch_child")]
|
||||
public bool? RequireFetchChild { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/linkedcorp/user/simplelist 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinLinkedCorpUserSimpleListResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class CorpUser
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置所属企业 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corpid")]
|
||||
public string CorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置互联企业部门 ID(格式:"LinkedId/DepartmentId")列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department")]
|
||||
public string[]? LinkedDepartmentIdList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置互联企业成员列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userlist")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userlist")]
|
||||
public Types.CorpUser[] CorpUserList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/media/get/jssdk 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMediaGetJssdkRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置媒体文件标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/media/get/jssdk 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMediaGetJssdkResponse : WechatWorkResponse
|
||||
{
|
||||
public override bool IsSuccessful()
|
||||
{
|
||||
return base.IsSuccessful() && RawBytes?.Length > 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/media/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMediaGetRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置媒体文件标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/media/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMediaGetResponse : WechatWorkResponse
|
||||
{
|
||||
public override bool IsSuccessful()
|
||||
{
|
||||
return base.IsSuccessful() && RawBytes?.Length > 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/media/uploadimg 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMediaUploadImageRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图片文件字节数组。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public byte[] FileBytes { get; set; } = new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片文件名。如果不指定将由系统自动生成。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片文件 Conent-Type。如果不指定将由系统自动生成。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? FileContentType { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/media/uploadimg 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMediaUploadImageResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图片 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string Url { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/media/upload 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMediaUploadRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置媒体文件类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文件字节数组。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public byte[] FileBytes { get; set; } = new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文件名。如果不指定将由系统自动生成。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文件 Conent-Type。如果不指定将由系统自动生成。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? FileContentType { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/media/upload 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMediaUploadResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置媒体文件类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置媒体文件标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
|
||||
public string MediaId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置媒体文件上传时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("created_at")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("created_at")]
|
||||
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
|
||||
public long CreateTimestamp { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/menu/create 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMenuCreateRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Button
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置菜单的响应动作类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置菜单名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置菜单 KEY 值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("key")]
|
||||
public string? Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置网页链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string? Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序的 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string? MiniProgramAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序的页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pagepath")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pagepath")]
|
||||
public string? MiniProgramPagePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子菜单列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_button")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_button")]
|
||||
public IList<Button>? SubButtonList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。如果不指定将使用构造 <see cref="WechatWorkClient"/> 时的 <see cref="WechatWorkClientOptions.AgentId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int? AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置菜单列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("button")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("button")]
|
||||
public IList<Types.Button> ButtonList { get; set; } = new List<Types.Button>();
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/menu/create 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMenuCreateResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/menu/delete 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMenuDeleteRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。如果不指定将使用构造 <see cref="WechatWorkClient"/> 时的 <see cref="WechatWorkClientOptions.AgentId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int? AgentId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GETs] /cgi-bin/menu/delete 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMenuDeleteResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/menu/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMenuGetRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。如果不指定将使用构造 <see cref="WechatWorkClient"/> 时的 <see cref="WechatWorkClientOptions.AgentId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int? AgentId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/menu/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMenuGetResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Button
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置菜单的响应动作类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置菜单标题。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置菜单 KEY 值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("key")]
|
||||
public string? Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置网页链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string? Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序的 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string? MiniProgramAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序的页面路径。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pagepath")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pagepath")]
|
||||
public string? MiniProgramPagePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子菜单列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_button")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_button")]
|
||||
public Button[]? SubButtonList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置菜单列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("button")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("button")]
|
||||
public Types.Button[] ButtonList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniprogram/transfer_session 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniProgramTransferSessionRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置用户账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置会话密钥。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("session_key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("session_key")]
|
||||
public string SessionKey { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniprogram/transfer_session 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniProgramTransferSessionResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置下级企业的用户账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置下级企业的会话密钥。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("session_key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("session_key")]
|
||||
public string SessionKey { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/tag/create 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinTagCreateRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置标签 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tagid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tagid")]
|
||||
public int? TagId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标签名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tagname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tagname")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/tag/create 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinTagCreateResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置标签 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tagid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tagid")]
|
||||
public int TagId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/tag/delete 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinTagDeleteRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置标签 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int TagId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/tag/delete 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinTagDeleteResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/tag/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinTagGetRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置标签 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int TagId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/tag/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinTagGetResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class User
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标签名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("tagname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("tagname")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标签中包含的成员列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userlist")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userlist")]
|
||||
public Types.User[] UserList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标签中包含的部门 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("partylist")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("partylist")]
|
||||
public int[] DepartmentIdList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/tag/list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinTagListRequest : WechatWorkRequest
|
||||
{
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user