Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Rename IdSiteModel to IdSite #545

Open
wants to merge 1 commit into
base: 1.0.0
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -936,20 +936,20 @@ 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.
*
* @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();
* })
* });
Expand Down
16 changes: 8 additions & 8 deletions lib/resource/IdSiteModel.js → lib/resource/IdSite.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
6 changes: 3 additions & 3 deletions lib/resource/Organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

/**
Expand Down Expand Up @@ -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);
};

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/resource/Tenant.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,20 @@ 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.
*
* @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;
10 changes: 5 additions & 5 deletions test/sp.resource.organization_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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 () {
Expand All @@ -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 () {
Expand Down
6 changes: 3 additions & 3 deletions test/sp.resource.tenant_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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);
});
});
});
Expand Down