Add Search endpoint
This PR adds the "Search" endpoint. Search doesn't quite fit the Resourceful pattern, so I put the tests in client_spec.rb. Happy to move them if you'd prefer them to be in their own file (I just felt strange because there is no resource to use in describe <Resource>).
I also added a new Error class, and to allow for better rescuing, created an error superclass for the gem. Also happy to revert if it doesn't feel right.
| 1 Warning | |
|---|---|
| :warning: | [DEPRECATION] check is deprecated. Please use check! instead. |
Generated by :no_entry_sign: Danger
The code here looks good. You still need to remove your actual secret token from everywhere!
Also add a comment when this is ready to re-review, commits don't get flagged in notifications.
Bump @pmn4, want to finish this?
@dblock there are a few items here:
-
Resource Type: I introduced some confusion with the search results "Resource Type." IEX has not yet launched this feature, so there is nothing to support, or even details about how to support it. The documentation says it's coming, so I left a comment mentioning that it is coming.
-
Tokens: the token in this PR is copy/pasted from IEX's documentation (it is their sandbox API key). I used it because the search endpoint is a paid feature, for which I do not have an API key. Instead, for this one test case, I updated both the endpoint and API key to point to the sandbox environment, so if we need to recreate the VCR response, we can without having to pay.
do these make sense? sorry for the confusion, and the delay! (tbh, I was only evaluating IEX when I authored this PR, and have since switched gears to another provider.)
@dblock there are a few items here:
- Resource Type: I introduced some confusion with the search results "Resource Type." IEX has not yet launched this feature, so there is nothing to support, or even details about how to support it. The documentation says it's coming, so I left a comment mentioning that it is coming.
ok
- Tokens: the token in this PR is copy/pasted from IEX's documentation (it is their sandbox API key). I used it because the search endpoint is a paid feature, for which I do not have an API key. Instead, for this one test case, I updated both the endpoint and API key to point to the sandbox environment, so if we need to recreate the VCR response, we can without having to pay.
you just don't want the real token in this PR because someone will steal it; once a recording was made you can just replace it with a placeholder
do these make sense? sorry for the confusion, and the delay! (tbh, I was only evaluating IEX when I authored this PR, and have since switched gears to another provider.)
I'll leave this open for someone/you to finish it.