"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.IndustrializeManufactureQueryJobsResponseBodyContent = exports.IndustrializeManufactureJobBookResponseBodyContent = exports.IndustrializeManufactureQueryJobsResponse = exports.IndustrializeManufactureQueryJobsResponseBody = exports.IndustrializeManufactureQueryJobsRequest = exports.IndustrializeManufactureQueryJobsHeaders = exports.IndustrializeManufactureJobBookResponse = exports.IndustrializeManufactureJobBookResponseBody = exports.IndustrializeManufactureJobBookRequest = 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 IndustrializeManufactureJobBookRequest extends $tea.Model {
    static names() {
        return {
            corpId: 'corpId',
            extend: 'extend',
            instNo: 'instNo',
            isBatchJob: 'isBatchJob',
            manufactureDate: 'manufactureDate',
            mesAppKey: 'mesAppKey',
            processEnName: 'processEnName',
            processName: 'processName',
            productCode: 'productCode',
            productEnName: 'productEnName',
            productName: 'productName',
            productSpecification: 'productSpecification',
            qualifiedQuantity: 'qualifiedQuantity',
            reworkableQuantity: 'reworkableQuantity',
            scrappedQuantity: 'scrappedQuantity',
            unitPrice: 'unitPrice',
            userIdList: 'userIdList',
            userName: 'userName',
            userNameList: 'userNameList',
            uuid: 'uuid',
        };
    }
    static types() {
        return {
            corpId: 'string',
            extend: 'string',
            instNo: 'string',
            isBatchJob: 'string',
            manufactureDate: 'string',
            mesAppKey: 'string',
            processEnName: 'string',
            processName: 'string',
            productCode: 'string',
            productEnName: 'string',
            productName: 'string',
            productSpecification: 'string',
            qualifiedQuantity: 'string',
            reworkableQuantity: 'string',
            scrappedQuantity: 'string',
            unitPrice: 'string',
            userIdList: 'string',
            userName: 'string',
            userNameList: 'string',
            uuid: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.IndustrializeManufactureJobBookRequest = IndustrializeManufactureJobBookRequest;
class IndustrializeManufactureJobBookResponseBody extends $tea.Model {
    static names() {
        return {
            content: 'content',
            errorCode: 'errorCode',
            errorLevel: 'errorLevel',
            errorMsg: 'errorMsg',
            httpCode: 'httpCode',
            success: 'success',
            uuid: 'uuid',
        };
    }
    static types() {
        return {
            content: IndustrializeManufactureJobBookResponseBodyContent,
            errorCode: 'string',
            errorLevel: 'number',
            errorMsg: 'string',
            httpCode: 'string',
            success: 'boolean',
            uuid: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.IndustrializeManufactureJobBookResponseBody = IndustrializeManufactureJobBookResponseBody;
class IndustrializeManufactureJobBookResponse 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: IndustrializeManufactureJobBookResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.IndustrializeManufactureJobBookResponse = IndustrializeManufactureJobBookResponse;
class IndustrializeManufactureQueryJobsHeaders 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.IndustrializeManufactureQueryJobsHeaders = IndustrializeManufactureQueryJobsHeaders;
class IndustrializeManufactureQueryJobsRequest extends $tea.Model {
    static names() {
        return {
            currentPage: 'currentPage',
            instNo: 'instNo',
            manufactureDay: 'manufactureDay',
            mesAppKey: 'mesAppKey',
            pageSize: 'pageSize',
            processName: 'processName',
            productCode: 'productCode',
            productName: 'productName',
            productSpecification: 'productSpecification',
            qualifiedQuantity: 'qualifiedQuantity',
            unitPrice: 'unitPrice',
            userId: 'userId',
            userIdList: 'userIdList',
            userName: 'userName',
            uuid: 'uuid',
        };
    }
    static types() {
        return {
            currentPage: 'number',
            instNo: 'string',
            manufactureDay: 'string',
            mesAppKey: 'string',
            pageSize: 'number',
            processName: 'string',
            productCode: 'string',
            productName: 'string',
            productSpecification: 'string',
            qualifiedQuantity: 'string',
            unitPrice: 'string',
            userId: 'string',
            userIdList: 'string',
            userName: 'string',
            uuid: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.IndustrializeManufactureQueryJobsRequest = IndustrializeManufactureQueryJobsRequest;
class IndustrializeManufactureQueryJobsResponseBody extends $tea.Model {
    static names() {
        return {
            content: 'content',
            httpCode: 'httpCode',
        };
    }
    static types() {
        return {
            content: IndustrializeManufactureQueryJobsResponseBodyContent,
            httpCode: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.IndustrializeManufactureQueryJobsResponseBody = IndustrializeManufactureQueryJobsResponseBody;
class IndustrializeManufactureQueryJobsResponse 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: IndustrializeManufactureQueryJobsResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.IndustrializeManufactureQueryJobsResponse = IndustrializeManufactureQueryJobsResponse;
class IndustrializeManufactureJobBookResponseBodyContent extends $tea.Model {
    static names() {
        return {
            count: 'count',
            id: 'id',
        };
    }
    static types() {
        return {
            count: 'number',
            id: 'number',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.IndustrializeManufactureJobBookResponseBodyContent = IndustrializeManufactureJobBookResponseBodyContent;
class IndustrializeManufactureQueryJobsResponseBodyContent extends $tea.Model {
    static names() {
        return {
            corpId: 'corpId',
            gmtCreate: 'gmtCreate',
            gmtModified: 'gmtModified',
            id: 'id',
            instNo: 'instNo',
            isBatchJob: 'isBatchJob',
            manufactureDate: 'manufactureDate',
            manufactureDay: 'manufactureDay',
            mesAppKey: 'mesAppKey',
            processName: 'processName',
            qualifiedQuantity: 'qualifiedQuantity',
            scrappedQuantity: 'scrappedQuantity',
            unitPrice: 'unitPrice',
            userId: 'userId',
            userIdList: 'userIdList',
            userNameList: 'userNameList',
            uuid: 'uuid',
        };
    }
    static types() {
        return {
            corpId: 'string',
            gmtCreate: 'string',
            gmtModified: 'string',
            id: 'number',
            instNo: 'string',
            isBatchJob: 'string',
            manufactureDate: 'string',
            manufactureDay: 'string',
            mesAppKey: 'string',
            processName: 'string',
            qualifiedQuantity: 'string',
            scrappedQuantity: 'string',
            unitPrice: 'string',
            userId: 'string',
            userIdList: 'string',
            userNameList: 'string',
            uuid: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.IndustrializeManufactureQueryJobsResponseBodyContent = IndustrializeManufactureQueryJobsResponseBodyContent;
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 - IndustrializeManufactureJobBookRequest
     * @param headers - map
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns IndustrializeManufactureJobBookResponse
     */
    async industrializeManufactureJobBookWithOptions(userId, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.corpId)) {
            body["corpId"] = request.corpId;
        }
        if (!tea_util_1.default.isUnset(request.extend)) {
            body["extend"] = request.extend;
        }
        if (!tea_util_1.default.isUnset(request.instNo)) {
            body["instNo"] = request.instNo;
        }
        if (!tea_util_1.default.isUnset(request.isBatchJob)) {
            body["isBatchJob"] = request.isBatchJob;
        }
        if (!tea_util_1.default.isUnset(request.manufactureDate)) {
            body["manufactureDate"] = request.manufactureDate;
        }
        if (!tea_util_1.default.isUnset(request.mesAppKey)) {
            body["mesAppKey"] = request.mesAppKey;
        }
        if (!tea_util_1.default.isUnset(request.processEnName)) {
            body["processEnName"] = request.processEnName;
        }
        if (!tea_util_1.default.isUnset(request.processName)) {
            body["processName"] = request.processName;
        }
        if (!tea_util_1.default.isUnset(request.productCode)) {
            body["productCode"] = request.productCode;
        }
        if (!tea_util_1.default.isUnset(request.productEnName)) {
            body["productEnName"] = request.productEnName;
        }
        if (!tea_util_1.default.isUnset(request.productName)) {
            body["productName"] = request.productName;
        }
        if (!tea_util_1.default.isUnset(request.productSpecification)) {
            body["productSpecification"] = request.productSpecification;
        }
        if (!tea_util_1.default.isUnset(request.qualifiedQuantity)) {
            body["qualifiedQuantity"] = request.qualifiedQuantity;
        }
        if (!tea_util_1.default.isUnset(request.reworkableQuantity)) {
            body["reworkableQuantity"] = request.reworkableQuantity;
        }
        if (!tea_util_1.default.isUnset(request.scrappedQuantity)) {
            body["scrappedQuantity"] = request.scrappedQuantity;
        }
        if (!tea_util_1.default.isUnset(request.unitPrice)) {
            body["unitPrice"] = request.unitPrice;
        }
        if (!tea_util_1.default.isUnset(request.userIdList)) {
            body["userIdList"] = request.userIdList;
        }
        if (!tea_util_1.default.isUnset(request.userName)) {
            body["userName"] = request.userName;
        }
        if (!tea_util_1.default.isUnset(request.userNameList)) {
            body["userNameList"] = request.userNameList;
        }
        if (!tea_util_1.default.isUnset(request.uuid)) {
            body["uuid"] = request.uuid;
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: headers,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "IndustrializeManufactureJobBook",
            version: "manufacturing_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/manufacturing/users/${userId}/jobs`,
            method: "POST",
            authType: "Anonymous",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new IndustrializeManufactureJobBookResponse({}));
    }
    /**
     * 日清月结-计件报工接口
     *
     * @param request - IndustrializeManufactureJobBookRequest
     * @returns IndustrializeManufactureJobBookResponse
     */
    async industrializeManufactureJobBook(userId, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = {};
        return await this.industrializeManufactureJobBookWithOptions(userId, request, headers, runtime);
    }
    /**
     * 日清月结-计件报工查询接口
     *
     * @param request - IndustrializeManufactureQueryJobsRequest
     * @param headers - IndustrializeManufactureQueryJobsHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns IndustrializeManufactureQueryJobsResponse
     */
    async industrializeManufactureQueryJobsWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.currentPage)) {
            body["currentPage"] = request.currentPage;
        }
        if (!tea_util_1.default.isUnset(request.instNo)) {
            body["instNo"] = request.instNo;
        }
        if (!tea_util_1.default.isUnset(request.manufactureDay)) {
            body["manufactureDay"] = request.manufactureDay;
        }
        if (!tea_util_1.default.isUnset(request.mesAppKey)) {
            body["mesAppKey"] = request.mesAppKey;
        }
        if (!tea_util_1.default.isUnset(request.pageSize)) {
            body["pageSize"] = request.pageSize;
        }
        if (!tea_util_1.default.isUnset(request.processName)) {
            body["processName"] = request.processName;
        }
        if (!tea_util_1.default.isUnset(request.productCode)) {
            body["productCode"] = request.productCode;
        }
        if (!tea_util_1.default.isUnset(request.productName)) {
            body["productName"] = request.productName;
        }
        if (!tea_util_1.default.isUnset(request.productSpecification)) {
            body["productSpecification"] = request.productSpecification;
        }
        if (!tea_util_1.default.isUnset(request.qualifiedQuantity)) {
            body["qualifiedQuantity"] = request.qualifiedQuantity;
        }
        if (!tea_util_1.default.isUnset(request.unitPrice)) {
            body["unitPrice"] = request.unitPrice;
        }
        if (!tea_util_1.default.isUnset(request.userId)) {
            body["userId"] = request.userId;
        }
        if (!tea_util_1.default.isUnset(request.userIdList)) {
            body["userIdList"] = request.userIdList;
        }
        if (!tea_util_1.default.isUnset(request.userName)) {
            body["userName"] = request.userName;
        }
        if (!tea_util_1.default.isUnset(request.uuid)) {
            body["uuid"] = request.uuid;
        }
        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: "IndustrializeManufactureQueryJobs",
            version: "manufacturing_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/manufacturing/users/jobs/query`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new IndustrializeManufactureQueryJobsResponse({}));
    }
    /**
     * 日清月结-计件报工查询接口
     *
     * @param request - IndustrializeManufactureQueryJobsRequest
     * @returns IndustrializeManufactureQueryJobsResponse
     */
    async industrializeManufactureQueryJobs(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new IndustrializeManufactureQueryJobsHeaders({});
        return await this.industrializeManufactureQueryJobsWithOptions(request, headers, runtime);
    }
}
exports.default = Client;
//# sourceMappingURL=client.js.map