lib/collection/request.js
function (type, options) {
        if (_.isObject(type) && _.isNil(options)) {
            type = options.type;
            options = _.omit(options, 'type');
        }

        // null = delete request
        if (type === null) {
            _.has(this, 'auth') && (delete this.auth);
            return;
        }

        if (!RequestAuth.isValidType(type)) {
            return;
        }

        // create a new authentication data
        if (!this.auth) {
            this.auth = new RequestAuth(null, this);
        }
        else {
            this.auth.clear(type);
        }

        this.auth.use(type, options);
    }
function (type, options) {
        if (_.isObject(type) && _.isNil(options)) {
            type = options.type;
            options = _.omit(options, 'type');
        }

        // null = delete request
        if (type === null) {
            _.has(this, 'auth') && (delete this.auth);
            return;
        }

        if (!RequestAuth.isValidType(type)) {
            return;
        }

        // create a new authentication data
        if (!this.auth) {
            this.auth = new RequestAuth(null, this);
        }
        else {
            this.auth.clear(type);
        }

        this.auth.use(type, options);
    }
function ( type , options ) { if ( _ . isObject ( type ) && _ . isNil ( options ) ) { type = options . type ; options = _ . omit ( options , 'type' ) ; } // null = delete request if ( type === null ) { _ . has ( this , 'auth' ) && ( delete this . auth ) ; return ; } if ( ! RequestAuth . isValidType ( type ) ) { return ; } // create a new authentication data if ( ! this . auth ) { this . auth = new RequestAuth ( null , this ) ; } else { this . auth . clear ( type ) ; } this . auth . use ( type , options ) ; }
Sets authentication method for the request

@param {?String|RequestAuth~definition} type
@param {VariableList~definition=} [options]

@note This function was previously (in v2 of SDK) used to clone request and populate headers. Now it is used to
only set auth information to request

@note that ItemGroup#authorizeUsing depends on this function
Sets authentication method for the request