"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// meta.ts
var meta_exports = {};
__export(meta_exports, {
  createDataExtensionSchema: () => createDataExtensionSchema2,
  deleteByWhiteListedMetaSite: () => deleteByWhiteListedMetaSite2,
  listDataExtensionSchemas: () => listDataExtensionSchemas2,
  updateDataExtensionSchema: () => updateDataExtensionSchema2
});
module.exports = __toCommonJS(meta_exports);

// src/data-extensions-v1-data-extension-schema-schemas.http.ts
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
function resolveWixInfraDataextensionsV1DataExtensionSchemaServiceUrl(opts) {
  const domainToMappings = {
    "manage._base_domain_": [
      {
        srcPath: "/schema-service",
        destPath: ""
      }
    ],
    _: [
      {
        srcPath: "/_api/schema-service",
        destPath: ""
      }
    ],
    "editor.wixapps.net": [
      {
        srcPath: "/_api/schema-service",
        destPath: ""
      }
    ],
    "www.wixapis.com": [
      {
        srcPath: "/schema-service",
        destPath: ""
      }
    ]
  };
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
}
var PACKAGE_NAME = "@wix/auto_sdk_data-extension-schema_schemas";
function createDataExtensionSchema(payload) {
  function __createDataExtensionSchema({ host }) {
    const serializedData = (0, import_transform_paths.transformPaths)(payload, [
      {
        transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
        paths: [
          { path: "dataExtensionSchema.updatedDate" },
          { path: "dataExtensionSchema.createdDate" }
        ]
      }
    ]);
    const metadata = {
      entityFqdn: "wix.data_extensions.v1.data_extension_schema",
      method: "POST",
      methodFqn: "wix.infra.dataextensions.v1.DataExtensionSchemaService.CreateDataExtensionSchema",
      packageName: PACKAGE_NAME,
      url: resolveWixInfraDataextensionsV1DataExtensionSchemaServiceUrl({
        protoPath: "/v1/schemas",
        data: serializedData,
        host
      }),
      data: serializedData,
      transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
        {
          transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
          paths: [
            { path: "dataExtensionSchema.updatedDate" },
            { path: "dataExtensionSchema.createdDate" }
          ]
        }
      ])
    };
    return metadata;
  }
  return __createDataExtensionSchema;
}
function updateDataExtensionSchema(payload) {
  function __updateDataExtensionSchema({ host }) {
    const serializedData = (0, import_transform_paths.transformPaths)(payload, [
      {
        transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
        paths: [
          { path: "dataExtensionSchema.updatedDate" },
          { path: "dataExtensionSchema.createdDate" }
        ]
      }
    ]);
    const metadata = {
      entityFqdn: "wix.data_extensions.v1.data_extension_schema",
      method: "PUT",
      methodFqn: "wix.infra.dataextensions.v1.DataExtensionSchemaService.UpdateDataExtensionSchema",
      packageName: PACKAGE_NAME,
      url: resolveWixInfraDataextensionsV1DataExtensionSchemaServiceUrl({
        protoPath: "/v1/schemas",
        data: serializedData,
        host
      }),
      data: serializedData,
      transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
        {
          transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
          paths: [
            { path: "dataExtensionSchema.updatedDate" },
            { path: "dataExtensionSchema.createdDate" }
          ]
        }
      ])
    };
    return metadata;
  }
  return __updateDataExtensionSchema;
}
function listDataExtensionSchemas(payload) {
  function __listDataExtensionSchemas({ host }) {
    const metadata = {
      entityFqdn: "wix.data_extensions.v1.data_extension_schema",
      method: "GET",
      methodFqn: "wix.infra.dataextensions.v1.DataExtensionSchemaService.ListDataExtensionSchemas",
      packageName: PACKAGE_NAME,
      url: resolveWixInfraDataextensionsV1DataExtensionSchemaServiceUrl({
        protoPath: "/v1/schemas",
        data: payload,
        host
      }),
      params: (0, import_rest_modules.toURLSearchParams)(payload),
      transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
        {
          transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
          paths: [
            { path: "dataExtensionSchemas.updatedDate" },
            { path: "dataExtensionSchemas.createdDate" }
          ]
        }
      ])
    };
    return metadata;
  }
  return __listDataExtensionSchemas;
}
function deleteByWhiteListedMetaSite(payload) {
  function __deleteByWhiteListedMetaSite({ host }) {
    const metadata = {
      entityFqdn: "wix.data_extensions.v1.data_extension_schema",
      method: "POST",
      methodFqn: "wix.infra.dataextensions.v1.DataExtensionSchemaService.DeleteByWhiteListedMetaSite",
      packageName: PACKAGE_NAME,
      url: resolveWixInfraDataextensionsV1DataExtensionSchemaServiceUrl({
        protoPath: "/v1/schemas/delete-by-white-listed-meta-site",
        data: payload,
        host
      }),
      data: payload
    };
    return metadata;
  }
  return __deleteByWhiteListedMetaSite;
}

// src/data-extensions-v1-data-extension-schema-schemas.meta.ts
function createDataExtensionSchema2() {
  const payload = {};
  const getRequestOptions = createDataExtensionSchema(
    payload
  );
  const getUrl = (context) => {
    const { url } = getRequestOptions(context);
    return url;
  };
  return {
    getUrl,
    httpMethod: "POST",
    path: "/v1/schemas",
    pathParams: {},
    __requestType: null,
    __originalRequestType: null,
    __responseType: null,
    __originalResponseType: null
  };
}
function updateDataExtensionSchema2() {
  const payload = {};
  const getRequestOptions = updateDataExtensionSchema(
    payload
  );
  const getUrl = (context) => {
    const { url } = getRequestOptions(context);
    return url;
  };
  return {
    getUrl,
    httpMethod: "PUT",
    path: "/v1/schemas",
    pathParams: {},
    __requestType: null,
    __originalRequestType: null,
    __responseType: null,
    __originalResponseType: null
  };
}
function listDataExtensionSchemas2() {
  const payload = {};
  const getRequestOptions = listDataExtensionSchemas(
    payload
  );
  const getUrl = (context) => {
    const { url } = getRequestOptions(context);
    return url;
  };
  return {
    getUrl,
    httpMethod: "GET",
    path: "/v1/schemas",
    pathParams: {},
    __requestType: null,
    __originalRequestType: null,
    __responseType: null,
    __originalResponseType: null
  };
}
function deleteByWhiteListedMetaSite2() {
  const payload = {};
  const getRequestOptions = deleteByWhiteListedMetaSite(
    payload
  );
  const getUrl = (context) => {
    const { url } = getRequestOptions(context);
    return url;
  };
  return {
    getUrl,
    httpMethod: "POST",
    path: "/v1/schemas/delete-by-white-listed-meta-site",
    pathParams: {},
    __requestType: null,
    __originalRequestType: null,
    __responseType: null,
    __originalResponseType: null
  };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  createDataExtensionSchema,
  deleteByWhiteListedMetaSite,
  listDataExtensionSchemas,
  updateDataExtensionSchema
});
//# sourceMappingURL=meta.js.map