/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
namespace TencentCloud.Tbaas.V20180416.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class InvokeRequest : AbstractModel
{
///
/// 模块名,固定字段:transaction
///
[JsonProperty("Module")]
public string Module{ get; set; }
///
/// 操作名,固定字段:invoke
///
[JsonProperty("Operation")]
public string Operation{ get; set; }
///
/// 区块链网络ID,可在区块链网络详情或列表中获取
///
[JsonProperty("ClusterId")]
public string ClusterId{ get; set; }
///
/// 业务所属智能合约名称,可在智能合约详情或列表中获取
///
[JsonProperty("ChaincodeName")]
public string ChaincodeName{ get; set; }
///
/// 业务所属通道名称,可在通道详情或列表中获取
///
[JsonProperty("ChannelName")]
public string ChannelName{ get; set; }
///
/// 对该笔交易进行背书的节点列表(包括节点名称和节点所属组织名称,详见数据结构一节),可以在通道详情中获取该通道上的节点名称极其所属组织名称
///
[JsonProperty("Peers")]
public PeerSet[] Peers{ get; set; }
///
/// 该笔交易需要调用的智能合约中的函数名称
///
[JsonProperty("FuncName")]
public string FuncName{ get; set; }
///
/// 调用合约的组织名称,可以在组织管理列表中获取当前组织的名称
///
[JsonProperty("GroupName")]
public string GroupName{ get; set; }
///
/// 被调用的函数参数列表
///
[JsonProperty("Args")]
public string[] Args{ get; set; }
///
/// 同步调用标识,可选参数,值为0或者不传表示使用同步方法调用,调用后会等待交易执行后再返回执行结果;值为1时表示使用异步方式调用Invoke,执行后会立即返回交易对应的Txid,后续需要通过GetInvokeTx这个API查询该交易的执行结果。(对于逻辑较为简单的交易,可以使用同步模式;对于逻辑较为复杂的交易,建议使用异步模式,否则容易导致API因等待时间过长,返回等待超时)
///
[JsonProperty("AsyncFlag")]
public ulong? AsyncFlag{ get; set; }
///
/// For internal usage only. DO NOT USE IT.
///
internal override void ToMap(Dictionary map, string prefix)
{
this.SetParamSimple(map, prefix + "Module", this.Module);
this.SetParamSimple(map, prefix + "Operation", this.Operation);
this.SetParamSimple(map, prefix + "ClusterId", this.ClusterId);
this.SetParamSimple(map, prefix + "ChaincodeName", this.ChaincodeName);
this.SetParamSimple(map, prefix + "ChannelName", this.ChannelName);
this.SetParamArrayObj(map, prefix + "Peers.", this.Peers);
this.SetParamSimple(map, prefix + "FuncName", this.FuncName);
this.SetParamSimple(map, prefix + "GroupName", this.GroupName);
this.SetParamArraySimple(map, prefix + "Args.", this.Args);
this.SetParamSimple(map, prefix + "AsyncFlag", this.AsyncFlag);
}
}
}