Socket
Socket
Sign inDemoInstall

azure-arm-resource

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-arm-resource - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

lib/models/operation.js

2

lib/lock/managementLockClient.js

@@ -71,3 +71,3 @@ /*

let baseUrl = this.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Features/operations';
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Authorization/operations';
let queryParameters = [];

@@ -74,0 +74,0 @@ queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion));

@@ -11,3 +11,3 @@ /*

import { ServiceClientCredentials } from 'ms-rest';
import { ServiceClient, ServiceClientOptions, ServiceCallback, HttpOperationResponse, ServiceClientCredentials } from 'ms-rest';
import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure';

@@ -62,4 +62,112 @@ import * as models from "./models";

applianceDefinitions: operations.ApplianceDefinitions;
/**
* Lists all of the available Microsoft.Solutions REST API operations.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<OperationListResult>} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
listOperationsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.OperationListResult>>;
/**
* Lists all of the available Microsoft.Solutions REST API operations.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {ServiceCallback} [optionalCallback] - The optional callback.
*
* @returns {ServiceCallback|Promise} If a callback was passed as the last
* parameter then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned.
*
* @resolve {OperationListResult} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
* {ServiceCallback} optionalCallback(err, result, request, response)
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
* {OperationListResult} [result] - The deserialized result object if an error did not occur.
* See {@link OperationListResult} for more information.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
listOperations(options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.OperationListResult>;
listOperations(callback: ServiceCallback<models.OperationListResult>): void;
listOperations(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.OperationListResult>): void;
/**
* Lists all of the available Microsoft.Solutions REST API operations.
*
* @param {string} nextPageLink The NextLink from the previous successful call
* to List operation.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<OperationListResult>} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
listOperationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.OperationListResult>>;
/**
* Lists all of the available Microsoft.Solutions REST API operations.
*
* @param {string} nextPageLink The NextLink from the previous successful call
* to List operation.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {ServiceCallback} [optionalCallback] - The optional callback.
*
* @returns {ServiceCallback|Promise} If a callback was passed as the last
* parameter then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned.
*
* @resolve {OperationListResult} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
* {ServiceCallback} optionalCallback(err, result, request, response)
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
* {OperationListResult} [result] - The deserialized result object if an error did not occur.
* See {@link OperationListResult} for more information.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
listOperationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.OperationListResult>;
listOperationsNext(nextPageLink: string, callback: ServiceCallback<models.OperationListResult>): void;
listOperationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.OperationListResult>): void;
}
export { ManagedApplicationClient, models as ManagedApplicationModels };

@@ -20,2 +20,3 @@ /*

const ServiceClient = msRestAzure.AzureServiceClient;
const WebResource = msRest.WebResource;

@@ -26,2 +27,258 @@ const models = require('./models');

/**
* Lists all of the available Microsoft.Solutions REST API operations.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} callback - The callback.
*
* @returns {function} callback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link OperationListResult} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
function _listOperations(options, callback) {
/* jshint validthis: true */
let client = this;
if(!callback && typeof options === 'function') {
callback = options;
options = null;
}
if (!callback) {
throw new Error('callback cannot be null.');
}
// Validate
try {
if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') {
throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.acceptLanguage must be of type string.');
}
} catch (error) {
return callback(error);
}
// Construct URL
let baseUrl = this.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Solutions/operations';
let queryParameters = [];
queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion));
if (queryParameters.length > 0) {
requestUrl += '?' + queryParameters.join('&');
}
// Create HTTP transport objects
let httpRequest = new WebResource();
httpRequest.method = 'GET';
httpRequest.url = requestUrl;
httpRequest.headers = {};
// Set Headers
httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
if (this.generateClientRequestId) {
httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
}
if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) {
httpRequest.headers['accept-language'] = this.acceptLanguage;
}
if(options) {
for(let headerName in options['customHeaders']) {
if (options['customHeaders'].hasOwnProperty(headerName)) {
httpRequest.headers[headerName] = options['customHeaders'][headerName];
}
}
}
httpRequest.body = null;
// Send Request
return client.pipeline(httpRequest, (err, response, responseBody) => {
if (err) {
return callback(err);
}
let statusCode = response.statusCode;
if (statusCode !== 200) {
let error = new Error(responseBody);
error.statusCode = response.statusCode;
error.request = msRest.stripRequest(httpRequest);
error.response = msRest.stripResponse(response);
if (responseBody === '') responseBody = null;
let parsedErrorResponse;
try {
parsedErrorResponse = JSON.parse(responseBody);
if (parsedErrorResponse) {
if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
}
if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
let resultMapper = new client.models['CloudError']().mapper();
error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
}
} catch (defaultError) {
error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
`- "${responseBody}" for the default response.`;
return callback(error);
}
return callback(error);
}
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
// Deserialize Response
if (statusCode === 200) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['OperationListResult']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
}
return callback(null, result, httpRequest, response);
});
}
/**
* Lists all of the available Microsoft.Solutions REST API operations.
*
* @param {string} nextPageLink The NextLink from the previous successful call
* to List operation.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} callback - The callback.
*
* @returns {function} callback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link OperationListResult} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
function _listOperationsNext(nextPageLink, options, callback) {
/* jshint validthis: true */
let client = this;
if(!callback && typeof options === 'function') {
callback = options;
options = null;
}
if (!callback) {
throw new Error('callback cannot be null.');
}
// Validate
try {
if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
}
if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.acceptLanguage must be of type string.');
}
} catch (error) {
return callback(error);
}
// Construct URL
let requestUrl = '{nextLink}';
requestUrl = requestUrl.replace('{nextLink}', nextPageLink);
// Create HTTP transport objects
let httpRequest = new WebResource();
httpRequest.method = 'GET';
httpRequest.url = requestUrl;
httpRequest.headers = {};
// Set Headers
httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
if (this.generateClientRequestId) {
httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
}
if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) {
httpRequest.headers['accept-language'] = this.acceptLanguage;
}
if(options) {
for(let headerName in options['customHeaders']) {
if (options['customHeaders'].hasOwnProperty(headerName)) {
httpRequest.headers[headerName] = options['customHeaders'][headerName];
}
}
}
httpRequest.body = null;
// Send Request
return client.pipeline(httpRequest, (err, response, responseBody) => {
if (err) {
return callback(err);
}
let statusCode = response.statusCode;
if (statusCode !== 200) {
let error = new Error(responseBody);
error.statusCode = response.statusCode;
error.request = msRest.stripRequest(httpRequest);
error.response = msRest.stripResponse(response);
if (responseBody === '') responseBody = null;
let parsedErrorResponse;
try {
parsedErrorResponse = JSON.parse(responseBody);
if (parsedErrorResponse) {
if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
}
if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
let resultMapper = new client.models['CloudError']().mapper();
error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
}
} catch (defaultError) {
error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
`- "${responseBody}" for the default response.`;
return callback(error);
}
return callback(error);
}
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
// Deserialize Response
if (statusCode === 200) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['OperationListResult']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
}
return callback(null, result, httpRequest, response);
});
}
/** Class representing a ManagedApplicationClient. */

@@ -80,5 +337,169 @@ class ManagedApplicationClient extends ServiceClient {

this.models = models;
this._listOperations = _listOperations;
this._listOperationsNext = _listOperationsNext;
msRest.addSerializationMixin(this);
}
/**
* Lists all of the available Microsoft.Solutions REST API operations.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<OperationListResult>} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
listOperationsWithHttpOperationResponse(options) {
let client = this;
let self = this;
return new Promise((resolve, reject) => {
self._listOperations(options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
return;
});
});
}
/**
* Lists all of the available Microsoft.Solutions REST API operations.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} [optionalCallback] - The optional callback.
*
* @returns {function|Promise} If a callback was passed as the last parameter
* then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned
*
* @resolve {OperationListResult} - The deserialized result object.
*
* @reject {Error} - The error object.
*
* {function} optionalCallback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link OperationListResult} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
listOperations(options, optionalCallback) {
let client = this;
let self = this;
if (!optionalCallback && typeof options === 'function') {
optionalCallback = options;
options = null;
}
if (!optionalCallback) {
return new Promise((resolve, reject) => {
self._listOperations(options, (err, result, request, response) => {
if (err) { reject(err); }
else { resolve(result); }
return;
});
});
} else {
return self._listOperations(options, optionalCallback);
}
}
/**
* Lists all of the available Microsoft.Solutions REST API operations.
*
* @param {string} nextPageLink The NextLink from the previous successful call
* to List operation.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<OperationListResult>} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
listOperationsNextWithHttpOperationResponse(nextPageLink, options) {
let client = this;
let self = this;
return new Promise((resolve, reject) => {
self._listOperationsNext(nextPageLink, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
return;
});
});
}
/**
* Lists all of the available Microsoft.Solutions REST API operations.
*
* @param {string} nextPageLink The NextLink from the previous successful call
* to List operation.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} [optionalCallback] - The optional callback.
*
* @returns {function|Promise} If a callback was passed as the last parameter
* then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned
*
* @resolve {OperationListResult} - The deserialized result object.
*
* @reject {Error} - The error object.
*
* {function} optionalCallback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link OperationListResult} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
listOperationsNext(nextPageLink, options, optionalCallback) {
let client = this;
let self = this;
if (!optionalCallback && typeof options === 'function') {
optionalCallback = options;
options = null;
}
if (!optionalCallback) {
return new Promise((resolve, reject) => {
self._listOperationsNext(nextPageLink, options, (err, result, request, response) => {
if (err) { reject(err); }
else { resolve(result); }
return;
});
});
} else {
return self._listOperationsNext(nextPageLink, options, optionalCallback);
}
}
}

@@ -85,0 +506,0 @@

@@ -42,3 +42,3 @@ /*

* @member {string} [plan.version] The plan's version.
* @member {string} kind The kind of the appliance. Allowed values are
* @member {string} [kind] The kind of the appliance. Allowed values are
* MarketPlace and ServiceCatalog.

@@ -185,3 +185,3 @@ */

kind: {
required: true,
required: false,
serializedName: 'kind',

@@ -188,0 +188,0 @@ constraints: {

@@ -111,3 +111,3 @@ /*

* @member {string} [plan.version] The plan's version.
* @member {string} kind The kind of the appliance. Allowed values are
* @member {string} [kind] The kind of the appliance. Allowed values are
* MarketPlace and ServiceCatalog.

@@ -123,3 +123,3 @@ */

plan?: Plan;
kind: string;
kind?: string;
}

@@ -304,5 +304,55 @@

/**
* @class
* Initializes a new instance of the OperationDisplay class.
* @constructor
* The object that represents the operation.
*
* @member {string} [provider] Service provider: Microsoft.Solutions
* @member {string} [resource] Resource on which the operation is performed:
* Profile, endpoint, etc.
* @member {string} [operation] Operation type: Read, write, delete, etc.
*/
export interface OperationDisplay {
provider?: string;
resource?: string;
operation?: string;
}
/**
* @class
* Initializes a new instance of the Operation class.
* @constructor
* Microsoft.Solutions operation
*
* @member {string} [name] Operation name: {provider}/{resource}/{operation}
* @member {object} [display] The object that represents the operation.
* @member {string} [display.provider] Service provider: Microsoft.Solutions
* @member {string} [display.resource] Resource on which the operation is
* performed: Profile, endpoint, etc.
* @member {string} [display.operation] Operation type: Read, write, delete,
* etc.
*/
export interface Operation {
name?: string;
display?: OperationDisplay;
}
/**
* @class
* Initializes a new instance of the OperationListResult class.
* @constructor
* Result of the request to list Microsoft.Solutions operations. It contains a
* list of operations and a URL link to get the next set of results.
*
* @member {string} [nextLink] URL to get the next set of operation list
* results if there are any.
*/
export interface OperationListResult extends Array<Operation> {
nextLink?: string;
}
/**
* @class
* Initializes a new instance of the ApplianceListResult class.

@@ -309,0 +359,0 @@ * @constructor

@@ -33,3 +33,6 @@ /*

exports.ErrorResponse = require('./errorResponse');
exports.OperationDisplay = require('./operationDisplay');
exports.Operation = require('./operation');
exports.OperationListResult = require('./operationListResult');
exports.ApplianceListResult = require('./applianceListResult');
exports.ApplianceDefinitionListResult = require('./applianceDefinitionListResult');

@@ -9,3 +9,3 @@ {

],
"version": "5.1.0",
"version": "5.1.1",
"description": "Microsoft Azure Resource Management Client Library for node",

@@ -12,0 +12,0 @@ "tags": [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc