functions/node_modules/googleapis/build/src/lib/discovery.js
/**
 * Given a method schema, add a method to a target.
 *
 * @private
 * @param {object} target The target to which to add the method.
 * @param {object} schema The top-level schema that contains the rootUrl, etc.
 * @param {object} method The method schema from which to generate the method.
 * @param {object} context The context to add to the method.
 */
Given a method schema, add a method to a target.
@private
@param {object} target The target to which to add the method.
@param {object} schema The top-level schema that contains the rootUrl, etc.
@param {object} method The method schema from which to generate the method.
@param {object} context The context to add to the method.
Given a method schema add a method to a target . @private @param { object } target The target to which to add the method . @param { object } schema The top - level schema that contains the rootUrl etc . @param { object } method The method schema from which to generate the method . @param { object } context The context to add to the method .
function makeMethod(schema, method, context) {
    return function (params, callback) {
        var schemaUrl = generator_utils_1.buildurl(schema.rootUrl + schema.servicePath + method.path);
        var parameters = {
            options: {
                url: schemaUrl.substring(1, schemaUrl.length - 1),
                method: method.httpMethod
            },
            params: params,
            requiredParams: method.parameterOrder || [],
            pathParams: getPathParams(method.parameters),
            context: context,
            mediaUrl: null
        };
        if (method.mediaUpload && method.mediaUpload.protocols &&
            method.mediaUpload.protocols.simple &&
            method.mediaUpload.protocols.simple.path) {
            var mediaUrl = generator_utils_1.buildurl(schema.rootUrl + method.mediaUpload.protocols.simple.path);
            parameters.mediaUrl = mediaUrl.substring(1, mediaUrl.length - 1);
        }
        return apirequest_1.createAPIRequest(parameters, callback);
    };
}
function makeMethod ( schema , method , context ) { return function ( params , callback ) { var schemaUrl = generator_utils_1 . buildurl ( schema . rootUrl + schema . servicePath + method . path ) ; var parameters = { options : { url : schemaUrl . substring ( 1 , schemaUrl . length - 1 ) , method : method . httpMethod } , params : params , requiredParams : method . parameterOrder || [ ] , pathParams : getPathParams ( method . parameters ) , context : context , mediaUrl : null } ; if ( method . mediaUpload && method . mediaUpload . protocols && method . mediaUpload . protocols . simple && method . mediaUpload . protocols . simple . path ) { var mediaUrl = generator_utils_1 . buildurl ( schema . rootUrl + method . mediaUpload . protocols . simple . path ) ; parameters . mediaUrl = mediaUrl . substring ( 1 , mediaUrl . length - 1 ) ; } return apirequest_1 . createAPIRequest ( parameters , callback ) ; } ; }
Given a method schema, add a method to a target.
Given a method schema add a method to a target .