From 21b0824f5e2670f19bf45366cc91e0a981cee69c Mon Sep 17 00:00:00 2001 From: Luka Skukan Date: Mon, 19 Sep 2016 12:41:13 +0200 Subject: [PATCH] Rename IdSiteModel to IdSite --- lib/Client.js | 10 +++++----- lib/resource/{IdSiteModel.js => IdSite.js} | 16 ++++++++-------- lib/resource/Organization.js | 6 +++--- lib/resource/Tenant.js | 6 +++--- test/sp.resource.organization_test.js | 10 +++++----- test/sp.resource.tenant_test.js | 6 +++--- 6 files changed, 27 insertions(+), 27 deletions(-) rename lib/resource/{IdSiteModel.js => IdSite.js} (58%) diff --git a/lib/Client.js b/lib/Client.js index 687e3bf6..708fd469 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -936,7 +936,7 @@ Client.prototype.getOrganizations = function getOrganizations(/* [options,] call }; /** - * Retrieves all the {@link IdSiteModel} resources for the current {@link Tenant}. + * Retrieves all the {@link IdSite} resources for the current {@link Tenant}. * * @param {CollectionQueryOptions} [collectionQueryOptions] * Options for querying, paginating, and expanding the collection. @@ -944,12 +944,12 @@ Client.prototype.getOrganizations = function getOrganizations(/* [options,] call * @param {Function} callback * The function to call when then the operation is complete. Will be called * with the parameters (err, {@link CollectionResource}). The collection will - * be a list of {@link IdSiteModel} objects. + * be a list of {@link IdSite} objects. * * @example - * client.getIdSites(function (err, idSiteModels) { - * idSiteModels.each(function (idSiteModel, next) { - * console.log(idSiteModel); + * client.getIdSites(function (err, idSites) { + * idSites.each(function (idSite, next) { + * console.log(idSite); * next(); * }) * }); diff --git a/lib/resource/IdSiteModel.js b/lib/resource/IdSite.js similarity index 58% rename from lib/resource/IdSiteModel.js rename to lib/resource/IdSite.js index 6f73d0a0..2d8b285f 100644 --- a/lib/resource/IdSiteModel.js +++ b/lib/resource/IdSite.js @@ -4,25 +4,25 @@ var utils = require('../utils'); var InstanceResource = require('./InstanceResource'); /** - * @class IdSiteModel + * @class IdSite * * @description - * Encapsulates a IdSiteModel resource. For full documentation of this resource, please see + * Encapsulates a IdSite resource. For full documentation of this resource, please see * [REST API Reference: ID Site](https://docs.stormpath.com/rest/product-guide/latest/reference.html?#id-site). * * This class should not be manually constructed. It should be obtained from one of these methods: - * - {@link Organization#getIdSiteModel Organization.getIdSiteModel()} + * - {@link Organization#getIdSite Organization.getIdSite()} * - {@link Tenant#getIdSites Tenant.getIdSites()} * * @augments {InstanceResource} * - * @param {Object} idSiteModelResource + * @param {Object} idSiteResource * The JSON representation of this resource, retrieved the Stormpath REST API. */ -function IdSiteModel() { - IdSiteModel.super_.apply(this, arguments); +function IdSite() { + IdSite.super_.apply(this, arguments); } -utils.inherits(IdSiteModel, InstanceResource); +utils.inherits(IdSite, InstanceResource); -module.exports = IdSiteModel; +module.exports = IdSite; diff --git a/lib/resource/Organization.js b/lib/resource/Organization.js index bff578c7..52743679 100644 --- a/lib/resource/Organization.js +++ b/lib/resource/Organization.js @@ -6,7 +6,7 @@ var utils = require('../utils'); var Account = require('./Account'); var Application = require('./Application'); var CustomData = require('./CustomData'); -var IdSiteModel = require('./IdSiteModel'); +var IdSite = require('./IdSite'); var OrganizationAccountStoreMapping = require('./OrganizationAccountStoreMapping'); /** @@ -350,9 +350,9 @@ Organization.prototype.getGroups = function getGroups(/* [options,] callback */) * * @private */ -Organization.prototype.getIdSiteModel = function getIdSiteModel(/* [options,] callback */) { +Organization.prototype.getIdSite = function getIdSite(/* [options,] callback */) { var args = utils.resolveArgs(arguments, ['options', 'callback'], true); - return this.dataStore.getResource(this.idSiteModel.href, args.options, IdSiteModel, args.callback); + return this.dataStore.getResource(this.idSite.href, args.options, IdSite, args.callback); }; /** diff --git a/lib/resource/Tenant.js b/lib/resource/Tenant.js index e61a1853..eb42ed33 100644 --- a/lib/resource/Tenant.js +++ b/lib/resource/Tenant.js @@ -221,7 +221,7 @@ Tenant.prototype.getCustomData = function getCustomData(/* [options,] callback * }; /** - * Retrieves all the {@link IdSiteModel} resources for this resource. + * Retrieves all the {@link IdSite} resources for this resource. * * @param {CollectionQueryOptions} [collectionQueryOptions] * Options for querying, paginating, and expanding the collection. @@ -229,12 +229,12 @@ Tenant.prototype.getCustomData = function getCustomData(/* [options,] callback * * @param {Function} callback * The function to call when then the operation is complete. Will be called * with the parameters (err, {@link CollectionResource}). The collection will - * be a list of {@link IdSiteModel} objects. + * be a list of {@link IdSite} objects. * */ Tenant.prototype.getIdSites = function getTenantIdSites(/* [options,] callback */) { var args = utils.resolveArgs(arguments, ['options', 'callback'], true); - return this.dataStore.getResource(this.idSites.href, args.options, require('./IdSiteModel'), args.callback); + return this.dataStore.getResource(this.idSites.href, args.options, require('./IdSite'), args.callback); }; module.exports = Tenant; diff --git a/test/sp.resource.organization_test.js b/test/sp.resource.organization_test.js index 95cb0b09..7cf319d0 100644 --- a/test/sp.resource.organization_test.js +++ b/test/sp.resource.organization_test.js @@ -62,7 +62,7 @@ describe('resource/Organization.js', function () { groups: { href: '1f8c3fc4-69eb-48b1-a078-1a249a76196b' }, - idSiteModel: { + idSite: { href: '0967db49-93aa-48d2-b801-18ebd9dba53e' }, accountStoreMappings: { @@ -682,11 +682,11 @@ describe('resource/Organization.js', function () { }); }); - describe('.getIdSiteModel(options, callback)', function () { + describe('.getIdSite(options, callback)', function () { var returnValue; beforeEach(function () { - returnValue = organization.getIdSiteModel(options, callbackSpy); + returnValue = organization.getIdSite(options, callbackSpy); }); it('should pass the options to dataStore.getResource', function () { @@ -703,11 +703,11 @@ describe('resource/Organization.js', function () { }); }); - describe('.getIdSiteModel(callback)', function () { + describe('.getIdSite(callback)', function () { var returnValue; beforeEach(function () { - returnValue = organization.getIdSiteModel(callbackSpy); + returnValue = organization.getIdSite(callbackSpy); }); it('should pass the callback to dataStore.getResource', function () { diff --git a/test/sp.resource.tenant_test.js b/test/sp.resource.tenant_test.js index 5506f341..8c428335 100644 --- a/test/sp.resource.tenant_test.js +++ b/test/sp.resource.tenant_test.js @@ -7,7 +7,7 @@ var Account = require('../lib/resource/Account'); var Tenant = require('../lib/resource/Tenant'); var Application = require('../lib/resource/Application'); var Directory = require('../lib/resource/Directory'); -var IdSiteModel = require('../lib/resource/IdSiteModel'); +var IdSite = require('../lib/resource/IdSite'); var DataStore = require('../lib/ds/DataStore'); describe('Resources: ', function () { @@ -300,8 +300,8 @@ describe('Resources: ', function () { cbSpy.should.have.been.calledTwice; /* jshint +W030 */ - getResourceStub.should.have.been.calledWith('boom!', null, IdSiteModel, cbSpy); - getResourceStub.should.have.been.calledWith('boom!', opts, IdSiteModel, cbSpy); + getResourceStub.should.have.been.calledWith('boom!', null, IdSite, cbSpy); + getResourceStub.should.have.been.calledWith('boom!', opts, IdSite, cbSpy); }); }); });