-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for AWS.CloudSearchDomain
Closes #134
- Loading branch information
Showing
5 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var AWS = require('../core'); | ||
|
||
/** | ||
* Note: the `AWS.CloudSearchDomain` constructor must be created with a | ||
* valid endpoint. | ||
*/ | ||
AWS.util.update(AWS.CloudSearchDomain.prototype, { | ||
/** | ||
* @api private | ||
*/ | ||
validateService: function validateService() { | ||
if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) { | ||
var msg = 'AWS.CloudSearchDomain requires an explicit '+ | ||
'`endpoint\' configuration option.'; | ||
throw AWS.util.error(new Error(), | ||
{name: 'InvalidEndpoint', message: msg}); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
helpers = require('../helpers') | ||
AWS = helpers.AWS | ||
|
||
describe 'AWS.CloudSearchDomain', -> | ||
describe 'constructor', -> | ||
it 'fails if there is no provided endpoint', -> | ||
err = {} | ||
try | ||
new AWS.CloudSearchDomain | ||
catch e | ||
err = e | ||
expect(err.name).toEqual('InvalidEndpoint') | ||
|
||
it 'fails if the endpoint is a template', -> | ||
err = {} | ||
try | ||
new AWS.CloudSearchDomain endpoint: '{region}.domain' | ||
catch e | ||
err = e | ||
expect(err.name).toEqual('InvalidEndpoint') | ||
|
||
it 'allows explicit endpoint', -> | ||
expect(-> new AWS.CloudSearchDomain endpoint: 'host.domain').not.toThrow() |