@azure/storage-queue
Version:
Microsoft Azure Storage SDK for JavaScript - Queue
258 lines (257 loc) • 7.47 kB
JavaScript
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 service_exports = {};
__export(service_exports, {
ServiceImpl: () => ServiceImpl
});
module.exports = __toCommonJS(service_exports);
var coreClient = __toESM(require("@azure/core-client"));
var Mappers = __toESM(require("../models/mappers.js"));
var Parameters = __toESM(require("../models/parameters.js"));
class ServiceImpl {
client;
/**
* Initialize a new instance of the class Service class.
* @param client Reference to the service client
*/
constructor(client) {
this.client = client;
}
/**
* Sets properties for a storage account's Queue service endpoint, including properties for Storage
* Analytics and CORS (Cross-Origin Resource Sharing) rules
* @param properties The StorageService properties.
* @param options The options parameters.
*/
setProperties(properties, options) {
return this.client.sendOperationRequest(
{ properties, options },
setPropertiesOperationSpec
);
}
/**
* gets the properties of a storage account's Queue service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param options The options parameters.
*/
getProperties(options) {
return this.client.sendOperationRequest(
{ options },
getPropertiesOperationSpec
);
}
/**
* Retrieves statistics related to replication for the Queue service. It is only available on the
* secondary location endpoint when read-access geo-redundant replication is enabled for the storage
* account.
* @param options The options parameters.
*/
getStatistics(options) {
return this.client.sendOperationRequest(
{ options },
getStatisticsOperationSpec
);
}
/**
* Retrieves a user delegation key for the Queue service. This is only a valid operation when using
* bearer token authentication.
* @param keyInfo Key information
* @param options The options parameters.
*/
getUserDelegationKey(keyInfo, options) {
return this.client.sendOperationRequest(
{ keyInfo, options },
getUserDelegationKeyOperationSpec
);
}
/**
* The List Queues Segment operation returns a list of the queues under the specified account
* @param options The options parameters.
*/
listQueuesSegment(options) {
return this.client.sendOperationRequest(
{ options },
listQueuesSegmentOperationSpec
);
}
}
const xmlSerializer = coreClient.createSerializer(
Mappers,
/* isXml */
true
);
const setPropertiesOperationSpec = {
path: "/",
httpMethod: "PUT",
responses: {
202: {
headersMapper: Mappers.ServiceSetPropertiesHeaders
},
default: {
bodyMapper: Mappers.StorageError,
headersMapper: Mappers.ServiceSetPropertiesExceptionHeaders
}
},
requestBody: Parameters.properties,
queryParameters: [
Parameters.restype,
Parameters.comp,
Parameters.timeoutInSeconds
],
urlParameters: [Parameters.url],
headerParameters: [
Parameters.contentType,
Parameters.accept,
Parameters.version,
Parameters.requestId
],
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer
};
const getPropertiesOperationSpec = {
path: "/",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.QueueServiceProperties,
headersMapper: Mappers.ServiceGetPropertiesHeaders
},
default: {
bodyMapper: Mappers.StorageError,
headersMapper: Mappers.ServiceGetPropertiesExceptionHeaders
}
},
queryParameters: [
Parameters.restype,
Parameters.comp,
Parameters.timeoutInSeconds
],
urlParameters: [Parameters.url],
headerParameters: [
Parameters.version,
Parameters.requestId,
Parameters.accept1
],
isXML: true,
serializer: xmlSerializer
};
const getStatisticsOperationSpec = {
path: "/",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.QueueServiceStatistics,
headersMapper: Mappers.ServiceGetStatisticsHeaders
},
default: {
bodyMapper: Mappers.StorageError,
headersMapper: Mappers.ServiceGetStatisticsExceptionHeaders
}
},
queryParameters: [
Parameters.restype,
Parameters.timeoutInSeconds,
Parameters.comp1
],
urlParameters: [Parameters.url],
headerParameters: [
Parameters.version,
Parameters.requestId,
Parameters.accept1
],
isXML: true,
serializer: xmlSerializer
};
const getUserDelegationKeyOperationSpec = {
path: "/",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.UserDelegationKey,
headersMapper: Mappers.ServiceGetUserDelegationKeyHeaders
},
default: {
bodyMapper: Mappers.StorageError,
headersMapper: Mappers.ServiceGetUserDelegationKeyExceptionHeaders
}
},
requestBody: Parameters.keyInfo,
queryParameters: [
Parameters.restype,
Parameters.timeoutInSeconds,
Parameters.comp2
],
urlParameters: [Parameters.url],
headerParameters: [
Parameters.contentType,
Parameters.accept,
Parameters.version,
Parameters.requestId
],
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer
};
const listQueuesSegmentOperationSpec = {
path: "/",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ListQueuesSegmentResponse,
headersMapper: Mappers.ServiceListQueuesSegmentHeaders
},
default: {
bodyMapper: Mappers.StorageError,
headersMapper: Mappers.ServiceListQueuesSegmentExceptionHeaders
}
},
queryParameters: [
Parameters.timeoutInSeconds,
Parameters.comp3,
Parameters.prefix,
Parameters.marker,
Parameters.maxPageSize,
Parameters.include
],
urlParameters: [Parameters.url],
headerParameters: [
Parameters.version,
Parameters.requestId,
Parameters.accept1
],
isXML: true,
serializer: xmlSerializer
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ServiceImpl
});
//# sourceMappingURL=service.js.map