mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
faet(work): 新增管理应用邮箱帐号相关接口
This commit is contained in:
parent
f48717ad64
commit
59c299619e
@ -71,6 +71,46 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExmailAppReadMailResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/exmail/app/update_email_alias 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97503 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExmailAppUpdateEmailAliasResponse> ExecuteCgibinExmailAppUpdateEmailAliasAsync(this WechatWorkClient client, Models.CgibinExmailAppUpdateEmailAliasRequest 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", "exmail", "app", "update_email_alias")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExmailAppUpdateEmailAliasResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/exmail/app/get_email_alias 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97992 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExmailAppGetEmailAliasResponse> ExecuteCgibinExmailAppGetEmailAliasAsync(this WechatWorkClient client, Models.CgibinExmailAppGetEmailAliasRequest 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", "exmail", "app", "get_email_alias")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExmailAppGetEmailAliasResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Group
|
||||
@ -96,7 +136,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/exmail/group/update 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97995 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@ -116,7 +156,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/exmail/group/delete 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97996 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@ -136,7 +176,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/exmail/group/search 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97998 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@ -160,7 +200,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/exmail/group/get 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97997 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@ -203,7 +243,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/exmail/publicmail/update 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95511 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98000 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@ -223,7 +263,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/exmail/publicmail/delete 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95511 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98001 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@ -243,7 +283,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/exmail/publicmail/search 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98003 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@ -267,7 +307,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/exmail/publicmail/get 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95510 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98002 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@ -331,7 +371,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/exmail/useroption/update 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95513 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98008 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/exmail/app/get_email_alias 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExmailAppGetEmailAliasRequest : WechatWorkRequest
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/exmail/app/get_email_alias 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExmailAppGetEmailAliasResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用邮箱帐号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("email")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("email")]
|
||||
public string Email { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置别名邮箱地址列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("alias_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("alias_list")]
|
||||
public string[] AliasList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/exmail/app/update_email_alias 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExmailAppUpdateEmailAliasRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置新的应用邮箱帐号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("new_email")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("new_email")]
|
||||
public string NewEmail { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/exmail/app/update_email_alias 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExmailAppUpdateEmailAliasResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"email": "youxiangceshi@ceshi.wecom.work",
|
||||
"alias_list": ["youxiang1@ceshi.wecom.work", "youxiang2@ceshi.wecom.work"]
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"new_email": "youxiangceshi@ceshi.wecom.work"
|
||||
}
|
Loading…
Reference in New Issue
Block a user