How to use the azure-common.xmlbuilder function in azure-common

To help you get started, we’ve selected a few azure-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-node / lib / services / legacyStorage / lib / servicepropertiesresult.js View on Github external
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Module dependencies.
var azureCommon = require('azure-common');
var xmlbuilder = azureCommon.xmlbuilder;
var Constants = azureCommon.Constants;

exports = module.exports;

exports.serialize = function (servicePropertiesJs) {
  var doc = xmlbuilder.create();
  doc = doc.begin(Constants.STORAGE_SERVICE_PROPERTIES_ELEMENT, { version: '1.0', encoding: 'utf-8' });

  if (typeof servicePropertiesJs.Logging !== 'undefined') {
    doc = doc.ele(Constants.LOGGING_ELEMENT);
    if (servicePropertiesJs.Logging.Version) {
      doc = doc.ele(Constants.VERSION_ELEMENT)
              .txt(servicePropertiesJs.Logging.Version)
            .up();
    }
github Azure / azure-sdk-for-node / lib / services / legacyStorage / lib / blocklistresult.js View on Github external
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Module dependencies.
var azureCommon = require('azure-common');
var xmlbuilder = azureCommon.xmlbuilder;
var Constants = azureCommon.Constants;

function BlockListResult(committedBlocks, uncommittedBlocks, latestBlocks) {
  if (latestBlocks) {
    this.LatestBlocks = latestBlocks;
  }

  if (committedBlocks) {
    this.CommittedBlocks = committedBlocks;
  }

  if (uncommittedBlocks) {
    this.UncommittedBlocks = uncommittedBlocks;
  }
}
github Azure / azure-sdk-for-node / lib / services / legacyStorage / lib / queue / models / queuemessageresult.js View on Github external
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Module dependencies.
var azureCommon = require('azure-common');
var xmlbuilder = azureCommon.xmlbuilder;
var Constants = azureCommon.Constants;

var HeaderConstants = Constants.HeaderConstants;

function QueueMessageResult(queue, messageid, popreceipt, metadata) {
  if (queue) {
    this.queue = queue;
  }

  if (messageid) {
    this.messageid = messageid;
  }

  if (popreceipt) {
    this.popreceipt = popreceipt;
  }
github Azure / azure-sdk-for-node / lib / services / legacyStorage / lib / queue / models / servicepropertiesresult.js View on Github external
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Module dependencies.
var azureCommon = require('azure-common');
var xmlbuilder = azureCommon.xmlbuilder;
var Constants = azureCommon.Constants;

exports = module.exports;

exports.serialize = function (servicePropertiesJs) {
  var doc = xmlbuilder.create();
  doc = doc.begin(Constants.STORAGE_SERVICE_PROPERTIES_ELEMENT, { version: '1.0', encoding: 'utf-8' });

  if (typeof servicePropertiesJs.Logging !== 'undefined') {
    doc = doc.ele(Constants.LOGGING_ELEMENT);
    if (servicePropertiesJs.Logging.Version) {
      doc = doc.ele(Constants.VERSION_ELEMENT)
              .txt(servicePropertiesJs.Logging.Version)
            .up();
    }
github Azure / azure-sdk-for-node / lib / services / legacyStorage / lib / table / models / servicepropertiesresult.js View on Github external
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Module dependencies.
var azureCommon = require('azure-common');
var xmlbuilder = azureCommon.xmlbuilder;
var Constants = azureCommon.Constants;

// Expose 'ServicePropertiesResult'.
var exports = module.exports;

exports.serialize = function (servicePropertiesJs) {
  var doc = xmlbuilder.create();
  doc = doc.begin(Constants.STORAGE_SERVICE_PROPERTIES_ELEMENT, { version: '1.0', encoding: 'utf-8' });

  if (typeof servicePropertiesJs.Logging !== 'undefined') {
    doc = doc.ele(Constants.LOGGING_ELEMENT);
    if (servicePropertiesJs.Logging.Version) {
      doc = doc.ele(Constants.VERSION_ELEMENT)
              .txt(servicePropertiesJs.Logging.Version)
            .up();
    }
github Azure / azure-sdk-for-node / lib / services / legacyStorage / lib / containeraclresult.js View on Github external
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Module dependencies.
var _ = require('underscore');

var azureCommon = require('azure-common');
var xmlbuilder = azureCommon.xmlbuilder;
var azureutil = azureCommon.util;
var Constants = azureCommon.Constants;
var ISO8061Date = azureCommon.ISO8061Date;

function ContainerAclResult(signedIdentifiers) {
  if (signedIdentifiers) {
    this.signedIdentifiers = signedIdentifiers;
  }
}

/**
* Builds an XML representation for container acl permissions.
*
* @param  {array}  entity The signed identifiers.
* @return {string} The XML container acl permissions.
*/