// src/data-extensions-v1-data-extension-schema-schemas.http.ts
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
import { resolveUrl } from "@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 resolveUrl(Object.assign(opts, { domainToMappings }));
}
var PACKAGE_NAME = "@wix/auto_sdk_data-extension-schema_schemas";
function createDataExtensionSchema(payload) {
  function __createDataExtensionSchema({ host }) {
    const serializedData = transformPaths(payload, [
      {
        transformFn: 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) => transformPaths(payload2, [
        {
          transformFn: transformRESTTimestampToSDKTimestamp,
          paths: [
            { path: "dataExtensionSchema.updatedDate" },
            { path: "dataExtensionSchema.createdDate" }
          ]
        }
      ])
    };
    return metadata;
  }
  return __createDataExtensionSchema;
}
function updateDataExtensionSchema(payload) {
  function __updateDataExtensionSchema({ host }) {
    const serializedData = transformPaths(payload, [
      {
        transformFn: 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) => transformPaths(payload2, [
        {
          transformFn: 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: toURLSearchParams(payload),
      transformResponse: (payload2) => transformPaths(payload2, [
        {
          transformFn: 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
  };
}
export {
  createDataExtensionSchema2 as createDataExtensionSchema,
  deleteByWhiteListedMetaSite2 as deleteByWhiteListedMetaSite,
  listDataExtensionSchemas2 as listDataExtensionSchemas,
  updateDataExtensionSchema2 as updateDataExtensionSchema
};
//# sourceMappingURL=meta.mjs.map