"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateSheetResponse = exports.UpdateSheetResponseBody = exports.UpdateSheetRequest = exports.UpdateSheetHeaders = exports.UpdateRecordsResponse = exports.UpdateRecordsResponseBody = exports.UpdateRecordsRequest = exports.UpdateRecordsHeaders = exports.UpdateFieldResponse = exports.UpdateFieldResponseBody = exports.UpdateFieldRequest = exports.UpdateFieldHeaders = exports.InsertRecordsResponse = exports.InsertRecordsResponseBody = exports.InsertRecordsRequest = exports.InsertRecordsHeaders = exports.GetSheetResponse = exports.GetSheetResponseBody = exports.GetSheetHeaders = exports.GetRecordsResponse = exports.GetRecordsResponseBody = exports.GetRecordsRequest = exports.GetRecordsHeaders = exports.GetRecordResponse = exports.GetRecordResponseBody = exports.GetRecordHeaders = exports.GetAllSheetsResponse = exports.GetAllSheetsResponseBody = exports.GetAllSheetsHeaders = exports.GetAllFieldsResponse = exports.GetAllFieldsResponseBody = exports.GetAllFieldsHeaders = exports.DeleteSheetResponse = exports.DeleteSheetResponseBody = exports.DeleteSheetHeaders = exports.DeleteRecordsResponse = exports.DeleteRecordsResponseBody = exports.DeleteRecordsRequest = exports.DeleteRecordsHeaders = exports.DeleteFieldResponse = exports.DeleteFieldResponseBody = exports.DeleteFieldHeaders = exports.CreateSheetResponse = exports.CreateSheetResponseBody = exports.CreateSheetRequest = exports.CreateSheetHeaders = exports.CreateFieldResponse = exports.CreateFieldResponseBody = exports.CreateFieldRequest = exports.CreateFieldHeaders = void 0;
exports.UpdateRecordsResponseBodyValue = exports.UpdateRecordsRequestRecords = exports.InsertRecordsResponseBodyValue = exports.InsertRecordsRequestRecords = exports.GetRecordsResponseBodyRecords = exports.GetAllSheetsResponseBodyValue = exports.GetAllFieldsResponseBodyValue = exports.CreateSheetRequestFields = void 0;
// This file is auto-generated, don't edit it
/**
 */
const tea_util_1 = __importStar(require("@alicloud/tea-util")), $Util = tea_util_1;
const gateway_dingtalk_1 = __importDefault(require("@alicloud/gateway-dingtalk"));
const openapi_client_1 = __importStar(require("@alicloud/openapi-client")), $OpenApi = openapi_client_1;
const openapi_util_1 = __importDefault(require("@alicloud/openapi-util"));
const $tea = __importStar(require("@alicloud/tea-typescript"));
class CreateFieldHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateFieldHeaders = CreateFieldHeaders;
class CreateFieldRequest extends $tea.Model {
    static names() {
        return {
            name: 'name',
            property: 'property',
            type: 'type',
        };
    }
    static types() {
        return {
            name: 'string',
            property: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
            type: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateFieldRequest = CreateFieldRequest;
class CreateFieldResponseBody extends $tea.Model {
    static names() {
        return {
            id: 'id',
            name: 'name',
            property: 'property',
            type: 'type',
        };
    }
    static types() {
        return {
            id: 'string',
            name: 'string',
            property: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
            type: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateFieldResponseBody = CreateFieldResponseBody;
class CreateFieldResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: CreateFieldResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateFieldResponse = CreateFieldResponse;
class CreateSheetHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateSheetHeaders = CreateSheetHeaders;
class CreateSheetRequest extends $tea.Model {
    static names() {
        return {
            fields: 'fields',
            name: 'name',
        };
    }
    static types() {
        return {
            fields: { 'type': 'array', 'itemType': CreateSheetRequestFields },
            name: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateSheetRequest = CreateSheetRequest;
class CreateSheetResponseBody extends $tea.Model {
    static names() {
        return {
            id: 'id',
            name: 'name',
        };
    }
    static types() {
        return {
            id: 'string',
            name: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateSheetResponseBody = CreateSheetResponseBody;
class CreateSheetResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: CreateSheetResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateSheetResponse = CreateSheetResponse;
class DeleteFieldHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteFieldHeaders = DeleteFieldHeaders;
class DeleteFieldResponseBody extends $tea.Model {
    static names() {
        return {
            success: 'success',
        };
    }
    static types() {
        return {
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteFieldResponseBody = DeleteFieldResponseBody;
class DeleteFieldResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: DeleteFieldResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteFieldResponse = DeleteFieldResponse;
class DeleteRecordsHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteRecordsHeaders = DeleteRecordsHeaders;
class DeleteRecordsRequest extends $tea.Model {
    static names() {
        return {
            recordIds: 'recordIds',
        };
    }
    static types() {
        return {
            recordIds: { 'type': 'array', 'itemType': 'string' },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteRecordsRequest = DeleteRecordsRequest;
class DeleteRecordsResponseBody extends $tea.Model {
    static names() {
        return {
            success: 'success',
        };
    }
    static types() {
        return {
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteRecordsResponseBody = DeleteRecordsResponseBody;
class DeleteRecordsResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: DeleteRecordsResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteRecordsResponse = DeleteRecordsResponse;
class DeleteSheetHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteSheetHeaders = DeleteSheetHeaders;
class DeleteSheetResponseBody extends $tea.Model {
    static names() {
        return {
            success: 'success',
        };
    }
    static types() {
        return {
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteSheetResponseBody = DeleteSheetResponseBody;
class DeleteSheetResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: DeleteSheetResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteSheetResponse = DeleteSheetResponse;
class GetAllFieldsHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetAllFieldsHeaders = GetAllFieldsHeaders;
class GetAllFieldsResponseBody extends $tea.Model {
    static names() {
        return {
            value: 'value',
        };
    }
    static types() {
        return {
            value: { 'type': 'array', 'itemType': GetAllFieldsResponseBodyValue },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetAllFieldsResponseBody = GetAllFieldsResponseBody;
class GetAllFieldsResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: GetAllFieldsResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetAllFieldsResponse = GetAllFieldsResponse;
class GetAllSheetsHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetAllSheetsHeaders = GetAllSheetsHeaders;
class GetAllSheetsResponseBody extends $tea.Model {
    static names() {
        return {
            value: 'value',
        };
    }
    static types() {
        return {
            value: { 'type': 'array', 'itemType': GetAllSheetsResponseBodyValue },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetAllSheetsResponseBody = GetAllSheetsResponseBody;
class GetAllSheetsResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: GetAllSheetsResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetAllSheetsResponse = GetAllSheetsResponse;
class GetRecordHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetRecordHeaders = GetRecordHeaders;
class GetRecordResponseBody extends $tea.Model {
    static names() {
        return {
            fields: 'fields',
            id: 'id',
        };
    }
    static types() {
        return {
            fields: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
            id: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetRecordResponseBody = GetRecordResponseBody;
class GetRecordResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: GetRecordResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetRecordResponse = GetRecordResponse;
class GetRecordsHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetRecordsHeaders = GetRecordsHeaders;
class GetRecordsRequest extends $tea.Model {
    static names() {
        return {
            maxResults: 'maxResults',
            nextToken: 'nextToken',
        };
    }
    static types() {
        return {
            maxResults: 'number',
            nextToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetRecordsRequest = GetRecordsRequest;
class GetRecordsResponseBody extends $tea.Model {
    static names() {
        return {
            hasMore: 'hasMore',
            nextToken: 'nextToken',
            records: 'records',
        };
    }
    static types() {
        return {
            hasMore: 'boolean',
            nextToken: 'string',
            records: { 'type': 'array', 'itemType': GetRecordsResponseBodyRecords },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetRecordsResponseBody = GetRecordsResponseBody;
class GetRecordsResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: GetRecordsResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetRecordsResponse = GetRecordsResponse;
class GetSheetHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetSheetHeaders = GetSheetHeaders;
class GetSheetResponseBody extends $tea.Model {
    static names() {
        return {
            id: 'id',
            name: 'name',
        };
    }
    static types() {
        return {
            id: 'string',
            name: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetSheetResponseBody = GetSheetResponseBody;
class GetSheetResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: GetSheetResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetSheetResponse = GetSheetResponse;
class InsertRecordsHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.InsertRecordsHeaders = InsertRecordsHeaders;
class InsertRecordsRequest extends $tea.Model {
    static names() {
        return {
            records: 'records',
        };
    }
    static types() {
        return {
            records: { 'type': 'array', 'itemType': InsertRecordsRequestRecords },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.InsertRecordsRequest = InsertRecordsRequest;
class InsertRecordsResponseBody extends $tea.Model {
    static names() {
        return {
            value: 'value',
        };
    }
    static types() {
        return {
            value: { 'type': 'array', 'itemType': InsertRecordsResponseBodyValue },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.InsertRecordsResponseBody = InsertRecordsResponseBody;
class InsertRecordsResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: InsertRecordsResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.InsertRecordsResponse = InsertRecordsResponse;
class UpdateFieldHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateFieldHeaders = UpdateFieldHeaders;
class UpdateFieldRequest extends $tea.Model {
    static names() {
        return {
            name: 'name',
            property: 'property',
        };
    }
    static types() {
        return {
            name: 'string',
            property: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateFieldRequest = UpdateFieldRequest;
class UpdateFieldResponseBody extends $tea.Model {
    static names() {
        return {
            id: 'id',
        };
    }
    static types() {
        return {
            id: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateFieldResponseBody = UpdateFieldResponseBody;
class UpdateFieldResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: UpdateFieldResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateFieldResponse = UpdateFieldResponse;
class UpdateRecordsHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateRecordsHeaders = UpdateRecordsHeaders;
class UpdateRecordsRequest extends $tea.Model {
    static names() {
        return {
            records: 'records',
        };
    }
    static types() {
        return {
            records: { 'type': 'array', 'itemType': UpdateRecordsRequestRecords },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateRecordsRequest = UpdateRecordsRequest;
class UpdateRecordsResponseBody extends $tea.Model {
    static names() {
        return {
            value: 'value',
        };
    }
    static types() {
        return {
            value: { 'type': 'array', 'itemType': UpdateRecordsResponseBodyValue },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateRecordsResponseBody = UpdateRecordsResponseBody;
class UpdateRecordsResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: UpdateRecordsResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateRecordsResponse = UpdateRecordsResponse;
class UpdateSheetHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateSheetHeaders = UpdateSheetHeaders;
class UpdateSheetRequest extends $tea.Model {
    static names() {
        return {
            name: 'name',
        };
    }
    static types() {
        return {
            name: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateSheetRequest = UpdateSheetRequest;
class UpdateSheetResponseBody extends $tea.Model {
    static names() {
        return {
            id: 'id',
            name: 'name',
        };
    }
    static types() {
        return {
            id: 'string',
            name: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateSheetResponseBody = UpdateSheetResponseBody;
class UpdateSheetResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: UpdateSheetResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateSheetResponse = UpdateSheetResponse;
class CreateSheetRequestFields extends $tea.Model {
    static names() {
        return {
            name: 'name',
            property: 'property',
            type: 'type',
        };
    }
    static types() {
        return {
            name: 'string',
            property: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
            type: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateSheetRequestFields = CreateSheetRequestFields;
class GetAllFieldsResponseBodyValue extends $tea.Model {
    static names() {
        return {
            id: 'id',
            name: 'name',
            property: 'property',
            type: 'type',
        };
    }
    static types() {
        return {
            id: 'string',
            name: 'string',
            property: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
            type: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetAllFieldsResponseBodyValue = GetAllFieldsResponseBodyValue;
class GetAllSheetsResponseBodyValue extends $tea.Model {
    static names() {
        return {
            id: 'id',
            name: 'name',
        };
    }
    static types() {
        return {
            id: 'string',
            name: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetAllSheetsResponseBodyValue = GetAllSheetsResponseBodyValue;
class GetRecordsResponseBodyRecords extends $tea.Model {
    static names() {
        return {
            fields: 'fields',
            id: 'id',
        };
    }
    static types() {
        return {
            fields: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
            id: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetRecordsResponseBodyRecords = GetRecordsResponseBodyRecords;
class InsertRecordsRequestRecords extends $tea.Model {
    static names() {
        return {
            fields: 'fields',
        };
    }
    static types() {
        return {
            fields: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.InsertRecordsRequestRecords = InsertRecordsRequestRecords;
class InsertRecordsResponseBodyValue extends $tea.Model {
    static names() {
        return {
            id: 'id',
        };
    }
    static types() {
        return {
            id: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.InsertRecordsResponseBodyValue = InsertRecordsResponseBodyValue;
class UpdateRecordsRequestRecords extends $tea.Model {
    static names() {
        return {
            fields: 'fields',
            id: 'id',
        };
    }
    static types() {
        return {
            fields: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
            id: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateRecordsRequestRecords = UpdateRecordsRequestRecords;
class UpdateRecordsResponseBodyValue extends $tea.Model {
    static names() {
        return {
            id: 'id',
        };
    }
    static types() {
        return {
            id: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateRecordsResponseBodyValue = UpdateRecordsResponseBodyValue;
class Client extends openapi_client_1.default {
    constructor(config) {
        super(config);
        let gatewayClient = new gateway_dingtalk_1.default();
        this._spi = gatewayClient;
        this._endpointRule = "";
        if (tea_util_1.default.empty(this._endpoint)) {
            this._endpoint = "api.dingtalk.com";
        }
    }
    /**
     * 新增数据表字段
     *
     * @param request - CreateFieldRequest
     * @param headers - CreateFieldHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns CreateFieldResponse
     */
    async createFieldWithOptions(baseId, sheetIdOrName, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.name)) {
            body["name"] = request.name;
        }
        if (!tea_util_1.default.isUnset(request.property)) {
            body["property"] = request.property;
        }
        if (!tea_util_1.default.isUnset(request.type)) {
            body["type"] = request.type;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "CreateField",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}/fields`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new CreateFieldResponse({}));
    }
    /**
     * 新增数据表字段
     *
     * @param request - CreateFieldRequest
     * @returns CreateFieldResponse
     */
    async createField(baseId, sheetIdOrName, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new CreateFieldHeaders({});
        return await this.createFieldWithOptions(baseId, sheetIdOrName, request, headers, runtime);
    }
    /**
     * 创建数据表
     *
     * @param request - CreateSheetRequest
     * @param headers - CreateSheetHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns CreateSheetResponse
     */
    async createSheetWithOptions(baseId, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.fields)) {
            body["fields"] = request.fields;
        }
        if (!tea_util_1.default.isUnset(request.name)) {
            body["name"] = request.name;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "CreateSheet",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new CreateSheetResponse({}));
    }
    /**
     * 创建数据表
     *
     * @param request - CreateSheetRequest
     * @returns CreateSheetResponse
     */
    async createSheet(baseId, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new CreateSheetHeaders({});
        return await this.createSheetWithOptions(baseId, request, headers, runtime);
    }
    /**
     * 删除数据表字段
     *
     * @param headers - DeleteFieldHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns DeleteFieldResponse
     */
    async deleteFieldWithOptions(baseId, sheetIdOrName, fieldIdOrName, headers, runtime) {
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
        });
        let params = new $OpenApi.Params({
            action: "DeleteField",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}/fields/${fieldIdOrName}`,
            method: "DELETE",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new DeleteFieldResponse({}));
    }
    /**
     * 删除数据表字段
     * @returns DeleteFieldResponse
     */
    async deleteField(baseId, sheetIdOrName, fieldIdOrName) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new DeleteFieldHeaders({});
        return await this.deleteFieldWithOptions(baseId, sheetIdOrName, fieldIdOrName, headers, runtime);
    }
    /**
     * 删除数据表多行记录
     *
     * @param request - DeleteRecordsRequest
     * @param headers - DeleteRecordsHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns DeleteRecordsResponse
     */
    async deleteRecordsWithOptions(baseId, sheetIdOrName, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.recordIds)) {
            body["recordIds"] = request.recordIds;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "DeleteRecords",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}/records/delete`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new DeleteRecordsResponse({}));
    }
    /**
     * 删除数据表多行记录
     *
     * @param request - DeleteRecordsRequest
     * @returns DeleteRecordsResponse
     */
    async deleteRecords(baseId, sheetIdOrName, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new DeleteRecordsHeaders({});
        return await this.deleteRecordsWithOptions(baseId, sheetIdOrName, request, headers, runtime);
    }
    /**
     * 删除数据表
     *
     * @param headers - DeleteSheetHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns DeleteSheetResponse
     */
    async deleteSheetWithOptions(baseId, sheetIdOrName, headers, runtime) {
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
        });
        let params = new $OpenApi.Params({
            action: "DeleteSheet",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}`,
            method: "DELETE",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new DeleteSheetResponse({}));
    }
    /**
     * 删除数据表
     * @returns DeleteSheetResponse
     */
    async deleteSheet(baseId, sheetIdOrName) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new DeleteSheetHeaders({});
        return await this.deleteSheetWithOptions(baseId, sheetIdOrName, headers, runtime);
    }
    /**
     * 获取所有字段
     *
     * @param headers - GetAllFieldsHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns GetAllFieldsResponse
     */
    async getAllFieldsWithOptions(baseId, sheetIdOrName, headers, runtime) {
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
        });
        let params = new $OpenApi.Params({
            action: "GetAllFields",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}/fields`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new GetAllFieldsResponse({}));
    }
    /**
     * 获取所有字段
     * @returns GetAllFieldsResponse
     */
    async getAllFields(baseId, sheetIdOrName) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new GetAllFieldsHeaders({});
        return await this.getAllFieldsWithOptions(baseId, sheetIdOrName, headers, runtime);
    }
    /**
     * 获取所有数据表
     *
     * @param headers - GetAllSheetsHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns GetAllSheetsResponse
     */
    async getAllSheetsWithOptions(baseId, headers, runtime) {
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
        });
        let params = new $OpenApi.Params({
            action: "GetAllSheets",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new GetAllSheetsResponse({}));
    }
    /**
     * 获取所有数据表
     * @returns GetAllSheetsResponse
     */
    async getAllSheets(baseId) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new GetAllSheetsHeaders({});
        return await this.getAllSheetsWithOptions(baseId, headers, runtime);
    }
    /**
     * 获取记录
     *
     * @param headers - GetRecordHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns GetRecordResponse
     */
    async getRecordWithOptions(baseId, sheetIdOrName, recordId, headers, runtime) {
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
        });
        let params = new $OpenApi.Params({
            action: "GetRecord",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}/records/${recordId}`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new GetRecordResponse({}));
    }
    /**
     * 获取记录
     * @returns GetRecordResponse
     */
    async getRecord(baseId, sheetIdOrName, recordId) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new GetRecordHeaders({});
        return await this.getRecordWithOptions(baseId, sheetIdOrName, recordId, headers, runtime);
    }
    /**
     * 获取多行记录
     *
     * @param request - GetRecordsRequest
     * @param headers - GetRecordsHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns GetRecordsResponse
     */
    async getRecordsWithOptions(baseId, sheetIdOrName, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let query = {};
        if (!tea_util_1.default.isUnset(request.maxResults)) {
            query["maxResults"] = request.maxResults;
        }
        if (!tea_util_1.default.isUnset(request.nextToken)) {
            query["nextToken"] = request.nextToken;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            query: openapi_util_1.default.query(query),
        });
        let params = new $OpenApi.Params({
            action: "GetRecords",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}/records`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new GetRecordsResponse({}));
    }
    /**
     * 获取多行记录
     *
     * @param request - GetRecordsRequest
     * @returns GetRecordsResponse
     */
    async getRecords(baseId, sheetIdOrName, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new GetRecordsHeaders({});
        return await this.getRecordsWithOptions(baseId, sheetIdOrName, request, headers, runtime);
    }
    /**
     * 获取数据表
     *
     * @param headers - GetSheetHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns GetSheetResponse
     */
    async getSheetWithOptions(baseId, sheetIdOrName, headers, runtime) {
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
        });
        let params = new $OpenApi.Params({
            action: "GetSheet",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new GetSheetResponse({}));
    }
    /**
     * 获取数据表
     * @returns GetSheetResponse
     */
    async getSheet(baseId, sheetIdOrName) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new GetSheetHeaders({});
        return await this.getSheetWithOptions(baseId, sheetIdOrName, headers, runtime);
    }
    /**
     * 新增记录
     *
     * @param request - InsertRecordsRequest
     * @param headers - InsertRecordsHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns InsertRecordsResponse
     */
    async insertRecordsWithOptions(baseId, sheetIdOrName, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.records)) {
            body["records"] = request.records;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "InsertRecords",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}/records`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new InsertRecordsResponse({}));
    }
    /**
     * 新增记录
     *
     * @param request - InsertRecordsRequest
     * @returns InsertRecordsResponse
     */
    async insertRecords(baseId, sheetIdOrName, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new InsertRecordsHeaders({});
        return await this.insertRecordsWithOptions(baseId, sheetIdOrName, request, headers, runtime);
    }
    /**
     * 更新数据表字段
     *
     * @param request - UpdateFieldRequest
     * @param headers - UpdateFieldHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns UpdateFieldResponse
     */
    async updateFieldWithOptions(baseId, sheetIdOrName, fieldIdOrName, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.name)) {
            body["name"] = request.name;
        }
        if (!tea_util_1.default.isUnset(request.property)) {
            body["property"] = request.property;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "UpdateField",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}/fields/${fieldIdOrName}`,
            method: "PUT",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new UpdateFieldResponse({}));
    }
    /**
     * 更新数据表字段
     *
     * @param request - UpdateFieldRequest
     * @returns UpdateFieldResponse
     */
    async updateField(baseId, sheetIdOrName, fieldIdOrName, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new UpdateFieldHeaders({});
        return await this.updateFieldWithOptions(baseId, sheetIdOrName, fieldIdOrName, request, headers, runtime);
    }
    /**
     * 更新数据表多行记录
     *
     * @param request - UpdateRecordsRequest
     * @param headers - UpdateRecordsHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns UpdateRecordsResponse
     */
    async updateRecordsWithOptions(baseId, sheetIdOrName, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.records)) {
            body["records"] = request.records;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "UpdateRecords",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}/records`,
            method: "PUT",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new UpdateRecordsResponse({}));
    }
    /**
     * 更新数据表多行记录
     *
     * @param request - UpdateRecordsRequest
     * @returns UpdateRecordsResponse
     */
    async updateRecords(baseId, sheetIdOrName, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new UpdateRecordsHeaders({});
        return await this.updateRecordsWithOptions(baseId, sheetIdOrName, request, headers, runtime);
    }
    /**
     * 更新数据表
     *
     * @param request - UpdateSheetRequest
     * @param headers - UpdateSheetHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns UpdateSheetResponse
     */
    async updateSheetWithOptions(baseId, sheetIdOrName, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.name)) {
            body["name"] = request.name;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "UpdateSheet",
            version: "notable_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/notable/bases/${baseId}/sheets/${sheetIdOrName}`,
            method: "PUT",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new UpdateSheetResponse({}));
    }
    /**
     * 更新数据表
     *
     * @param request - UpdateSheetRequest
     * @returns UpdateSheetResponse
     */
    async updateSheet(baseId, sheetIdOrName, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new UpdateSheetHeaders({});
        return await this.updateSheetWithOptions(baseId, sheetIdOrName, request, headers, runtime);
    }
}
exports.default = Client;
//# sourceMappingURL=client.js.map