UNPKG

@azure/storage-file-share

Version:
141 lines 4.5 kB
"use strict"; /* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.ServiceImpl = void 0; const tslib_1 = require("tslib"); const coreClient = tslib_1.__importStar(require("@azure/core-client")); const Mappers = tslib_1.__importStar(require("../models/mappers.js")); const Parameters = tslib_1.__importStar(require("../models/parameters.js")); /** Class containing Service operations. */ 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 File service endpoint, including properties for Storage * Analytics metrics 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 File service, including properties for Storage Analytics * metrics and CORS (Cross-Origin Resource Sharing) rules. * @param options The options parameters. */ getProperties(options) { return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec); } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the * specified account. * @param options The options parameters. */ listSharesSegment(options) { return this.client.sendOperationRequest({ options }, listSharesSegmentOperationSpec); } } exports.ServiceImpl = ServiceImpl; // Operation Specifications 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.fileRequestIntent ], isXML: true, contentType: "application/xml; charset=utf-8", mediaType: "xml", serializer: xmlSerializer }; const getPropertiesOperationSpec = { path: "/", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.FileServiceProperties, headersMapper: Mappers.ServiceGetPropertiesHeaders }, default: { bodyMapper: Mappers.StorageError, headersMapper: Mappers.ServiceGetPropertiesExceptionHeaders } }, queryParameters: [ Parameters.restype, Parameters.comp, Parameters.timeoutInSeconds ], urlParameters: [Parameters.url], headerParameters: [ Parameters.version, Parameters.fileRequestIntent, Parameters.accept1 ], isXML: true, serializer: xmlSerializer }; const listSharesSegmentOperationSpec = { path: "/", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ListSharesResponse, headersMapper: Mappers.ServiceListSharesSegmentHeaders }, default: { bodyMapper: Mappers.StorageError, headersMapper: Mappers.ServiceListSharesSegmentExceptionHeaders } }, queryParameters: [ Parameters.timeoutInSeconds, Parameters.comp1, Parameters.prefix, Parameters.marker, Parameters.maxResults, Parameters.include ], urlParameters: [Parameters.url], headerParameters: [ Parameters.version, Parameters.fileRequestIntent, Parameters.accept1 ], isXML: true, serializer: xmlSerializer }; //# sourceMappingURL=service.js.map