var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var queue_exports = {};
__export(queue_exports, {
  QueueImpl: () => QueueImpl
});
module.exports = __toCommonJS(queue_exports);
var coreClient = __toESM(require("@azure/core-client"));
var Mappers = __toESM(require("../models/mappers.js"));
var Parameters = __toESM(require("../models/parameters.js"));
class QueueImpl {
  client;
  /**
   * Initialize a new instance of the class Queue class.
   * @param client Reference to the service client
   */
  constructor(client) {
    this.client = client;
  }
  /**
   * creates a new queue under the given account.
   * @param options The options parameters.
   */
  create(options) {
    return this.client.sendOperationRequest({ options }, createOperationSpec);
  }
  /**
   * operation permanently deletes the specified queue
   * @param options The options parameters.
   */
  delete(options) {
    return this.client.sendOperationRequest({ options }, deleteOperationSpec);
  }
  /**
   * Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated
   * with the queue as name-values pairs.
   * @param options The options parameters.
   */
  getProperties(options) {
    return this.client.sendOperationRequest(
      { options },
      getPropertiesOperationSpec
    );
  }
  /**
   * sets user-defined metadata on the specified queue. Metadata is associated with the queue as
   * name-value pairs.
   * @param options The options parameters.
   */
  setMetadata(options) {
    return this.client.sendOperationRequest(
      { options },
      setMetadataOperationSpec
    );
  }
  /**
   * returns details about any stored access policies specified on the queue that may be used with Shared
   * Access Signatures.
   * @param options The options parameters.
   */
  getAccessPolicy(options) {
    return this.client.sendOperationRequest(
      { options },
      getAccessPolicyOperationSpec
    );
  }
  /**
   * sets stored access policies for the queue that may be used with Shared Access Signatures
   * @param options The options parameters.
   */
  setAccessPolicy(options) {
    return this.client.sendOperationRequest(
      { options },
      setAccessPolicyOperationSpec
    );
  }
}
const xmlSerializer = coreClient.createSerializer(
  Mappers,
  /* isXml */
  true
);
const createOperationSpec = {
  path: "/{queueName}",
  httpMethod: "PUT",
  responses: {
    201: {
      headersMapper: Mappers.QueueCreateHeaders
    },
    204: {
      headersMapper: Mappers.QueueCreateHeaders
    },
    default: {
      bodyMapper: Mappers.StorageError,
      headersMapper: Mappers.QueueCreateExceptionHeaders
    }
  },
  queryParameters: [Parameters.timeoutInSeconds],
  urlParameters: [Parameters.url],
  headerParameters: [
    Parameters.version,
    Parameters.requestId,
    Parameters.accept1,
    Parameters.metadata
  ],
  isXML: true,
  serializer: xmlSerializer
};
const deleteOperationSpec = {
  path: "/{queueName}",
  httpMethod: "DELETE",
  responses: {
    204: {
      headersMapper: Mappers.QueueDeleteHeaders
    },
    default: {
      bodyMapper: Mappers.StorageError,
      headersMapper: Mappers.QueueDeleteExceptionHeaders
    }
  },
  queryParameters: [Parameters.timeoutInSeconds],
  urlParameters: [Parameters.url],
  headerParameters: [
    Parameters.version,
    Parameters.requestId,
    Parameters.accept1
  ],
  isXML: true,
  serializer: xmlSerializer
};
const getPropertiesOperationSpec = {
  path: "/{queueName}",
  httpMethod: "GET",
  responses: {
    200: {
      headersMapper: Mappers.QueueGetPropertiesHeaders
    },
    default: {
      bodyMapper: Mappers.StorageError,
      headersMapper: Mappers.QueueGetPropertiesExceptionHeaders
    }
  },
  queryParameters: [Parameters.timeoutInSeconds, Parameters.comp4],
  urlParameters: [Parameters.url],
  headerParameters: [
    Parameters.version,
    Parameters.requestId,
    Parameters.accept1
  ],
  isXML: true,
  serializer: xmlSerializer
};
const setMetadataOperationSpec = {
  path: "/{queueName}",
  httpMethod: "PUT",
  responses: {
    204: {
      headersMapper: Mappers.QueueSetMetadataHeaders
    },
    default: {
      bodyMapper: Mappers.StorageError,
      headersMapper: Mappers.QueueSetMetadataExceptionHeaders
    }
  },
  queryParameters: [Parameters.timeoutInSeconds, Parameters.comp4],
  urlParameters: [Parameters.url],
  headerParameters: [
    Parameters.version,
    Parameters.requestId,
    Parameters.accept1,
    Parameters.metadata
  ],
  isXML: true,
  serializer: xmlSerializer
};
const getAccessPolicyOperationSpec = {
  path: "/{queueName}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: {
        type: {
          name: "Sequence",
          element: {
            type: { name: "Composite", className: "SignedIdentifier" }
          }
        },
        serializedName: "SignedIdentifiers",
        xmlName: "SignedIdentifiers",
        xmlIsWrapped: true,
        xmlElementName: "SignedIdentifier"
      },
      headersMapper: Mappers.QueueGetAccessPolicyHeaders
    },
    default: {
      bodyMapper: Mappers.StorageError,
      headersMapper: Mappers.QueueGetAccessPolicyExceptionHeaders
    }
  },
  queryParameters: [Parameters.timeoutInSeconds, Parameters.comp5],
  urlParameters: [Parameters.url],
  headerParameters: [
    Parameters.version,
    Parameters.requestId,
    Parameters.accept1
  ],
  isXML: true,
  serializer: xmlSerializer
};
const setAccessPolicyOperationSpec = {
  path: "/{queueName}",
  httpMethod: "PUT",
  responses: {
    204: {
      headersMapper: Mappers.QueueSetAccessPolicyHeaders
    },
    default: {
      bodyMapper: Mappers.StorageError,
      headersMapper: Mappers.QueueSetAccessPolicyExceptionHeaders
    }
  },
  requestBody: Parameters.queueAcl,
  queryParameters: [Parameters.timeoutInSeconds, Parameters.comp5],
  urlParameters: [Parameters.url],
  headerParameters: [
    Parameters.contentType,
    Parameters.accept,
    Parameters.version,
    Parameters.requestId
  ],
  isXML: true,
  contentType: "application/xml; charset=utf-8",
  mediaType: "xml",
  serializer: xmlSerializer
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  QueueImpl
});
//# sourceMappingURL=queue.js.map
