// This file is auto-generated, don't edit it. Thanks.
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Tea;
using Tea.Utils;
namespace AlibabaCloud.SDK.Sample
{
public class Sample
{
/// <term><b>Description:</b></term>
/// <description>
/// <para>Initialize the account Client using a Token</para>
/// </description>
///
/// <returns>
/// Client
/// </returns>
///
/// <term><b>Exception:</b></term>
/// Exception
public static AlibabaCloud.SDK.Dingtalknotable_1_0.Client CreateClient()
{
AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config();
config.Protocol = "https";
config.RegionId = "central";
return new AlibabaCloud.SDK.Dingtalknotable_1_0.Client(config);
}
public static void Main(string[] args)
{
AlibabaCloud.SDK.Dingtalknotable_1_0.Client client = CreateClient();
AlibabaCloud.SDK.Dingtalknotable_1_0.Models.CreateFieldHeaders createFieldHeaders = new AlibabaCloud.SDK.Dingtalknotable_1_0.Models.CreateFieldHeaders();
createFieldHeaders.XAcsDingtalkAccessToken = "<your access token>";
Dictionary<string, Dictionary<string, object>> property = new Dictionary<string, Dictionary<string, object>>
{
{"key", new Dictionary<string, object>(){}},
};
AlibabaCloud.SDK.Dingtalknotable_1_0.Models.CreateFieldRequest createFieldRequest = new AlibabaCloud.SDK.Dingtalknotable_1_0.Models.CreateFieldRequest
{
OperatorId = "xxxxx",
Name = "Name",
Property = property,
Type = "text",
};
try
{
client.CreateFieldWithOptions("xxxxx", "Table", createFieldRequest, createFieldHeaders, new AlibabaCloud.TeaUtil.Models.RuntimeOptions());
}
catch (TeaException err)
{
if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
{
// err contains the code and message attributes, which help locate the issue
}
}
catch (Exception _err)
{
TeaException err = new TeaException(new Dictionary<string, object>
{
{ "message", _err.Message }
});
if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
{
// err contains the code and message attributes, which help locate the issue
}
}
}
}
}