mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-17 10:41:58 +08:00
feat(wxapi): 新增批量代云函数管理相关接口
This commit is contained in:
parent
be5378ab53
commit
035f25d5a9
@ -33,7 +33,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /componenttcb/modifyenv 接口。</para>
|
||||
/// <para>异步调用 [POST] /tcb/modifyenv 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/batch/modifyenv.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
@ -46,7 +46,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "componenttcb", "modifyenv")
|
||||
.CreateRequest(request, HttpMethod.Post, "tcb", "modifyenv")
|
||||
.SetQueryParam("access_token", request.ComponentAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ComponentTcbModifyEnvironmentResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
@ -112,5 +112,170 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendRequestWithJsonAsync<Models.ComponentTcbBatchGetEnvironmentIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SCF
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /componenttcb/batchuploadscf 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/batch/batchuploadscf.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ComponentTcbBatchUploadSCFResponse> ExecuteComponentTcbBatchUploadSCFAsync(this WechatApiClient client, Models.ComponentTcbBatchUploadSCFRequest 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, "componenttcb", "batchuploadscf")
|
||||
.SetQueryParam("access_token", request.ComponentAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ComponentTcbBatchUploadSCFResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /componenttcb/batchuploadscfcode 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/batch/batchUploadSCFCode.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ComponentTcbBatchUploadSCFCodeResponse> ExecuteComponentTcbBatchUploadSCFCodeAsync(this WechatApiClient client, Models.ComponentTcbBatchUploadSCFCodeRequest 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, "componenttcb", "batchuploadscfcode")
|
||||
.SetQueryParam("access_token", request.ComponentAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ComponentTcbBatchUploadSCFCodeResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /componenttcb/updatescfconfig 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/batch/updatescfconfig.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ComponentTcbUploadSCFConfigResponse> ExecuteComponentTcbUploadSCFConfigAsync(this WechatApiClient client, Models.ComponentTcbUploadSCFConfigRequest 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, "componenttcb", "updatescfconfig")
|
||||
.SetQueryParam("access_token", request.ComponentAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ComponentTcbUploadSCFConfigResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /componenttcb/deletescf 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/batch/deletescf.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ComponentTcbDeleteSCFConfigResponse> ExecuteComponentTcbDeleteSCFConfigAsync(this WechatApiClient client, Models.ComponentTcbDeleteSCFConfigRequest 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, "componenttcb", "deletescf")
|
||||
.SetQueryParam("access_token", request.ComponentAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ComponentTcbDeleteSCFConfigResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /componenttcb/getscflist 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/batch/getscflist.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ComponentTcbGetSCFListResponse> ExecuteComponentTcbGetSCFListAsync(this WechatApiClient client, Models.ComponentTcbGetSCFListRequest 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, "componenttcb", "getscflist")
|
||||
.SetQueryParam("access_token", request.ComponentAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ComponentTcbGetSCFListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /componenttcb/gettriggers 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/batch/getTriggers.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ComponentTcbGetTriggersResponse> ExecuteComponentTcbGetTriggersAsync(this WechatApiClient client, Models.ComponentTcbGetTriggersRequest 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, "componenttcb", "gettriggers")
|
||||
.SetQueryParam("access_token", request.ComponentAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ComponentTcbGetTriggersResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /componenttcb/batchupdatetriggers 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/cloudbase/batch/batchupdatetriggers.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ComponentTcbBatchUpdateTriggersResponse> ExecuteComponentTcbBatchUpdateTriggersAsync(this WechatApiClient client, Models.ComponentTcbBatchUpdateTriggersRequest 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, "componenttcb", "batchupdatetriggers")
|
||||
.SetQueryParam("access_token", request.ComponentAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ComponentTcbBatchUpdateTriggersResponse>(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/batch/batchupdatetriggers.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ComponentTcbInvokeCloudFunctionResponse> ExecuteComponentTcbInvokeCloudFunctionAsync(this WechatApiClient client, Models.ComponentTcbInvokeCloudFunctionRequest 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.ComponentAccessToken)
|
||||
.SetQueryParam("env", request.EnvironmentId)
|
||||
.SetQueryParam("name", request.FunctionName);
|
||||
|
||||
using var httpContent = new StringContent(request.Data ?? string.Empty, Encoding.UTF8);
|
||||
return await client.SendRequestAsync<Models.ComponentTcbInvokeCloudFunctionResponse>(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/modifyenv 接口的请求。</para>
|
||||
/// <para>表示 [POST] /tcb/modifyenv 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbModifyEnvironmentRequest : WechatApiRequest
|
||||
{
|
||||
|
@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/modifyenv 接口的响应。</para>
|
||||
/// <para>表示 [POST] /tcb/modifyenv 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbModifyEnvironmentResponse : WechatApiResponse
|
||||
{
|
||||
|
@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/batchupdatetriggers 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbBatchUpdateTriggersRequest : 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>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ComponentAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置函数名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("funcname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("funcname")]
|
||||
public string FunctionName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置环境 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("envs")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("envs")]
|
||||
public IList<string> EnvironmentIdList { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置触发器信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("triggers")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("triggers")]
|
||||
public IList<Types.Trigger> Trigger { get; set; } = new List<Types.Trigger>();
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/batchupdatetriggers 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbBatchUpdateTriggersResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Failure : ComponentTcbBatchUploadSCFResponse.Types.Failure
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置失败项列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("err_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("err_list")]
|
||||
public Types.Failure[]? FailureList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/batchuploadscfcode 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbBatchUploadSCFCodeRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方平台 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ComponentAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置函数名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("functionname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("functionname")]
|
||||
public string FunctionName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置环境 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("envs")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("envs")]
|
||||
public IList<string> EnvironmentIdList { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置包含函数代码文件的 zip 格式文件(需经过 Base64 编码)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("zipfile")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("zipfile")]
|
||||
public string EncodingZipFile { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/batchuploadscfcode 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbBatchUploadSCFCodeResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Failure : ComponentTcbBatchUploadSCFResponse.Types.Failure
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置失败项列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fail_env_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fail_env_list")]
|
||||
public Types.Failure[]? FailureList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/batchuploadscf 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbBatchUploadSCFRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方平台 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ComponentAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置函数名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("functionname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("functionname")]
|
||||
public string FunctionName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置环境 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("envs")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("envs")]
|
||||
public IList<string> EnvironmentIdList { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置包含函数代码文件的 zip 格式文件(需经过 Base64 编码)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("zipfile")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("zipfile")]
|
||||
public string EncodingZipFile { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 VPC 唯一标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("vpcid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("vpcid")]
|
||||
public string? VPCId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子网 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("subnetid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("subnetid")]
|
||||
public string? SubnetId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/batchuploadscf 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbBatchUploadSCFResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Failure
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置环境 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("env")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("env")]
|
||||
public string EnvironmentId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errmsg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errmsg")]
|
||||
public string? ErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置失败项列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fail_env_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fail_env_list")]
|
||||
public Types.Failure[]? FailureList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/deletescf 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbDeleteSCFConfigRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方平台 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ComponentAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <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("functionname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("functionname")]
|
||||
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] /componenttcb/deletescf 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbDeleteSCFConfigResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/getscflist 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbGetSCFListRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方平台 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ComponentAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <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; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置搜索关键词。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("searchkey")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("searchkey")]
|
||||
public string? SearchKey { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/getscflist 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbGetSCFListResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Function
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class StatusReason
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置错误码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errcode")]
|
||||
public string ErrorCode { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errmsg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errmsg")]
|
||||
public string ErrorMessage { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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("status_reason")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status_reason")]
|
||||
public Types.StatusReason[] StatusReasonList { 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; } = default!;
|
||||
|
||||
/// <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; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/gettriggers 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbGetTriggersRequest : WechatApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方平台 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ComponentAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <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("funcname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("funcname")]
|
||||
public string FunctionName { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/gettriggers 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbGetTriggersResponse : WechatApiResponse
|
||||
{
|
||||
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; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置触发器触发周期。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config")]
|
||||
public string Config { 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("triggers")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("triggers")]
|
||||
public Types.Trigger[] TriggerList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /tcb/invokecloudfunction 接口的请求。</para>
|
||||
/// </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>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ComponentAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <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 ComponentTcbInvokeCloudFunctionResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置函数返回结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("resp_data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("resp_data")]
|
||||
public string? Data { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/updatescfconfig 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbUploadSCFConfigRequest : WechatApiRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class EnvironmentVariable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置键。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("key")]
|
||||
public string Key { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("value")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("value")]
|
||||
public string Value { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class PublicNetConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或公网访问状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("public_net_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("public_net_status")]
|
||||
public string PublicNetStatus { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或 EIP 状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("eip_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("eip_status")]
|
||||
public string EIPStatus { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class VPCConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 VPC 唯一标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("vpcid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("vpcid")]
|
||||
public string VPCId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子网 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("subnetid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("subnetid")]
|
||||
public string SubnetId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置第三方平台 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ComponentAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <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("functionname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("functionname")]
|
||||
public string FunctionName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置内存大小(单位:MB)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("memorysize")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("memorysize")]
|
||||
public int? FunctionMemorySize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置超时时间(单位:秒))。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("timeout")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("timeout")]
|
||||
public int? FunctionTimeout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置环境变量列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("environment_variables")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("environment_variables")]
|
||||
public List<Types.EnvironmentVariable>? EnvironmentVariableList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公网访问配置信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("public_net_config")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("public_net_config")]
|
||||
public Types.PublicNetConfig? PublicNetConfig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置私有网络配置信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("vpc_config")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("vpc_config")]
|
||||
public Types.VPCConfig? VPCConfig { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /componenttcb/updatescfconfig 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ComponentTcbUploadSCFConfigResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user