import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  resolveUrl,
  serializer,
  toURLSearchParams
} from "./chunk-HWT3LUJJ.js";
import {
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// ../../node_modules/@wix/ambassador-document-management-editor-deployments-v1-deployment/build/es/http.impl.js
init_esm_shims();
var _deployment = {
  updatedDate: "google.protobuf.Timestamp",
  createdDate: "google.protobuf.Timestamp"
};
var _getDeploymentPipelineDescriptionRequest = {};
var _getDeploymentPipelineDescriptionResponse = {};
var _getDeploymentRequest = {};
var _getDeploymentResponse = { deployment: "_deployment" };
var _publishDeploymentRequest = {};
var _publishDeploymentResponse = { deployment: "_deployment" };
function resolveWixEditorDeploymentsV1DeploymentsServiceUrl(opts) {
  var domainToMappings = {
    "www._base_domain_": [
      {
        srcPath: "/_api/editor-deployments",
        destPath: ""
      }
    ],
    "editor._base_domain_": [
      {
        srcPath: "/_api/editor-deployments",
        destPath: ""
      }
    ],
    "blocks._base_domain_": [
      {
        srcPath: "/_api/editor-deployments",
        destPath: ""
      }
    ],
    "create.editorx": [
      {
        srcPath: "/_api/editor-deployments",
        destPath: ""
      }
    ]
  };
  return resolveUrl(Object.assign(opts, { domainToMappings }));
}
function getDeployment(payload) {
  var _a = serializer(_getDeploymentRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_getDeploymentResponse, {
    _deployment
  }).fromJSON;
  function __getDeployment(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.document_management.editor_deployments.v1.deployment",
      method: "GET",
      methodFqn: "wix.editor.deployments.v1.DeploymentsService.GetDeployment",
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveWixEditorDeploymentsV1DeploymentsServiceUrl({
        protoPath: "/v1/deployments/{deploymentId}",
        data: serializedData,
        host
      }),
      params: toURLSearchParams(serializedData),
      transformResponse: fromRes
    };
    return metadata;
  }
  __getDeployment.fromReq = fromReq;
  __getDeployment.__isAmbassador = true;
  return __getDeployment;
}
function publishDeployment(payload) {
  var _a = serializer(_publishDeploymentRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_publishDeploymentResponse, {
    _deployment
  }).fromJSON;
  function __publishDeployment(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.document_management.editor_deployments.v1.deployment",
      method: "POST",
      methodFqn: "wix.editor.deployments.v1.DeploymentsService.PublishDeployment",
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveWixEditorDeploymentsV1DeploymentsServiceUrl({
        protoPath: "/v1/deployments/{deploymentId}",
        data: serializedData,
        host
      }),
      data: serializedData,
      transformResponse: fromRes
    };
    return metadata;
  }
  __publishDeployment.fromReq = fromReq;
  __publishDeployment.__isAmbassador = true;
  return __publishDeployment;
}
function getDeploymentPipelineDescription(payload) {
  var _a = serializer(_getDeploymentPipelineDescriptionRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_getDeploymentPipelineDescriptionResponse, {}).fromJSON;
  function __getDeploymentPipelineDescription(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.document_management.editor_deployments.v1.deployment",
      method: "GET",
      methodFqn: "wix.editor.deployments.v1.DeploymentsService.GetDeploymentPipelineDescription",
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveWixEditorDeploymentsV1DeploymentsServiceUrl({
        protoPath: "/v1/deployments/pipeline/{deploymentId}",
        data: serializedData,
        host
      }),
      params: toURLSearchParams(serializedData),
      transformResponse: fromRes
    };
    return metadata;
  }
  __getDeploymentPipelineDescription.fromReq = fromReq;
  __getDeploymentPipelineDescription.__isAmbassador = true;
  return __getDeploymentPipelineDescription;
}

export {
  getDeployment,
  publishDeployment,
  getDeploymentPipelineDescription
};
//# sourceMappingURL=chunk-7IUEU3FM.js.map