# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import os
import sys
from typing import List
from alibabacloud_dingtalk.notable_1_0.client import Client as dingtalknotable_1_0Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_dingtalk.notable_1_0 import models as dingtalknotable__1__0_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient
class Sample:
def __init__(self):
pass
@staticmethod
def create_client() -> dingtalknotable_1_0Client:
"""
使用 Token 初始化账号Client
@return: Client
@throws Exception
"""
config = open_api_models.Config()
config.protocol = 'https'
config.region_id = 'central'
return dingtalknotable_1_0Client(config)
@staticmethod
def main(
args: List[str],
) -> None:
client = Sample.create_client()
list_records_headers = dingtalknotable__1__0_models.ListRecordsHeaders()
list_records_headers.x_acs_dingtalk_access_token = '<your access token>'
list_records_request = dingtalknotable__1__0_models.ListRecordsRequest(
operator_id='union_id',
max_results=100,
next_token='tuvxxx'
)
try:
client.list_records_with_options('qnYxxx', '数据表', list_records_request, list_records_headers, util_models.RuntimeOptions())
except Exception as err:
if not UtilClient.empty(err.code) and not UtilClient.empty(err.message):
# err 中含有 code 和 message 属性,可帮助开发定位问题
pass
@staticmethod
async def main_async(
args: List[str],
) -> None:
client = Sample.create_client()
list_records_headers = dingtalknotable__1__0_models.ListRecordsHeaders()
list_records_headers.x_acs_dingtalk_access_token = '<your access token>'
list_records_request = dingtalknotable__1__0_models.ListRecordsRequest(
operator_id='union_id',
max_results=100,
next_token='tuvxxx'
)
try:
await client.list_records_with_options_async('qnYxxx', '数据表', list_records_request, list_records_headers, util_models.RuntimeOptions())
except Exception as err:
if not UtilClient.empty(err.code) and not UtilClient.empty(err.message):
# err 中含有 code 和 message 属性,可帮助开发定位问题
pass
if __name__ == '__main__':
Sample.main(sys.argv[1:])