From 91c700b2f100d30b93ac7db29466d44668c80cdc Mon Sep 17 00:00:00 2001 From: Branden Visser Date: Wed, 23 Sep 2015 08:19:15 -0400 Subject: [PATCH] (CountryCode) Add country code support --- lib/api.tenants.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/api.tenants.js b/lib/api.tenants.js index 797cdaf..f1f1e75 100644 --- a/lib/api.tenants.js +++ b/lib/api.tenants.js @@ -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 @@ -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) { @@ -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';