src/assets/assets-builder.js
function(data) {
      return this.request({
        url: this._buildUri(this.uri),
        method: corbel.request.method.POST,
        data: data
      }).
      then(function(res) {
        return corbel.Services.getLocationId(res);
      });
    }
function(data) {
      return this.request({
        url: this._buildUri(this.uri),
        method: corbel.request.method.POST,
        data: data
      }).
      then(function(res) {
        return corbel.Services.getLocationId(res);
      });
    }
function ( data ) { return this . request ( { url : this . _buildUri ( this . uri ) , method : corbel . request . method . POST , data : data } ) . then ( function ( res ) { return corbel . Services . getLocationId ( res ) ; } ) ; }
Creates a new asset
@memberof corbel.Assets.AssetsBuilder.prototype
@param {object}  data            Contains the data of the new asset
@param {string}  data.userId     The user id
@param {string}  data.name       The asset name
@param {date}    data.expire     Expire date
@param {boolean} data.active     If asset is active
@param {array}   data.scopes     Scopes of the asset
@return {Promise}                Promise that resolves in the new asset id or rejects with a {@link CorbelError}
Creates a new asset