|
|
|
|
@@ -9,109 +9,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
|
|
|
|
{
|
|
|
|
|
public static class WechatWorkClientExecuteCgibinCorpGroupExtensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/list_app_share_info 接口。</para>
|
|
|
|
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93403 </para>
|
|
|
|
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93405 </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.ParentAgentId == null)
|
|
|
|
|
request.ParentAgentId = client.Credentials.AgentId;
|
|
|
|
|
|
|
|
|
|
IFlurlRequest flurlReq = client
|
|
|
|
|
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "corpgroup", "corp", "list_app_share_info")
|
|
|
|
|
.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://developer.work.weixin.qq.com/document/path/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(request, HttpMethod.Post, "cgi-bin", "corpgroup", "corp", "gettoken")
|
|
|
|
|
.SetQueryParam("access_token", request.AccessToken);
|
|
|
|
|
|
|
|
|
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCropGetTokenResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>异步调用 [GET] /cgi-bin/corpgroup/corp/get_chain_list 接口。</para>
|
|
|
|
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95315 </para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="client"></param>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<Models.CgibinCorpGroupCropGetChainListResponse> ExecuteCgibinCorpGroupCropGetChainListAsync(this WechatWorkClient client, Models.CgibinCorpGroupCropGetChainListRequest request, CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
if (client is null) throw new ArgumentNullException(nameof(client));
|
|
|
|
|
if (request is null) throw new ArgumentNullException(nameof(request));
|
|
|
|
|
|
|
|
|
|
IFlurlRequest flurlReq = client
|
|
|
|
|
.CreateRequest(request, HttpMethod.Get, "cgi-bin", "corpgroup", "corp", "get_chain_list")
|
|
|
|
|
.SetQueryParam("access_token", request.AccessToken);
|
|
|
|
|
|
|
|
|
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCropGetChainListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/get_chain_group 接口。</para>
|
|
|
|
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95315 </para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="client"></param>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<Models.CgibinCorpGroupCropGetChainGroupResponse> ExecuteCgibinCorpGroupCropGetChainGroupAsync(this WechatWorkClient client, Models.CgibinCorpGroupCropGetChainGroupRequest request, CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
if (client is null) throw new ArgumentNullException(nameof(client));
|
|
|
|
|
if (request is null) throw new ArgumentNullException(nameof(request));
|
|
|
|
|
|
|
|
|
|
IFlurlRequest flurlReq = client
|
|
|
|
|
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "corpgroup", "corp", "get_chain_group")
|
|
|
|
|
.SetQueryParam("access_token", request.AccessToken);
|
|
|
|
|
|
|
|
|
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCropGetChainGroupResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/get_chain_corpinfo_list 接口。</para>
|
|
|
|
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95315 </para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="client"></param>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<Models.CgibinCorpGroupCropGetChainCorpInfoListResponse> ExecuteCgibinCorpGroupCropGetChainCorpInfoListAsync(this WechatWorkClient client, Models.CgibinCorpGroupCropGetChainCorpInfoListRequest request, CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
if (client is null) throw new ArgumentNullException(nameof(client));
|
|
|
|
|
if (request is null) throw new ArgumentNullException(nameof(request));
|
|
|
|
|
|
|
|
|
|
IFlurlRequest flurlReq = client
|
|
|
|
|
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "corpgroup", "corp", "get_chain_corpinfo_list")
|
|
|
|
|
.SetQueryParam("access_token", request.AccessToken);
|
|
|
|
|
|
|
|
|
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCropGetChainCorpInfoListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>异步调用 [POST] /cgi-bin/corpgroup/unionid_to_external_userid 接口。</para>
|
|
|
|
|
@@ -132,6 +29,112 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
|
|
|
|
|
|
|
|
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupUnionidToExternalUserIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region Corp
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/list_app_share_info 接口。</para>
|
|
|
|
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93403 </para>
|
|
|
|
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93405 </para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="client"></param>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<Models.CgibinCorpGroupCorpListAppShareInfoResponse> ExecuteCgibinCorpGroupCorpListAppShareInfoAsync(this WechatWorkClient client, Models.CgibinCorpGroupCorpListAppShareInfoRequest request, CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
if (client is null) throw new ArgumentNullException(nameof(client));
|
|
|
|
|
if (request is null) throw new ArgumentNullException(nameof(request));
|
|
|
|
|
|
|
|
|
|
if (request.ParentAgentId == null)
|
|
|
|
|
request.ParentAgentId = client.Credentials.AgentId;
|
|
|
|
|
|
|
|
|
|
IFlurlRequest flurlReq = client
|
|
|
|
|
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "corpgroup", "corp", "list_app_share_info")
|
|
|
|
|
.SetQueryParam("access_token", request.AccessToken);
|
|
|
|
|
|
|
|
|
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCorpListAppShareInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/gettoken 接口。</para>
|
|
|
|
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93359 </para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="client"></param>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<Models.CgibinCorpGroupCorpGetTokenResponse> ExecuteCgibinCorpGroupCorpGetTokenAsync(this WechatWorkClient client, Models.CgibinCorpGroupCorpGetTokenRequest request, CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
if (client is null) throw new ArgumentNullException(nameof(client));
|
|
|
|
|
if (request is null) throw new ArgumentNullException(nameof(request));
|
|
|
|
|
|
|
|
|
|
IFlurlRequest flurlReq = client
|
|
|
|
|
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "corpgroup", "corp", "gettoken")
|
|
|
|
|
.SetQueryParam("access_token", request.AccessToken);
|
|
|
|
|
|
|
|
|
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCorpGetTokenResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>异步调用 [GET] /cgi-bin/corpgroup/corp/get_chain_list 接口。</para>
|
|
|
|
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95315 </para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="client"></param>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<Models.CgibinCorpGroupCorpGetChainListResponse> ExecuteCgibinCorpGroupCorpGetChainListAsync(this WechatWorkClient client, Models.CgibinCorpGroupCorpGetChainListRequest request, CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
if (client is null) throw new ArgumentNullException(nameof(client));
|
|
|
|
|
if (request is null) throw new ArgumentNullException(nameof(request));
|
|
|
|
|
|
|
|
|
|
IFlurlRequest flurlReq = client
|
|
|
|
|
.CreateRequest(request, HttpMethod.Get, "cgi-bin", "corpgroup", "corp", "get_chain_list")
|
|
|
|
|
.SetQueryParam("access_token", request.AccessToken);
|
|
|
|
|
|
|
|
|
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCorpGetChainListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/get_chain_group 接口。</para>
|
|
|
|
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95315 </para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="client"></param>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<Models.CgibinCorpGroupCorpGetChainGroupResponse> ExecuteCgibinCorpGroupCorpGetChainGroupAsync(this WechatWorkClient client, Models.CgibinCorpGroupCorpGetChainGroupRequest request, CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
if (client is null) throw new ArgumentNullException(nameof(client));
|
|
|
|
|
if (request is null) throw new ArgumentNullException(nameof(request));
|
|
|
|
|
|
|
|
|
|
IFlurlRequest flurlReq = client
|
|
|
|
|
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "corpgroup", "corp", "get_chain_group")
|
|
|
|
|
.SetQueryParam("access_token", request.AccessToken);
|
|
|
|
|
|
|
|
|
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCorpGetChainGroupResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>异步调用 [POST] /cgi-bin/corpgroup/corp/get_chain_corpinfo_list 接口。</para>
|
|
|
|
|
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95315 </para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="client"></param>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<Models.CgibinCorpGroupCorpGetChainCorpInfoListResponse> ExecuteCgibinCorpGroupCorpGetChainCorpInfoListAsync(this WechatWorkClient client, Models.CgibinCorpGroupCorpGetChainCorpInfoListRequest request, CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
if (client is null) throw new ArgumentNullException(nameof(client));
|
|
|
|
|
if (request is null) throw new ArgumentNullException(nameof(request));
|
|
|
|
|
|
|
|
|
|
IFlurlRequest flurlReq = client
|
|
|
|
|
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "corpgroup", "corp", "get_chain_corpinfo_list")
|
|
|
|
|
.SetQueryParam("access_token", request.AccessToken);
|
|
|
|
|
|
|
|
|
|
return await client.SendRequestWithJsonAsync<Models.CgibinCorpGroupCorpGetChainCorpInfoListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Rule
|
|
|
|
|
/// <summary>
|
|
|
|
|
|