Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bump-version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

current_version="0.9.7"
current_version="0.9.8"
new_version=$1
if [ "$new_version" == "" ]; then
[[ "$current_version" =~ ([0-9]+).+([0-9]+).+([0-9]+)$ ]] && new_version="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.$((${BASH_REMATCH[3]} + 1))"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "forge-apis",
"version": "0.9.7",
"version": "0.9.8",
"description": "The Forge Platform contains an expanding collection of web service components that can be used with Autodesk cloud-based products or your own technologies. Take advantage of Autodesk’s expertise in design and engineering.",
"license": "Apache-2.0",
"main": "src/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ module.exports = (function () {
}
if (headerParams['Accept-Encoding'] === 'gzip, deflate')
requestParams.encoding = null;
headerParams['User-Agent'] = 'forge-apis/0.9.7 (nodejs)';
headerParams['User-Agent'] = 'forge-apis/0.9.8 (nodejs)';
_this.debug('request params were', requestParams);

return new Promise(function (resolve, reject) {
Expand Down Expand Up @@ -503,7 +503,7 @@ module.exports = (function () {
};


exports.version = '0.9.7';
exports.version = '0.9.8';

exports.userAgentHeaders = {
'User-Agent': `forge-apis/${exports.version} nodejs api wrappers library`,
Expand Down
8 changes: 5 additions & 3 deletions src/api/UserProfileApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ module.exports = (function () {
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function (apiClient) {
this.apiClient = apiClient || ApiClient.instance;

this.apiClient = apiClient || new ApiClient('https://api.userprofile.autodesk.com');
/**
* Returns the profile information of an authorizing end user.
* data is of type: {module:model/UserProfile}
Expand All @@ -61,8 +61,10 @@ module.exports = (function () {
var accepts = ['application/vnd.api+json', 'application/json'];
var returnType = UserProfile;

// https://aps.autodesk.com/en/docs/oauth/v2/reference/http/userinfo-GET/
// https://api.userprofile.autodesk.com/userinfo
return this.apiClient.callApi(
'/userprofile/v1/users/@me', 'GET',
'/userinfo', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials
);
Expand Down
14 changes: 4 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ module.exports = (function () {
StorageRelationshipsTarget = require('./model/StorageRelationshipsTarget'),
StorageRelationshipsTargetData = require('./model/StorageRelationshipsTargetData'),
TopFolders = require('./model/TopFolders'),
UserProfile = require('./model/UserProfile'),
UserProfileProfileImages = require('./model/UserProfileProfileImages'),
User = require('./model/UserProfile'),
Version = require('./model/Version'),
VersionAttributes = require('./model/VersionAttributes'),
VersionCreated = require('./model/VersionCreated'),
Expand Down Expand Up @@ -898,15 +897,10 @@ module.exports = (function () {
*/
TopFolders: TopFolders,
/**
* The UserProfile model constructor.
* @property {module:model/UserProfile}
* The User model constructor.
* @property {module:model/User}
*/
UserProfile: UserProfile,
/**
* The UserProfileProfileImages model constructor.
* @property {module:model/UserProfileProfileImages}
*/
UserProfileProfileImages: UserProfileProfileImages,
User: User,
/**
* The Version model constructor.
* @property {module:model/Version}
Expand Down
151 changes: 151 additions & 0 deletions src/model/User.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
/**
* Forge SDK
* The Forge Platform contains an expanding collection of web service components that can be used with Autodesk cloud-based products or your own technologies. Take advantage of Autodesk’s expertise in design and engineering.
*
* Contact: [email protected]
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = (function () {
'use strict';

var ApiClient = require('../ApiClient');

/**
* The User model module.
* @module model/User
*/

/**
* Constructs a <code>User</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/User} obj Optional instance to populate.
* @return {module:model/User} The populated <code>User</code> instance.
*/
var constructFromObject = function (data, obj) {
if (data) {
obj = obj || new exports();

if (data.hasOwnProperty('sub')) // Oxygen id of the user.
obj.sub = ApiClient.convertToType(data.sub, 'String');
if (data.hasOwnProperty('name')) // Full name of the user.
obj.name = ApiClient.convertToType(data.name, 'String');
if (data.hasOwnProperty('given_name')) // First name of the user.
obj.given_name = ApiClient.convertToType(data.given_name, 'String');
if (data.hasOwnProperty('family_name')) // Last name of the user.
obj.family_name = ApiClient.convertToType(data.family_name, 'String');
if (data.hasOwnProperty('preferred_username')) // Username of the user.
obj.preferred_username = ApiClient.convertToType(data.preferred_username, 'String');
if (data.hasOwnProperty('email')) // Primary email of the user.
obj.email = ApiClient.convertToType(data.email, 'String');
if (data.hasOwnProperty('email_verified')) // Flag that shows if the user’s email is verified or not.
obj.email_verified = ApiClient.convertToType(data.email_verified, 'Boolean');
if (data.hasOwnProperty('profile')) // URL for the profile of the user.
obj.profile = ApiClient.convertToType(data.profile, 'String');
if (data.hasOwnProperty('picture')) // Profile image of the user (x120 thumbnail).
obj.picture = ApiClient.convertToType(data.picture, 'String');
if (data.hasOwnProperty('locale')) // End-User’s locale, represented as a BCP47 standard (eg, en-US).
obj.locale = ApiClient.convertToType(data.locale, 'String');
if (data.hasOwnProperty('updated_at')) // The second-precision Unix timestamp of last modification on the user profile.
obj.updated_at = ApiClient.convertToType(data.updated_at, 'Integer');

}
return (obj);
};

/**
* Constructs a new <code>User</code>.
* user Profile
* @alias module:model/User
* @class
* @param {Object} theData The plain JavaScript object bearing properties of interest.
* @param {module:model/User} obj Optional instance to populate.
*/
var exports = function (theData, obj) {
var _this = this;
return (constructFromObject(theData, obj || _this));
};

/**
* Constructs a <code>User</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/User} obj Optional instance to populate.
* @return {module:model/User} The populated <code>User</code> instance.
*/
exports.constructFromObject = constructFromObject;

/**
* Oxygen id of the user.
* @member {String} sub
*/
exports.prototype.sub = undefined;
/**
* Full name of the user.
* @member {String} name
*/
exports.prototype.name = undefined;
/**
* First name of the user.
* @member {String} given_name
*/
exports.prototype.given_name = undefined;
/**
* Last name of the user.
* @member {String} family_name
*/
exports.prototype.family_name = undefined;
/**
* // Username of the user.
* @member {String} preferred_username
*/
exports.prototype.preferred_username = undefined;
/**
* Primary email of the user.
* @member {String} email
*/
exports.prototype.email = undefined;
/**
* Flag that shows if the user’s email is verified or not.
* @member {Boolean} email_verified
*/
exports.prototype.email_verified = undefined;
/**
* URL for the profile of the user.
* @member {String} profile
*/
exports.prototype.profile = undefined;
/**
* Profile image of the user (x120 thumbnail).
* @member {String} picture
*/
exports.prototype.picture = undefined;
/**
* End-User’s locale, represented as a BCP47 standard (eg, en-US).
* @member {String} locale
*/
exports.prototype.locale = undefined;
/**
* The second-precision Unix timestamp of last modification on the user profile.
* @member {Integer} updated_at
*/
exports.prototype.updated_at = undefined;

return (exports);
}());
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
*/

module.export = (function () {
'use strict';
'use strict';

var expect = require('expect.js'),
ForgeSdk = require('../../src');
var expect = require('expect.js');
var ForgeSdk = require('../../src');

describe('UserProfileProfileImages', function () {
it('should create an instance of UserProfileProfileImages', function () {
var instance = new ForgeSdk.UserProfileProfileImages();
expect(instance).to.be.a(ForgeSdk.UserProfileProfileImages);
});
});
describe('User', function () {
it('should create an instance of User', function () {
var instance = new ForgeSdk.User();
expect(instance).to.be.a(ForgeSdk.User);
});
});

}());
38 changes: 0 additions & 38 deletions test/model/UserProfile.spec.js

This file was deleted.