import _regeneratorRuntime from '@babel/runtime/regenerator';
import { _ as __awaiter } from '../../tslib.es6-848120af.js';
import { fetchCloudData } from '../base/base.mjs';
import 'axios';
import '../../nodejs/crypto.mjs';

function createPrefetchTask(_ref) {
  var secretId = _ref.secretId,
    secretKey = _ref.secretKey,
    targets = _ref.targets,
    zoneId = _ref.zoneId;
  return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
    return _regeneratorRuntime.wrap(function (_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          return _context.abrupt("return", fetchCloudData({
            secretId: secretId,
            secretKey: secretKey,
            action: 'CreatePrefetchTask',
            version: '2022-09-01',
            endpoint: 'teo.tencentcloudapi.com',
            service: 'teo',
            payload: JSON.stringify({
              ZoneId: zoneId,
              Targets: targets
            })
          }));
        case 1:
        case "end":
          return _context.stop();
      }
    }, _callee);
  }));
}

export { createPrefetchTask };
