"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.WriteUserCarbonEnergyRequestUserDetailsList = exports.WriteUserCarbonRequestUserDetailsList = exports.WriteOrgCarbonRequestOrgDetailsList = exports.WriteAlibabaUserCarbonRequestUserDetailsList = exports.WriteAlibabaOrgCarbonRequestOrgDetailsList = exports.WriteUserCarbonEnergyResponse = exports.WriteUserCarbonEnergyResponseBody = exports.WriteUserCarbonEnergyRequest = exports.WriteUserCarbonEnergyHeaders = exports.WriteUserCarbonResponse = exports.WriteUserCarbonResponseBody = exports.WriteUserCarbonRequest = exports.WriteUserCarbonHeaders = exports.WriteOrgCarbonResponse = exports.WriteOrgCarbonResponseBody = exports.WriteOrgCarbonRequest = exports.WriteOrgCarbonHeaders = exports.WriteIsvStateResponse = exports.WriteIsvStateResponseBody = exports.WriteIsvStateRequest = exports.WriteIsvStateHeaders = exports.WriteAlibabaUserCarbonResponse = exports.WriteAlibabaUserCarbonResponseBody = exports.WriteAlibabaUserCarbonRequest = exports.WriteAlibabaUserCarbonHeaders = exports.WriteAlibabaOrgCarbonResponse = exports.WriteAlibabaOrgCarbonResponseBody = exports.WriteAlibabaOrgCarbonRequest = exports.WriteAlibabaOrgCarbonHeaders = exports.GetPersonalCarbonInfoResponse = exports.GetPersonalCarbonInfoResponseBody = exports.GetPersonalCarbonInfoRequest = exports.GetPersonalCarbonInfoHeaders = 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 GetPersonalCarbonInfoHeaders 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.GetPersonalCarbonInfoHeaders = GetPersonalCarbonInfoHeaders;
class GetPersonalCarbonInfoRequest extends $tea.Model {
    static names() {
        return {
            actionType: 'actionType',
            unionId: 'unionId',
        };
    }
    static types() {
        return {
            actionType: 'string',
            unionId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetPersonalCarbonInfoRequest = GetPersonalCarbonInfoRequest;
class GetPersonalCarbonInfoResponseBody extends $tea.Model {
    static names() {
        return {
            content: 'content',
            personalCarbonAmount: 'personalCarbonAmount',
        };
    }
    static types() {
        return {
            content: 'string',
            personalCarbonAmount: 'number',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetPersonalCarbonInfoResponseBody = GetPersonalCarbonInfoResponseBody;
class GetPersonalCarbonInfoResponse 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: GetPersonalCarbonInfoResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetPersonalCarbonInfoResponse = GetPersonalCarbonInfoResponse;
class WriteAlibabaOrgCarbonHeaders 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.WriteAlibabaOrgCarbonHeaders = WriteAlibabaOrgCarbonHeaders;
class WriteAlibabaOrgCarbonRequest extends $tea.Model {
    static names() {
        return {
            orgDetailsList: 'orgDetailsList',
        };
    }
    static types() {
        return {
            orgDetailsList: { 'type': 'array', 'itemType': WriteAlibabaOrgCarbonRequestOrgDetailsList },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteAlibabaOrgCarbonRequest = WriteAlibabaOrgCarbonRequest;
class WriteAlibabaOrgCarbonResponseBody extends $tea.Model {
    static names() {
        return {
            result: 'result',
            success: 'success',
        };
    }
    static types() {
        return {
            result: 'number',
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteAlibabaOrgCarbonResponseBody = WriteAlibabaOrgCarbonResponseBody;
class WriteAlibabaOrgCarbonResponse 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: WriteAlibabaOrgCarbonResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteAlibabaOrgCarbonResponse = WriteAlibabaOrgCarbonResponse;
class WriteAlibabaUserCarbonHeaders 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.WriteAlibabaUserCarbonHeaders = WriteAlibabaUserCarbonHeaders;
class WriteAlibabaUserCarbonRequest extends $tea.Model {
    static names() {
        return {
            userDetailsList: 'userDetailsList',
        };
    }
    static types() {
        return {
            userDetailsList: { 'type': 'array', 'itemType': WriteAlibabaUserCarbonRequestUserDetailsList },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteAlibabaUserCarbonRequest = WriteAlibabaUserCarbonRequest;
class WriteAlibabaUserCarbonResponseBody extends $tea.Model {
    static names() {
        return {
            result: 'result',
            success: 'success',
        };
    }
    static types() {
        return {
            result: 'number',
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteAlibabaUserCarbonResponseBody = WriteAlibabaUserCarbonResponseBody;
class WriteAlibabaUserCarbonResponse 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: WriteAlibabaUserCarbonResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteAlibabaUserCarbonResponse = WriteAlibabaUserCarbonResponse;
class WriteIsvStateHeaders 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.WriteIsvStateHeaders = WriteIsvStateHeaders;
class WriteIsvStateRequest extends $tea.Model {
    static names() {
        return {
            isvName: 'isvName',
            statDate: 'statDate',
        };
    }
    static types() {
        return {
            isvName: 'string',
            statDate: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteIsvStateRequest = WriteIsvStateRequest;
class WriteIsvStateResponseBody extends $tea.Model {
    static names() {
        return {
            result: 'result',
        };
    }
    static types() {
        return {
            result: 'number',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteIsvStateResponseBody = WriteIsvStateResponseBody;
class WriteIsvStateResponse 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: WriteIsvStateResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteIsvStateResponse = WriteIsvStateResponse;
class WriteOrgCarbonHeaders 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.WriteOrgCarbonHeaders = WriteOrgCarbonHeaders;
class WriteOrgCarbonRequest extends $tea.Model {
    static names() {
        return {
            orgDetailsList: 'orgDetailsList',
        };
    }
    static types() {
        return {
            orgDetailsList: { 'type': 'array', 'itemType': WriteOrgCarbonRequestOrgDetailsList },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteOrgCarbonRequest = WriteOrgCarbonRequest;
class WriteOrgCarbonResponseBody extends $tea.Model {
    static names() {
        return {
            result: 'result',
            success: 'success',
        };
    }
    static types() {
        return {
            result: 'number',
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteOrgCarbonResponseBody = WriteOrgCarbonResponseBody;
class WriteOrgCarbonResponse 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: WriteOrgCarbonResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteOrgCarbonResponse = WriteOrgCarbonResponse;
class WriteUserCarbonHeaders 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.WriteUserCarbonHeaders = WriteUserCarbonHeaders;
class WriteUserCarbonRequest extends $tea.Model {
    static names() {
        return {
            userDetailsList: 'userDetailsList',
        };
    }
    static types() {
        return {
            userDetailsList: { 'type': 'array', 'itemType': WriteUserCarbonRequestUserDetailsList },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteUserCarbonRequest = WriteUserCarbonRequest;
class WriteUserCarbonResponseBody extends $tea.Model {
    static names() {
        return {
            result: 'result',
            success: 'success',
        };
    }
    static types() {
        return {
            result: 'number',
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteUserCarbonResponseBody = WriteUserCarbonResponseBody;
class WriteUserCarbonResponse 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: WriteUserCarbonResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteUserCarbonResponse = WriteUserCarbonResponse;
class WriteUserCarbonEnergyHeaders 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.WriteUserCarbonEnergyHeaders = WriteUserCarbonEnergyHeaders;
class WriteUserCarbonEnergyRequest extends $tea.Model {
    static names() {
        return {
            userDetailsList: 'userDetailsList',
        };
    }
    static types() {
        return {
            userDetailsList: { 'type': 'array', 'itemType': WriteUserCarbonEnergyRequestUserDetailsList },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteUserCarbonEnergyRequest = WriteUserCarbonEnergyRequest;
class WriteUserCarbonEnergyResponseBody extends $tea.Model {
    static names() {
        return {
            result: 'result',
            success: 'success',
        };
    }
    static types() {
        return {
            result: 'number',
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteUserCarbonEnergyResponseBody = WriteUserCarbonEnergyResponseBody;
class WriteUserCarbonEnergyResponse 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: WriteUserCarbonEnergyResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteUserCarbonEnergyResponse = WriteUserCarbonEnergyResponse;
class WriteAlibabaOrgCarbonRequestOrgDetailsList extends $tea.Model {
    static names() {
        return {
            actionId: 'actionId',
            actionTime: 'actionTime',
            actionType: 'actionType',
            carbonAmount: 'carbonAmount',
            corpId: 'corpId',
            deptId: 'deptId',
            version: 'version',
        };
    }
    static types() {
        return {
            actionId: 'string',
            actionTime: 'string',
            actionType: 'string',
            carbonAmount: 'string',
            corpId: 'string',
            deptId: 'number',
            version: 'number',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteAlibabaOrgCarbonRequestOrgDetailsList = WriteAlibabaOrgCarbonRequestOrgDetailsList;
class WriteAlibabaUserCarbonRequestUserDetailsList extends $tea.Model {
    static names() {
        return {
            actionEndTime: 'actionEndTime',
            actionId: 'actionId',
            actionStartTime: 'actionStartTime',
            actionType: 'actionType',
            carbonAmount: 'carbonAmount',
            corpId: 'corpId',
            deptId: 'deptId',
            userId: 'userId',
            version: 'version',
        };
    }
    static types() {
        return {
            actionEndTime: 'string',
            actionId: 'string',
            actionStartTime: 'string',
            actionType: 'string',
            carbonAmount: 'string',
            corpId: 'string',
            deptId: 'number',
            userId: 'string',
            version: 'number',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteAlibabaUserCarbonRequestUserDetailsList = WriteAlibabaUserCarbonRequestUserDetailsList;
class WriteOrgCarbonRequestOrgDetailsList extends $tea.Model {
    static names() {
        return {
            actionId: 'actionId',
            actionTime: 'actionTime',
            actionType: 'actionType',
            carbonAmount: 'carbonAmount',
            corpId: 'corpId',
            deptId: 'deptId',
            version: 'version',
        };
    }
    static types() {
        return {
            actionId: 'string',
            actionTime: 'string',
            actionType: 'string',
            carbonAmount: 'string',
            corpId: 'string',
            deptId: 'number',
            version: 'number',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteOrgCarbonRequestOrgDetailsList = WriteOrgCarbonRequestOrgDetailsList;
class WriteUserCarbonRequestUserDetailsList extends $tea.Model {
    static names() {
        return {
            actionEndTime: 'actionEndTime',
            actionId: 'actionId',
            actionStartTime: 'actionStartTime',
            actionType: 'actionType',
            carbonAmount: 'carbonAmount',
            corpId: 'corpId',
            deptId: 'deptId',
            userId: 'userId',
            version: 'version',
        };
    }
    static types() {
        return {
            actionEndTime: 'string',
            actionId: 'string',
            actionStartTime: 'string',
            actionType: 'string',
            carbonAmount: 'string',
            corpId: 'string',
            deptId: 'number',
            userId: 'string',
            version: 'number',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteUserCarbonRequestUserDetailsList = WriteUserCarbonRequestUserDetailsList;
class WriteUserCarbonEnergyRequestUserDetailsList extends $tea.Model {
    static names() {
        return {
            actionEndTime: 'actionEndTime',
            actionId: 'actionId',
            actionStartTime: 'actionStartTime',
            actionType: 'actionType',
            carbonAmount: 'carbonAmount',
            corpId: 'corpId',
            deptId: 'deptId',
            userId: 'userId',
            version: 'version',
        };
    }
    static types() {
        return {
            actionEndTime: 'string',
            actionId: 'string',
            actionStartTime: 'string',
            actionType: 'string',
            carbonAmount: 'string',
            corpId: 'string',
            deptId: 'number',
            userId: 'string',
            version: 'number',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WriteUserCarbonEnergyRequestUserDetailsList = WriteUserCarbonEnergyRequestUserDetailsList;
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 - GetPersonalCarbonInfoRequest
     * @param headers - GetPersonalCarbonInfoHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns GetPersonalCarbonInfoResponse
     */
    async getPersonalCarbonInfoWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let query = {};
        if (!tea_util_1.default.isUnset(request.actionType)) {
            query["actionType"] = request.actionType;
        }
        if (!tea_util_1.default.isUnset(request.unionId)) {
            query["unionId"] = request.unionId;
        }
        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: "GetPersonalCarbonInfo",
            version: "carbon_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/carbon/personals/infos`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new GetPersonalCarbonInfoResponse({}));
    }
    /**
     * 获取用户的减碳明细
     *
     * @param request - GetPersonalCarbonInfoRequest
     * @returns GetPersonalCarbonInfoResponse
     */
    async getPersonalCarbonInfo(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new GetPersonalCarbonInfoHeaders({});
        return await this.getPersonalCarbonInfoWithOptions(request, headers, runtime);
    }
    /**
     * 写入阿里巴巴每日组织明细碳能量数据
     *
     * @param request - WriteAlibabaOrgCarbonRequest
     * @param headers - WriteAlibabaOrgCarbonHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns WriteAlibabaOrgCarbonResponse
     */
    async writeAlibabaOrgCarbonWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.orgDetailsList)) {
            body["orgDetailsList"] = request.orgDetailsList;
        }
        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: "WriteAlibabaOrgCarbon",
            version: "carbon_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/carbon/alibabaOrgDetails/write`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new WriteAlibabaOrgCarbonResponse({}));
    }
    /**
     * 写入阿里巴巴每日组织明细碳能量数据
     *
     * @param request - WriteAlibabaOrgCarbonRequest
     * @returns WriteAlibabaOrgCarbonResponse
     */
    async writeAlibabaOrgCarbon(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new WriteAlibabaOrgCarbonHeaders({});
        return await this.writeAlibabaOrgCarbonWithOptions(request, headers, runtime);
    }
    /**
     * 写入阿里巴巴每日用户碳能量数据
     *
     * @param request - WriteAlibabaUserCarbonRequest
     * @param headers - WriteAlibabaUserCarbonHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns WriteAlibabaUserCarbonResponse
     */
    async writeAlibabaUserCarbonWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.userDetailsList)) {
            body["userDetailsList"] = request.userDetailsList;
        }
        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: "WriteAlibabaUserCarbon",
            version: "carbon_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/carbon/alibabaUserDetails/write`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new WriteAlibabaUserCarbonResponse({}));
    }
    /**
     * 写入阿里巴巴每日用户碳能量数据
     *
     * @param request - WriteAlibabaUserCarbonRequest
     * @returns WriteAlibabaUserCarbonResponse
     */
    async writeAlibabaUserCarbon(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new WriteAlibabaUserCarbonHeaders({});
        return await this.writeAlibabaUserCarbonWithOptions(request, headers, runtime);
    }
    /**
     * ISV记录数据传输当前状态
     *
     * @param request - WriteIsvStateRequest
     * @param headers - WriteIsvStateHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns WriteIsvStateResponse
     */
    async writeIsvStateWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let query = {};
        if (!tea_util_1.default.isUnset(request.isvName)) {
            query["isvName"] = request.isvName;
        }
        if (!tea_util_1.default.isUnset(request.statDate)) {
            query["statDate"] = request.statDate;
        }
        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: "WriteIsvState",
            version: "carbon_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/carbon/datas/states/write`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new WriteIsvStateResponse({}));
    }
    /**
     * ISV记录数据传输当前状态
     *
     * @param request - WriteIsvStateRequest
     * @returns WriteIsvStateResponse
     */
    async writeIsvState(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new WriteIsvStateHeaders({});
        return await this.writeIsvStateWithOptions(request, headers, runtime);
    }
    /**
     * 写入isv每日组织明细碳能量数据
     *
     * @param request - WriteOrgCarbonRequest
     * @param headers - WriteOrgCarbonHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns WriteOrgCarbonResponse
     */
    async writeOrgCarbonWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.orgDetailsList)) {
            body["orgDetailsList"] = request.orgDetailsList;
        }
        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: "WriteOrgCarbon",
            version: "carbon_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/carbon/orgDetails/write`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new WriteOrgCarbonResponse({}));
    }
    /**
     * 写入isv每日组织明细碳能量数据
     *
     * @param request - WriteOrgCarbonRequest
     * @returns WriteOrgCarbonResponse
     */
    async writeOrgCarbon(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new WriteOrgCarbonHeaders({});
        return await this.writeOrgCarbonWithOptions(request, headers, runtime);
    }
    /**
     * 写入isv每日用户明细碳能量数据
     *
     * @param request - WriteUserCarbonRequest
     * @param headers - WriteUserCarbonHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns WriteUserCarbonResponse
     */
    async writeUserCarbonWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.userDetailsList)) {
            body["userDetailsList"] = request.userDetailsList;
        }
        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: "WriteUserCarbon",
            version: "carbon_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/carbon/userDetails/write`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new WriteUserCarbonResponse({}));
    }
    /**
     * 写入isv每日用户明细碳能量数据
     *
     * @param request - WriteUserCarbonRequest
     * @returns WriteUserCarbonResponse
     */
    async writeUserCarbon(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new WriteUserCarbonHeaders({});
        return await this.writeUserCarbonWithOptions(request, headers, runtime);
    }
    /**
     * 写入isv能耗每日用户明细碳能量数据
     *
     * @param request - WriteUserCarbonEnergyRequest
     * @param headers - WriteUserCarbonEnergyHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns WriteUserCarbonEnergyResponse
     */
    async writeUserCarbonEnergyWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.userDetailsList)) {
            body["userDetailsList"] = request.userDetailsList;
        }
        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: "WriteUserCarbonEnergy",
            version: "carbon_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/carbon/userDetails/energies/write`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new WriteUserCarbonEnergyResponse({}));
    }
    /**
     * 写入isv能耗每日用户明细碳能量数据
     *
     * @param request - WriteUserCarbonEnergyRequest
     * @returns WriteUserCarbonEnergyResponse
     */
    async writeUserCarbonEnergy(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new WriteUserCarbonEnergyHeaders({});
        return await this.writeUserCarbonEnergyWithOptions(request, headers, runtime);
    }
}
exports.default = Client;
//# sourceMappingURL=client.js.map