Skip to content

Commit

Permalink
Merge pull request #24 from mrvisser/country-code
Browse files Browse the repository at this point in the history
Add country code to api.tenants.js
  • Loading branch information
nicolaasmatthijs committed Sep 23, 2015
2 parents 582cb2e + 91c700b commit f3c605d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/api.tenants.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ var getTenant = module.exports.getTenant = function(restCtx, alias, callback) {
* @param {String} host The hostname for the newly created tenant (e.g. cambridge.oae.com)
* @param {Object} [opts] Optional fields
* @param {String} [opts.emailDomain] The email domain expression that this tenant hosts
* @param {String} [opts.countryCode] The ISO-3166-1 country code of the country that represents the tenant
* @param {Function} callback Standard callback method takes arguments `err` and `tenant`
* @param {Object} callback.err Error object containing error code and error message
* @param {Tenant} callback.tenant Tenant object representing the newly created tenant
Expand All @@ -153,8 +154,9 @@ var createTenant = module.exports.createTenant = function(restCtx, alias, displa
var params = {
'alias': alias,
'displayName': displayName,
'host': host,
'emailDomain': opts.emailDomain,
'host': host
'countryCode': opts.countryCode
};
RestUtil.RestRequest(restCtx, '/api/tenant/create', 'POST', params, function(err, tenant) {
if (err) {
Expand All @@ -169,13 +171,14 @@ var createTenant = module.exports.createTenant = function(restCtx, alias, displa
/**
* Update a tenant's metadata through the REST API.
*
* @param {RestContext} restCtx Standard REST Context object that contains the current tenant URL and the current user credentials
* @param {String} [alias] Optional tenant alias of the tenant that needs to be updated, in case the request is made from the global admin tenant. If no tenantAlias is passed in, the current tenant will be used
* @param {Object} tenantUpdates Object where the keys represents the metadata identifiers and the values represent the new metadata values
* @param {String} [tenantUpdates.displayName] Updated tenant display name
* @param {String} [tenantUpdates.host] Updated tenant hostname
* @param {Function} callback Standard callback function
* @param {Object} callback.err Error object containing error code and error message
* @param {RestContext} restCtx Standard REST Context object that contains the current tenant URL and the current user credentials
* @param {String} [alias] Optional tenant alias of the tenant that needs to be updated, in case the request is made from the global admin tenant. If no tenantAlias is passed in, the current tenant will be used
* @param {Object} tenantUpdates Object where the keys represents the metadata identifiers and the values represent the new metadata values
* @param {String} [tenantUpdates.displayName] Updated tenant display name
* @param {String} [tenantUpdates.host] Updated tenant hostname
* @param {String} [tenantUpdates.countryCode] Updated tenant ISO-3166-1 country code
* @param {Function} callback Standard callback function
* @param {Object} callback.err Error object containing error code and error message
*/
var updateTenant = module.exports.updateTenant = function(restCtx, alias, tenantUpdates, callback) {
var url = '/api/tenant';
Expand Down

0 comments on commit f3c605d

Please sign in to comment.