|
3 | 3 | var InstanceResource = require('./InstanceResource'); |
4 | 4 | var utils = require('../utils'); |
5 | 5 |
|
| 6 | +/** |
| 7 | + * @class WebConfig |
| 8 | + * |
| 9 | + * @augments {InstanceResource} |
| 10 | + * |
| 11 | + * @description |
| 12 | + * |
| 13 | + * Encapsulates an WebConfig resource, which determines the behaviour of the |
| 14 | + * web application used for the Client API. For full documentation of this |
| 15 | + * resource, please see |
| 16 | + * [REST API Reference: WebConfig](https://docs.stormpath.com/rest/product-guide/latest/reference.html?#web-config). |
| 17 | + * |
| 18 | + * This class should not be manually constructed. It should be obtained from one |
| 19 | + * of these methods: |
| 20 | + * |
| 21 | + * - {@link Application#getWebConfig Application.getWebConfig()}. |
| 22 | + * |
| 23 | + * @param {Object} webConfigResource |
| 24 | + * |
| 25 | + * The JSON representation of this resource. |
| 26 | + */ |
6 | 27 | function WebConfig() { |
7 | 28 | WebConfig.super_.apply(this, arguments); |
8 | 29 | } |
9 | 30 |
|
10 | 31 | utils.inherits(WebConfig, InstanceResource); |
11 | 32 |
|
| 33 | +/** |
| 34 | + * Retrieves the {@link Application} that this web configuration is attached to. |
| 35 | + * |
| 36 | + * @param {ExpansionOptions} options |
| 37 | + * Options for retrieving the linked resources of the application. |
| 38 | + * |
| 39 | + * @param {Function} callback |
| 40 | + * The function to call after the query has completed. It will be called with |
| 41 | + * (err, {@link Application}). |
| 42 | + */ |
12 | 43 | WebConfig.prototype.getApplication = function getWebConfigApplication(/* [options], callback */) { |
13 | 44 | var args = utils.resolveArgs(arguments, ['options', 'callback'], true); |
14 | 45 | return this.dataStore.getResource(this.application.href, args.options, require('./Application'), args.callback); |
15 | 46 | }; |
16 | 47 |
|
| 48 | +/** |
| 49 | + * Retrieves the {@link ApiKey} that this web config is using for signing tokens. |
| 50 | + * |
| 51 | + * @param {Options} options |
| 52 | + * TODO when the official docs describe this |
| 53 | + * |
| 54 | + * @param {Function} callback |
| 55 | + * The function to call after the query has completed. It will be called with |
| 56 | + * (err, {@link ApiKey}). |
| 57 | + */ |
17 | 58 | WebConfig.prototype.getSigningApiKey = function getSigningApiKey(/* [options], callback */) { |
18 | 59 | var args = utils.resolveArgs(arguments, ['options', 'callback'], true); |
19 | 60 | return this.dataStore.getResource(this.signingApiKey.href, args.options, require('./ApiKey'), args.callback); |
20 | 61 | }; |
21 | 62 |
|
| 63 | +/** |
| 64 | + * Retrieves the {@link Tenant} for this web configuration. |
| 65 | + * |
| 66 | + * @param {ExpansionOptions} options |
| 67 | + * Options for retrieving the linked resources of the tenant. |
| 68 | + * |
| 69 | + * @param {Function} callback |
| 70 | + * The function to call after the query has completed. It will be called with |
| 71 | + * (err, {@link Tenant}). |
| 72 | + */ |
22 | 73 | WebConfig.prototype.getTenant = function getWebConfigTenant(/* [options], callback */) { |
23 | 74 | var args = utils.resolveArgs(arguments, ['options', 'callback'], true); |
24 | 75 | return this.dataStore.getResource(this.tenant.href, args.options, require('./Tenant'), args.callback); |
|
0 commit comments