How to use the ms-rest-js.promiseToCallback function in ms-rest-js

To help you get started, we’ve selected a few ms-rest-js 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 / autorest.typescript / test / azure / dist / Expected / AcceptanceTests / CustomBaseUri / operations / paths.js View on Github external
getEmpty(accountName, options, callback) {
        if (!callback && typeof options === 'function') {
            callback = options;
            options = undefined;
        }
        let cb = callback;
        if (!callback) {
            return this.getEmptyWithHttpOperationResponse(accountName, options).then((operationRes) => {
                return Promise.resolve(operationRes.bodyAsJson);
            }).catch((err) => {
                return Promise.reject(err);
            });
        }
        else {
            msRest.promiseToCallback(this.getEmptyWithHttpOperationResponse(accountName, options))((err, data) => {
                if (err) {
                    return cb(err);
                }
                let result = data.bodyAsJson;
                return cb(err, result, data.request, data.response);
            });
        }
    }
}
github Azure / autorest.typescript / test / vanilla / dist / Expected / AcceptanceTests / CustomBaseUriMoreOptions / operations / paths.js View on Github external
getEmpty(vault, secret, keyName, options, callback) {
        if (!callback && typeof options === 'function') {
            callback = options;
            options = undefined;
        }
        let cb = callback;
        if (!callback) {
            return this.getEmptyWithHttpOperationResponse(vault, secret, keyName, options).then((operationRes) => {
                return Promise.resolve(operationRes.bodyAsJson);
            }).catch((err) => {
                return Promise.reject(err);
            });
        }
        else {
            msRest.promiseToCallback(this.getEmptyWithHttpOperationResponse(vault, secret, keyName, options))((err, data) => {
                if (err) {
                    return cb(err);
                }
                let result = data.bodyAsJson;
                return cb(err, result, data.request, data.response);
            });
        }
    }
}
github Azure / autorest.typescript / test / vanilla / dist / Expected / AcceptanceTests / CustomBaseUri / operations / paths.js View on Github external
getEmpty(accountName, options, callback) {
        if (!callback && typeof options === 'function') {
            callback = options;
            options = undefined;
        }
        let cb = callback;
        if (!callback) {
            return this.getEmptyWithHttpOperationResponse(accountName, options).then((operationRes) => {
                return Promise.resolve(operationRes.bodyAsJson);
            }).catch((err) => {
                return Promise.reject(err);
            });
        }
        else {
            msRest.promiseToCallback(this.getEmptyWithHttpOperationResponse(accountName, options))((err, data) => {
                if (err) {
                    return cb(err);
                }
                let result = data.bodyAsJson;
                return cb(err, result, data.request, data.response);
            });
        }
    }
}
github Azure / autorest.typescript / test / vanilla / dist / Expected / AcceptanceTests / BodyComplex / operations / arrayModel.js View on Github external
getEmpty(options, callback) {
        if (!callback && typeof options === 'function') {
            callback = options;
            options = undefined;
        }
        let cb = callback;
        if (!callback) {
            return this.getEmptyWithHttpOperationResponse(options).then((operationRes) => {
                return Promise.resolve(operationRes.bodyAsJson);
            }).catch((err) => {
                return Promise.reject(err);
            });
        }
        else {
            msRest.promiseToCallback(this.getEmptyWithHttpOperationResponse(options))((err, data) => {
                if (err) {
                    return cb(err);
                }
                let result = data.bodyAsJson;
                return cb(err, result, data.request, data.response);
            });
        }
    }
    putEmpty(options, callback) {
github Azure / autorest.typescript / test / vanilla / dist / Expected / AcceptanceTests / BodyComplex / operations / basicOperations.js View on Github external
getEmpty(options, callback) {
        if (!callback && typeof options === 'function') {
            callback = options;
            options = undefined;
        }
        let cb = callback;
        if (!callback) {
            return this.getEmptyWithHttpOperationResponse(options).then((operationRes) => {
                return Promise.resolve(operationRes.bodyAsJson);
            }).catch((err) => {
                return Promise.reject(err);
            });
        }
        else {
            msRest.promiseToCallback(this.getEmptyWithHttpOperationResponse(options))((err, data) => {
                if (err) {
                    return cb(err);
                }
                let result = data.bodyAsJson;
                return cb(err, result, data.request, data.response);
            });
        }
    }
    getNull(options, callback) {

ms-rest-js

Isomorphic client Runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest

MIT
Latest version published 6 years ago

Package Health Score

47 / 100
Full package analysis