mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-18 17:48:12 +08:00
feat(wxapi): 新增普通代云开发云函数管理相关接口
This commit is contained in:
@@ -606,6 +606,169 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.TcbUploadFileResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /tcb/createfunction 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/common/createFunction.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.TcbCreateFunctionResponse> ExecuteTcbCreateFunctionAsync(this WechatApiClient client, Models.TcbCreateFunctionRequest 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, "tcb", "createfunction")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.TcbCreateFunctionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /tcb/getcodesecret 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/common/getCodeSecret.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.TcbGetCodeSecretResponse> ExecuteTcbGetCodeSecretAsync(this WechatApiClient client, Models.TcbGetCodeSecretRequest 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, "tcb", "getcodesecret")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.TcbGetCodeSecretResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /tcb/getuploadsignature 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/common/getUploadSignature.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.TcbGetUploadSignatureResponse> ExecuteTcbGetUploadSignatureAsync(this WechatApiClient client, Models.TcbGetUploadSignatureRequest 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, "tcb", "getuploadsignature")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.TcbGetUploadSignatureResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /tcb/listfunctions 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/common/listFunctions.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.TcbListFunctionsResponse> ExecuteTcbListFunctionsAsync(this WechatApiClient client, Models.TcbListFunctionsRequest 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, "tcb", "listfunctions")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.TcbListFunctionsResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /tcb/downloadfunction 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/common/downloadFunction.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.TcbDownloadFunctionResponse> ExecuteTcbDownloadFunctionAsync(this WechatApiClient client, Models.TcbDownloadFunctionRequest 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, "tcb", "downloadfunction")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.TcbDownloadFunctionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /tcb/uploadfuncconfig 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/common/uploadFuncConfig.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.TcbUploadFunctionConfigResponse> ExecuteTcbUploadFunctionConfigAsync(this WechatApiClient client, Models.TcbUploadFunctionConfigRequest 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, "tcb", "uploadfuncconfig")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.TcbUploadFunctionConfigResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /tcb/getfuncconfig 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/common/getFuncConfig.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.TcbGetFunctionConfigResponse> ExecuteTcbGetFunctionConfigAsync(this WechatApiClient client, Models.TcbGetFunctionConfigRequest 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, "tcb", "getfuncconfig")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.TcbGetFunctionConfigResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /tcb/invokecloudfunction 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/common/invokecloudfunction.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.TcbInvokeCloudFunctionResponse> ExecuteTcbInvokeCloudFunctionAsync(this WechatApiClient client, Models.TcbInvokeCloudFunctionRequest 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, "tcb", "invokecloudfunction")
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("env", request.EnvironmentId)
|
||||
.SetQueryParam("name", request.FunctionName);
|
||||
|
||||
using var httpContent = new StringContent(request.Data ?? string.Empty, Encoding.UTF8);
|
||||
return await client.SendRequestAsync<Models.TcbInvokeCloudFunctionResponse>(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@@ -8,33 +8,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
/// </summary>
|
||||
public class ComponentTcbInvokeCloudFunctionRequest : WechatApiRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Trigger
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置触发器名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trigger_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trigger_name")]
|
||||
public string TriggerName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置触发器触发周期。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config")]
|
||||
public string Config { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置触发器类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置第三方平台 AccessToken。
|
||||
/// </summary>
|
||||
|
@@ -91,7 +91,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
public int? FunctionMemorySize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置超时时间(单位:秒))。
|
||||
/// 获取或设置超时时间(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("timeout")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("timeout")]
|
||||
|
@@ -21,7 +21,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
public class ConditionFreeDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置最低金额(单位:分))。
|
||||
/// 获取或设置最低金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("min_free_price")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("min_free_price")]
|
||||
@@ -31,7 +31,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
public class TieredBillingDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置最低起送金额(单位:分))。
|
||||
/// 获取或设置最低起送金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("min_send_price")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("min_send_price")]
|
||||
|
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/createfunction 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class TcbCreateFunctionRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置环境 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("env")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("env")]
|
||||
public string EnvironmentId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置云函数名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("function_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("function_name")]
|
||||
public string FunctionName { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/createfunction 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class TcbCreateFunctionResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/downloadfunction 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class TcbDownloadFunctionRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置环境 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("env")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("env")]
|
||||
public string EnvironmentId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置云函数名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("function_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("function_name")]
|
||||
public string FunctionName { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/downloadfunction 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class TcbDownloadFunctionResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置下载地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string DownloadUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置校验码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("checksum")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("checksum")]
|
||||
public string Checksum { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/getcodesecret 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class TcbGetCodeSecretRequest : WechatApiRequest
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/getcodesecret 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class TcbGetCodeSecretResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置代码保护密钥。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("codesecret")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("codesecret")]
|
||||
public string CodeSecret { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/getfuncconfig 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class TcbGetFunctionConfigRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置环境 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("env")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("env")]
|
||||
public string EnvironmentId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置函数名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("function_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("function_name")]
|
||||
public string FunctionName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置配置类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/getfuncconfig 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class TcbGetFunctionConfigResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 JSON 格式的配置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config")]
|
||||
public string JsonConfig { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/getuploadsignature 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class TcbGetUploadSignatureRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置请求数据的签名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hashed_payload")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hashed_payload")]
|
||||
public string HashedPayload { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/getuploadsignature 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class TcbGetUploadSignatureResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置带签名标头。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("headers")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("headers")]
|
||||
public string Headers { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/invokecloudfunction 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class TcbInvokeCloudFunctionRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置环境 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string EnvironmentId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置函数名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string FunctionName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置函数传入参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? Data { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/invokecloudfunction 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class TcbInvokeCloudFunctionResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置函数返回结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("resp_data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("resp_data")]
|
||||
public string? Data { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/listfunctions 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class TcbListFunctionsRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置环境 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("env")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("env")]
|
||||
public string EnvironmentId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页起始位置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("offset")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("offset")]
|
||||
public int? Offset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/listfunctions 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class TcbListFunctionsResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Function
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置函数名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string FunctionName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置运行时。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("runtime")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("runtime")]
|
||||
public string Runtime { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置函数状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public string Status { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置修改时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mod_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mod_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置创建时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("add_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("add_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置云函数列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("functions")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("functions")]
|
||||
public Types.Function[] FunctionList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置云函数总数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total_count")]
|
||||
public int TotalCount { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/uploadfuncconfig 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class TcbUploadFunctionConfigRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置环境 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("env")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("env")]
|
||||
public string EnvironmentId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置函数名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("function_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("function_name")]
|
||||
public string FunctionName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置配置类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 JSON 格式的配置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config")]
|
||||
public string JsonConfig { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/uploadfuncconfig 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class TcbUploadFunctionConfigResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user