genability 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.rspec +1 -0
- data/.yardopts +10 -0
- data/Gemfile +18 -0
- data/HISTORY.md +7 -0
- data/LICENSE.md +20 -0
- data/README.md +79 -0
- data/Rakefile +42 -0
- data/VERSION +1 -0
- data/genability.gemspec +123 -0
- data/lib/faraday/request/url_encoding_fix.rb +19 -0
- data/lib/faraday/response/raise_http_4xx.rb +44 -0
- data/lib/faraday/response/raise_http_5xx.rb +25 -0
- data/lib/genability.rb +29 -0
- data/lib/genability/api.rb +26 -0
- data/lib/genability/client.rb +24 -0
- data/lib/genability/client/helpers.rb +57 -0
- data/lib/genability/client/load_serving_entity.rb +77 -0
- data/lib/genability/client/price.rb +53 -0
- data/lib/genability/client/season.rb +27 -0
- data/lib/genability/client/tariff.rb +80 -0
- data/lib/genability/client/territory.rb +80 -0
- data/lib/genability/client/time_of_use.rb +66 -0
- data/lib/genability/client/zip_code.rb +28 -0
- data/lib/genability/configuration.rb +82 -0
- data/lib/genability/connection.rb +41 -0
- data/lib/genability/error.rb +21 -0
- data/lib/genability/request.rb +46 -0
- data/lib/mashie_extensions.rb +32 -0
- data/spec/cassettes/load_serving_entities.yml +163 -0
- data/spec/cassettes/load_serving_entity.yml +28 -0
- data/spec/cassettes/prices.yml +55 -0
- data/spec/cassettes/seasons.yml +28 -0
- data/spec/cassettes/tariff.yml +28 -0
- data/spec/cassettes/tariffs.yml +82 -0
- data/spec/cassettes/territories.yml +28 -0
- data/spec/cassettes/territory.yml +28 -0
- data/spec/cassettes/time_of_use.yml +30 -0
- data/spec/cassettes/time_of_uses.yml +28 -0
- data/spec/cassettes/zipcode.yml +28 -0
- data/spec/client/load_serving_entity_spec.rb +72 -0
- data/spec/client/price_spec.rb +41 -0
- data/spec/client/season_spec.rb +30 -0
- data/spec/client/tariff_spec.rb +52 -0
- data/spec/client/territory_spec.rb +40 -0
- data/spec/client/time_of_use_spec.rb +42 -0
- data/spec/client/zip_code_spec.rb +30 -0
- data/spec/configuration.yml.sample +3 -0
- data/spec/faraday/response_spec.rb +31 -0
- data/spec/genability_spec.rb +138 -0
- data/spec/spec_helper.rb +78 -0
- metadata +236 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
module Genability
|
2
|
+
class Client
|
3
|
+
# Zip Code provides a set of information useful for display purposes. For example,
|
4
|
+
# if you are interested in tariffs for zip code 48322, you can retrieve additional
|
5
|
+
# information such as the city and county name as well as the latitude and
|
6
|
+
# longitude coordinates.
|
7
|
+
module ZipCode
|
8
|
+
|
9
|
+
# Returns the details for a zip code.
|
10
|
+
#
|
11
|
+
# @format :json
|
12
|
+
# @authenticated true
|
13
|
+
# @rate_limited true
|
14
|
+
# @param zipcode [String] 5 digit zipcode
|
15
|
+
# @return [Hashie::Mash] Return the details for a particular zipcode.
|
16
|
+
# @see https://developer.genability.com/documentation/api-reference/public/zip-code
|
17
|
+
# @example Return the details for the 48322 zipcode
|
18
|
+
# Genability.zipcode('48322')
|
19
|
+
def zipcode(zipcode)
|
20
|
+
get("zipcodes/#{zipcode}").results.first
|
21
|
+
end
|
22
|
+
|
23
|
+
alias :zip_code :zipcode
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
|
3
|
+
module Genability
|
4
|
+
# Defines constants and methods related to configuration
|
5
|
+
module Configuration
|
6
|
+
# An array of valid keys in the options hash when configuring a {Genability::API}
|
7
|
+
VALID_OPTIONS_KEYS = [
|
8
|
+
:adapter,
|
9
|
+
:application_id,
|
10
|
+
:application_key,
|
11
|
+
:endpoint,
|
12
|
+
:format,
|
13
|
+
:user_agent,
|
14
|
+
:proxy
|
15
|
+
].freeze
|
16
|
+
|
17
|
+
# An array of valid request/response formats
|
18
|
+
#
|
19
|
+
# @note Not all methods support the XML format.
|
20
|
+
VALID_FORMATS = [
|
21
|
+
:json].freeze
|
22
|
+
|
23
|
+
# The adapter that will be used to connect if none is set
|
24
|
+
#
|
25
|
+
# @note The default faraday adapter is Net::HTTP.
|
26
|
+
DEFAULT_ADAPTER = Faraday.default_adapter
|
27
|
+
|
28
|
+
# By default, don't set an application ID
|
29
|
+
DEFAULT_APPLICATION_ID = nil
|
30
|
+
|
31
|
+
# By default, don't set an application key
|
32
|
+
DEFAULT_APPLICATION_KEY = nil
|
33
|
+
|
34
|
+
# The endpoint that will be used to connect if none is set
|
35
|
+
#
|
36
|
+
# @note There is no reason to use any other endpoint at this time
|
37
|
+
DEFAULT_ENDPOINT = 'http://api.genability.com/rest/public/'.freeze
|
38
|
+
|
39
|
+
# The response format appended to the path and sent in the 'Accept' header if none is set
|
40
|
+
#
|
41
|
+
# @note JSON is the only available format at this time
|
42
|
+
DEFAULT_FORMAT = :json
|
43
|
+
|
44
|
+
# By default, don't use a proxy server
|
45
|
+
DEFAULT_PROXY = nil
|
46
|
+
|
47
|
+
# The user agent that will be sent to the API endpoint if none is set
|
48
|
+
DEFAULT_USER_AGENT = "Genability API Ruby Gem".freeze
|
49
|
+
|
50
|
+
# @private
|
51
|
+
attr_accessor *VALID_OPTIONS_KEYS
|
52
|
+
|
53
|
+
# When this module is extended, set all configuration options to their default values
|
54
|
+
def self.extended(base)
|
55
|
+
base.reset
|
56
|
+
end
|
57
|
+
|
58
|
+
# Convenience method to allow configuration options to be set in a block
|
59
|
+
def configure
|
60
|
+
yield self
|
61
|
+
end
|
62
|
+
|
63
|
+
# Create a hash of options and their values
|
64
|
+
def options
|
65
|
+
VALID_OPTIONS_KEYS.inject({}) do |option, key|
|
66
|
+
option.merge!(key => send(key))
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Reset all configuration options to defaults
|
71
|
+
def reset
|
72
|
+
self.adapter = DEFAULT_ADAPTER
|
73
|
+
self.application_id = DEFAULT_APPLICATION_ID
|
74
|
+
self.application_key = DEFAULT_APPLICATION_KEY
|
75
|
+
self.endpoint = DEFAULT_ENDPOINT
|
76
|
+
self.format = DEFAULT_FORMAT
|
77
|
+
self.user_agent = DEFAULT_USER_AGENT
|
78
|
+
self.proxy = DEFAULT_PROXY
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'faraday_middleware'
|
2
|
+
require 'faraday/request/url_encoding_fix'
|
3
|
+
require 'faraday/response/raise_http_4xx'
|
4
|
+
require 'faraday/response/raise_http_5xx'
|
5
|
+
|
6
|
+
module Genability
|
7
|
+
# @private
|
8
|
+
module Connection
|
9
|
+
private
|
10
|
+
|
11
|
+
def connection(raw=false)
|
12
|
+
# raise if id or key is missing
|
13
|
+
options = {
|
14
|
+
:headers => {'Accept' => "application/#{format}; charset=utf-8", 'User-Agent' => user_agent},
|
15
|
+
:proxy => proxy,
|
16
|
+
:ssl => {:verify => false},
|
17
|
+
:url => endpoint,
|
18
|
+
:params => {
|
19
|
+
:appId => application_id,
|
20
|
+
:appKey => application_key
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
Faraday::Connection.new(options) do |connection|
|
25
|
+
#connection.use Faraday::Request::OAuth2, client_id, access_token
|
26
|
+
connection.use Faraday::Request::UrlEncodingFix
|
27
|
+
connection.use Faraday::Response::RaiseHttp4xx
|
28
|
+
connection.use Faraday::Response::Mashify unless raw
|
29
|
+
unless raw
|
30
|
+
case format.to_s.downcase
|
31
|
+
when 'json'
|
32
|
+
connection.use Faraday::Response::ParseJson
|
33
|
+
end
|
34
|
+
end
|
35
|
+
connection.use Faraday::Response::RaiseHttp5xx
|
36
|
+
connection.adapter(adapter)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Genability
|
2
|
+
# Custom error class for rescuing from all Genability errors
|
3
|
+
class Error < StandardError; end
|
4
|
+
|
5
|
+
# Raised when Genability returns the HTTP status code 400
|
6
|
+
class BadRequest < Error; end
|
7
|
+
|
8
|
+
# Raised when Genability returns the HTTP status code 403
|
9
|
+
class Forbidden < Error; end
|
10
|
+
|
11
|
+
# Raised when Genability returns the HTTP status code 404
|
12
|
+
class NotFound < Error; end
|
13
|
+
|
14
|
+
# Raised when Genability returns the HTTP status code 500
|
15
|
+
class ServerError < Error; end
|
16
|
+
|
17
|
+
# Raised when Genability returns the HTTP status code 503
|
18
|
+
class ServiceUnavailable < Error; end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Genability
|
2
|
+
# Defines HTTP request methods
|
3
|
+
module Request
|
4
|
+
# Perform an HTTP GET request
|
5
|
+
def get(path, options={}, raw=false, unformatted=false)
|
6
|
+
request(:get, path, options, raw, unformatted)
|
7
|
+
end
|
8
|
+
|
9
|
+
# Perform an HTTP POST request
|
10
|
+
def post(path, options={}, raw=false, unformatted=false)
|
11
|
+
request(:post, path, options, raw, unformatted)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Perform an HTTP PUT request
|
15
|
+
def put(path, options={}, raw=false, unformatted=false)
|
16
|
+
request(:put, path, options, raw, unformatted)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Perform an HTTP DELETE request
|
20
|
+
def delete(path, options={}, raw=false, unformatted=false)
|
21
|
+
request(:delete, path, options, raw, unformatted)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
# Perform an HTTP request
|
27
|
+
def request(method, path, options, raw=false, unformatted=false)
|
28
|
+
response = connection(raw).send(method) do |request|
|
29
|
+
path = formatted_path(path) unless unformatted
|
30
|
+
case method
|
31
|
+
when :get, :delete
|
32
|
+
request.url(path, options)
|
33
|
+
when :post, :put
|
34
|
+
request.path = path
|
35
|
+
request.body = options unless options.empty?
|
36
|
+
end
|
37
|
+
end
|
38
|
+
raw ? response : response.body
|
39
|
+
end
|
40
|
+
|
41
|
+
def formatted_path(path)
|
42
|
+
[path, format].compact.join('.')
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'hashie/mash'
|
2
|
+
|
3
|
+
# @private
|
4
|
+
class Hashie::Mash
|
5
|
+
|
6
|
+
# Modified Hashie::Mash method missing
|
7
|
+
def method_missing(method_name, *args, &blk)
|
8
|
+
begin
|
9
|
+
method_name = genability_method_name_converter(method_name)
|
10
|
+
rescue; end
|
11
|
+
return self.[](method_name, &blk) if key?(method_name)
|
12
|
+
match = method_name.to_s.match(/(.*?)([?=!]?)$/)
|
13
|
+
case match[2]
|
14
|
+
when "="
|
15
|
+
self[match[1]] = args.first
|
16
|
+
when "?"
|
17
|
+
!!self[match[1]]
|
18
|
+
when "!"
|
19
|
+
initializing_reader(match[1])
|
20
|
+
else
|
21
|
+
default(method_name, *args, &blk)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Convert camelcase methods begining with a lowercase letter
|
26
|
+
# into underscored methods
|
27
|
+
def genability_method_name_converter(method_name)
|
28
|
+
method_name.to_s.gsub(/(?:^|_)(.)/){ $1.upcase }.gsub(/^[A-Z]/){ $&.downcase }.to_sym
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,163 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.genability.com:80/rest/public/lses.json?appId=ValidAppID&appKey=ValidAppKey
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json; charset=utf-8
|
10
|
+
user-agent:
|
11
|
+
- Genability API Ruby Gem
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
server:
|
20
|
+
- Apache-Coyote/1.1
|
21
|
+
content-type:
|
22
|
+
- application/json;charset=utf-8
|
23
|
+
transfer-encoding:
|
24
|
+
- chunked
|
25
|
+
date:
|
26
|
+
- Fri, 01 Jul 2011 18:52:42 GMT
|
27
|
+
body: "{\"status\":\"success\",\"count\":3154,\"type\":\"LoadServingEntity\",\"results\":[{\"lseId\":3155,\"name\":\"Infinite Energy Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3154,\"name\":\"Pennywise Power LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3153,\"name\":\"Nooruddin Investments LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3152,\"name\":\"Nations Power LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3151,\"name\":\"Potentia Energy LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3150,\"name\":\"Andeler Corporation\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3149,\"name\":\"Our Energy LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3148,\"name\":\"Gateway Energy Services Corporation\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3147,\"name\":\"Bounce Energy Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3146,\"name\":\"Frontier Utilities Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3145,\"name\":\"Texpo Power LP\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3144,\"name\":\"Fulcrum Retail Energy LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":2,\"name\":\"Kansas City Power & Light Co\",\"code\":\"10000\",\"websiteHome\":\"http://www.kcpl.com/index.html\"},{\"lseId\":3,\"name\":\"Kansas Gas & Electric Co\",\"code\":\"10005\",\"websiteHome\":null},{\"lseId\":4,\"name\":\"Karnes Electric Coop Inc\",\"code\":\"10009\",\"websiteHome\":null},{\"lseId\":5,\"name\":\"Kay Electric Coop\",\"code\":\"10012\",\"websiteHome\":null},{\"lseId\":6,\"name\":\"Kaw Valley Electric Coop Inc\",\"code\":\"10019\",\"websiteHome\":null},{\"lseId\":7,\"name\":\"City of Aurelia\",\"code\":\"1002\",\"websiteHome\":null},{\"lseId\":8,\"name\":\"City of Kaplan\",\"code\":\"10025\",\"websiteHome\":null},{\"lseId\":9,\"name\":\"City of Kasota\",\"code\":\"10037\",\"websiteHome\":null},{\"lseId\":10,\"name\":\"City of Aurora\",\"code\":\"1004\",\"websiteHome\":null},{\"lseId\":11,\"name\":\"City of Kasson\",\"code\":\"10040\",\"websiteHome\":null},{\"lseId\":12,\"name\":\"City of Kaukauna\",\"code\":\"10056\",\"websiteHome\":null},{\"lseId\":13,\"name\":\"City of Lamar\",\"code\":\"10057\",\"websiteHome\":null},{\"lseId\":14,\"name\":\"Kaysville City Corporation\",\"code\":\"10063\",\"websiteHome\":null}]}"
|
28
|
+
http_version: "1.1"
|
29
|
+
- !ruby/struct:VCR::HTTPInteraction
|
30
|
+
request: !ruby/struct:VCR::Request
|
31
|
+
method: :get
|
32
|
+
uri: http://api.genability.com:80/rest/public/lses.json?appId=ValidAppID&appKey=ValidAppKey&pageCount=10
|
33
|
+
body:
|
34
|
+
headers:
|
35
|
+
accept:
|
36
|
+
- application/json; charset=utf-8
|
37
|
+
user-agent:
|
38
|
+
- Genability API Ruby Gem
|
39
|
+
accept-encoding:
|
40
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
41
|
+
response: !ruby/struct:VCR::Response
|
42
|
+
status: !ruby/struct:VCR::ResponseStatus
|
43
|
+
code: 200
|
44
|
+
message: OK
|
45
|
+
headers:
|
46
|
+
server:
|
47
|
+
- Apache-Coyote/1.1
|
48
|
+
content-type:
|
49
|
+
- application/json;charset=utf-8
|
50
|
+
transfer-encoding:
|
51
|
+
- chunked
|
52
|
+
date:
|
53
|
+
- Fri, 01 Jul 2011 18:52:42 GMT
|
54
|
+
body: "{\"status\":\"success\",\"count\":3154,\"type\":\"LoadServingEntity\",\"results\":[{\"lseId\":3155,\"name\":\"Infinite Energy Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3154,\"name\":\"Pennywise Power LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3153,\"name\":\"Nooruddin Investments LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3152,\"name\":\"Nations Power LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3151,\"name\":\"Potentia Energy LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3150,\"name\":\"Andeler Corporation\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3149,\"name\":\"Our Energy LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3148,\"name\":\"Gateway Energy Services Corporation\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3147,\"name\":\"Bounce Energy Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3146,\"name\":\"Frontier Utilities Inc\",\"code\":\"\",\"websiteHome\":null}]}"
|
55
|
+
http_version: "1.1"
|
56
|
+
- !ruby/struct:VCR::HTTPInteraction
|
57
|
+
request: !ruby/struct:VCR::Request
|
58
|
+
method: :get
|
59
|
+
uri: http://api.genability.com:80/rest/public/lses.json?appId=ValidAppID&appKey=ValidAppKey&pageStart=2
|
60
|
+
body:
|
61
|
+
headers:
|
62
|
+
accept:
|
63
|
+
- application/json; charset=utf-8
|
64
|
+
user-agent:
|
65
|
+
- Genability API Ruby Gem
|
66
|
+
accept-encoding:
|
67
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
68
|
+
response: !ruby/struct:VCR::Response
|
69
|
+
status: !ruby/struct:VCR::ResponseStatus
|
70
|
+
code: 200
|
71
|
+
message: OK
|
72
|
+
headers:
|
73
|
+
server:
|
74
|
+
- Apache-Coyote/1.1
|
75
|
+
content-type:
|
76
|
+
- application/json;charset=utf-8
|
77
|
+
transfer-encoding:
|
78
|
+
- chunked
|
79
|
+
date:
|
80
|
+
- Fri, 01 Jul 2011 18:52:43 GMT
|
81
|
+
body: "{\"status\":\"success\",\"count\":3154,\"type\":\"LoadServingEntity\",\"results\":[{\"lseId\":3153,\"name\":\"Nooruddin Investments LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3152,\"name\":\"Nations Power LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3151,\"name\":\"Potentia Energy LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3150,\"name\":\"Andeler Corporation\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3149,\"name\":\"Our Energy LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3148,\"name\":\"Gateway Energy Services Corporation\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3147,\"name\":\"Bounce Energy Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3146,\"name\":\"Frontier Utilities Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3145,\"name\":\"Texpo Power LP\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3144,\"name\":\"Fulcrum Retail Energy LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":2,\"name\":\"Kansas City Power & Light Co\",\"code\":\"10000\",\"websiteHome\":\"http://www.kcpl.com/index.html\"},{\"lseId\":3,\"name\":\"Kansas Gas & Electric Co\",\"code\":\"10005\",\"websiteHome\":null},{\"lseId\":4,\"name\":\"Karnes Electric Coop Inc\",\"code\":\"10009\",\"websiteHome\":null},{\"lseId\":5,\"name\":\"Kay Electric Coop\",\"code\":\"10012\",\"websiteHome\":null},{\"lseId\":6,\"name\":\"Kaw Valley Electric Coop Inc\",\"code\":\"10019\",\"websiteHome\":null},{\"lseId\":7,\"name\":\"City of Aurelia\",\"code\":\"1002\",\"websiteHome\":null},{\"lseId\":8,\"name\":\"City of Kaplan\",\"code\":\"10025\",\"websiteHome\":null},{\"lseId\":9,\"name\":\"City of Kasota\",\"code\":\"10037\",\"websiteHome\":null},{\"lseId\":10,\"name\":\"City of Aurora\",\"code\":\"1004\",\"websiteHome\":null},{\"lseId\":11,\"name\":\"City of Kasson\",\"code\":\"10040\",\"websiteHome\":null},{\"lseId\":12,\"name\":\"City of Kaukauna\",\"code\":\"10056\",\"websiteHome\":null},{\"lseId\":13,\"name\":\"City of Lamar\",\"code\":\"10057\",\"websiteHome\":null},{\"lseId\":14,\"name\":\"Kaysville City Corporation\",\"code\":\"10063\",\"websiteHome\":null},{\"lseId\":15,\"name\":\"KBR Rural Public Power District\",\"code\":\"10065\",\"websiteHome\":null},{\"lseId\":16,\"name\":\"K C Electric Association\",\"code\":\"10066\",\"websiteHome\":null}]}"
|
82
|
+
http_version: "1.1"
|
83
|
+
- !ruby/struct:VCR::HTTPInteraction
|
84
|
+
request: !ruby/struct:VCR::Request
|
85
|
+
method: :get
|
86
|
+
uri: http://api.genability.com:80/rest/public/lses.json?appId=ValidAppID&appKey=ValidAppKey&startsWithWildCard=true&wildCardText=In
|
87
|
+
body:
|
88
|
+
headers:
|
89
|
+
accept:
|
90
|
+
- application/json; charset=utf-8
|
91
|
+
user-agent:
|
92
|
+
- Genability API Ruby Gem
|
93
|
+
accept-encoding:
|
94
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
95
|
+
response: !ruby/struct:VCR::Response
|
96
|
+
status: !ruby/struct:VCR::ResponseStatus
|
97
|
+
code: 200
|
98
|
+
message: OK
|
99
|
+
headers:
|
100
|
+
server:
|
101
|
+
- Apache-Coyote/1.1
|
102
|
+
content-type:
|
103
|
+
- application/json;charset=utf-8
|
104
|
+
transfer-encoding:
|
105
|
+
- chunked
|
106
|
+
date:
|
107
|
+
- Fri, 01 Jul 2011 18:52:43 GMT
|
108
|
+
body: "{\"status\":\"success\",\"count\":17,\"type\":\"LoadServingEntity\",\"results\":[{\"lseId\":3155,\"name\":\"Infinite Energy Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3053,\"name\":\"Independence City of\",\"code\":\"9231\",\"websiteHome\":\"http://www.ci.independence.mo.us/\"},{\"lseId\":3064,\"name\":\"International Paper Co-GT Mill\",\"code\":\"9390\",\"websiteHome\":\"http://www.intermountain-rea.com/\"},{\"lseId\":3063,\"name\":\"Intermountain Rural Elec Assn\",\"code\":\"9336\",\"websiteHome\":null},{\"lseId\":3062,\"name\":\"Intercounty Electric Coop Assn\",\"code\":\"9331\",\"websiteHome\":null},{\"lseId\":3059,\"name\":\"Inter County Energy Coop Corp\",\"code\":\"9292\",\"websiteHome\":null},{\"lseId\":1807,\"name\":\"Integrys Energy Services, Inc.\",\"code\":\"21795\",\"websiteHome\":\"http://www.integrysenergy.com/\"},{\"lseId\":2435,\"name\":\"Integrys Energy Services of Texas, LP\",\"code\":\"54892\",\"websiteHome\":null},{\"lseId\":1793,\"name\":\"Integrys Energy Services of N.Y., Inc.\",\"code\":\"21258\",\"websiteHome\":\"http://www.integrysenergy.com/\"},{\"lseId\":1445,\"name\":\"Inside Passage Elec Coop, Inc\",\"code\":\"18963\",\"websiteHome\":null},{\"lseId\":2968,\"name\":\"Inland Power & Light Company\",\"code\":\"8699\",\"websiteHome\":null},{\"lseId\":3058,\"name\":\"Indianola Municipal Utilities\",\"code\":\"9275\",\"websiteHome\":null},{\"lseId\":3056,\"name\":\"Indianapolis Power & Light Co\",\"code\":\"9273\",\"websiteHome\":\"http://www.iplpower.com/ipl/index?page=IPLHome\"},{\"lseId\":3061,\"name\":\"Indiana Michigan Power Co\",\"code\":\"9324\",\"websiteHome\":\"https://www.indianamichiganpower.com/Default.aspx\"},{\"lseId\":3054,\"name\":\"Indian Electric Coop, Inc\",\"code\":\"9246\",\"websiteHome\":null},{\"lseId\":2356,\"name\":\"Independence Power Marketing\",\"code\":\"49921\",\"websiteHome\":null},{\"lseId\":3066,\"name\":\"Interstate Power and Light Co\",\"code\":\"9417\",\"websiteHome\":\"http://www.alliantenergy.com/index.htm\"}]}"
|
109
|
+
http_version: "1.1"
|
110
|
+
- !ruby/struct:VCR::HTTPInteraction
|
111
|
+
request: !ruby/struct:VCR::Request
|
112
|
+
method: :get
|
113
|
+
uri: http://api.genability.com:80/rest/public/lses.json?appId=ValidAppID&appKey=ValidAppKey&endsWithWildCard=true&wildCardText=Inc
|
114
|
+
body:
|
115
|
+
headers:
|
116
|
+
accept:
|
117
|
+
- application/json; charset=utf-8
|
118
|
+
user-agent:
|
119
|
+
- Genability API Ruby Gem
|
120
|
+
accept-encoding:
|
121
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
122
|
+
response: !ruby/struct:VCR::Response
|
123
|
+
status: !ruby/struct:VCR::ResponseStatus
|
124
|
+
code: 200
|
125
|
+
message: OK
|
126
|
+
headers:
|
127
|
+
server:
|
128
|
+
- Apache-Coyote/1.1
|
129
|
+
content-type:
|
130
|
+
- application/json;charset=utf-8
|
131
|
+
transfer-encoding:
|
132
|
+
- chunked
|
133
|
+
date:
|
134
|
+
- Fri, 01 Jul 2011 18:52:45 GMT
|
135
|
+
body: "{\"status\":\"success\",\"count\":480,\"type\":\"LoadServingEntity\",\"results\":[{\"lseId\":3155,\"name\":\"Infinite Energy Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3147,\"name\":\"Bounce Energy Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3146,\"name\":\"Frontier Utilities Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":2044,\"name\":\"Central Valley Elec Coop, Inc\",\"code\":\"3287\",\"websiteHome\":null},{\"lseId\":2045,\"name\":\"Allamakee-Clayton El Coop, Inc\",\"code\":\"329\",\"websiteHome\":null},{\"lseId\":2053,\"name\":\"Chariton Valley Elec Coop, Inc\",\"code\":\"3314\",\"websiteHome\":null},{\"lseId\":2054,\"name\":\"Charles Mix Electric Assn, Inc\",\"code\":\"3315\",\"websiteHome\":null},{\"lseId\":2063,\"name\":\"Caddo Electric Coop, Inc\",\"code\":\"3390\",\"websiteHome\":null},{\"lseId\":2075,\"name\":\"Cherry-Todd Electric Coop, Inc\",\"code\":\"3435\",\"websiteHome\":null},{\"lseId\":2076,\"name\":\"Cherryland Electric Coop Inc\",\"code\":\"3436\",\"websiteHome\":null},{\"lseId\":2083,\"name\":\"Chitina Electric Inc\",\"code\":\"3465\",\"websiteHome\":null},{\"lseId\":2093,\"name\":\"Choctawhatche Elec Coop, Inc\",\"code\":\"3502\",\"websiteHome\":null},{\"lseId\":2094,\"name\":\"Choptank Electric Coop, Inc\",\"code\":\"3503\",\"websiteHome\":\"http://www.choptankelectric.com/\"},{\"lseId\":2095,\"name\":\"Chugach Electric Assn Inc\",\"code\":\"3522\",\"websiteHome\":\"http://www.chugachelectric.com/\"},{\"lseId\":2097,\"name\":\"Choctaw Electric Coop Inc\",\"code\":\"3527\",\"websiteHome\":null},{\"lseId\":2043,\"name\":\"Central Texas Elec Coop, Inc\",\"code\":\"3282\",\"websiteHome\":null},{\"lseId\":2041,\"name\":\"Central New Mexico El Coop, Inc\",\"code\":\"3273\",\"websiteHome\":null},{\"lseId\":2040,\"name\":\"Central Missouri Elec Coop Inc\",\"code\":\"3268\",\"websiteHome\":null},{\"lseId\":1980,\"name\":\"Cam Wal Electric Coop, Inc\",\"code\":\"2986\",\"websiteHome\":null},{\"lseId\":1981,\"name\":\"Carbon Power & Light, Inc\",\"code\":\"2998\",\"websiteHome\":null},{\"lseId\":1983,\"name\":\"Yakutat Power Inc\",\"code\":\"30150\",\"websiteHome\":null},{\"lseId\":1985,\"name\":\"Cardinal Cogen Inc\",\"code\":\"3030\",\"websiteHome\":null},{\"lseId\":1988,\"name\":\"Progress Energy Carolinas Inc\",\"code\":\"3046\",\"websiteHome\":null},{\"lseId\":1990,\"name\":\"Pioneer Electric Coop, Inc\",\"code\":\"30517\",\"websiteHome\":null},{\"lseId\":1994,\"name\":\"Carroll Electric Coop, Inc\",\"code\":\"3076\",\"websiteHome\":null}]}"
|
136
|
+
http_version: "1.1"
|
137
|
+
- !ruby/struct:VCR::HTTPInteraction
|
138
|
+
request: !ruby/struct:VCR::Request
|
139
|
+
method: :get
|
140
|
+
uri: http://api.genability.com:80/rest/public/lses.json?appId=ValidAppID&appKey=ValidAppKey&containsWildCard=true&wildCardText=Energy
|
141
|
+
body:
|
142
|
+
headers:
|
143
|
+
accept:
|
144
|
+
- application/json; charset=utf-8
|
145
|
+
user-agent:
|
146
|
+
- Genability API Ruby Gem
|
147
|
+
accept-encoding:
|
148
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
149
|
+
response: !ruby/struct:VCR::Response
|
150
|
+
status: !ruby/struct:VCR::ResponseStatus
|
151
|
+
code: 200
|
152
|
+
message: OK
|
153
|
+
headers:
|
154
|
+
server:
|
155
|
+
- Apache-Coyote/1.1
|
156
|
+
content-type:
|
157
|
+
- application/json;charset=utf-8
|
158
|
+
transfer-encoding:
|
159
|
+
- chunked
|
160
|
+
date:
|
161
|
+
- Fri, 01 Jul 2011 18:52:45 GMT
|
162
|
+
body: "{\"status\":\"success\",\"count\":149,\"type\":\"LoadServingEntity\",\"results\":[{\"lseId\":3155,\"name\":\"Infinite Energy Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3151,\"name\":\"Potentia Energy LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3149,\"name\":\"Our Energy LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3148,\"name\":\"Gateway Energy Services Corporation\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3147,\"name\":\"Bounce Energy Inc\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":3144,\"name\":\"Fulcrum Retail Energy LLC\",\"code\":\"\",\"websiteHome\":null},{\"lseId\":2450,\"name\":\"Blue Star Energy Services\",\"code\":\"55722\",\"websiteHome\":null},{\"lseId\":2451,\"name\":\"East Central Energy\",\"code\":\"5574\",\"websiteHome\":\"http://www.eastcentralenergy.com/default.aspx\"},{\"lseId\":2273,\"name\":\"Corn Belt Energy Corporation\",\"code\":\"4362\",\"websiteHome\":null},{\"lseId\":2435,\"name\":\"Integrys Energy Services of Texas, LP\",\"code\":\"54892\",\"websiteHome\":null},{\"lseId\":2434,\"name\":\"New York Industrial Energy Buyers, LLC\",\"code\":\"54875\",\"websiteHome\":null},{\"lseId\":2433,\"name\":\"Freedom Energy\",\"code\":\"54873\",\"websiteHome\":null},{\"lseId\":2432,\"name\":\"Accent Energy Texas LP\",\"code\":\"54872\",\"websiteHome\":\"http://www.accentenergy.com/\"},{\"lseId\":2454,\"name\":\"Ambridge Energy, LLC\",\"code\":\"55780\",\"websiteHome\":null},{\"lseId\":2458,\"name\":\"Bluerock Energy, Inc.\",\"code\":\"55813\",\"websiteHome\":null},{\"lseId\":2460,\"name\":\"IDT Energy, Inc.\",\"code\":\"55815\",\"websiteHome\":\"http://www.idtenergy.com/\"},{\"lseId\":2467,\"name\":\"Energy Services Providers, Inc.\",\"code\":\"55874\",\"websiteHome\":null},{\"lseId\":2469,\"name\":\"Hudson Energy Services\",\"code\":\"55878\",\"websiteHome\":\"http://www.hudsonenergyservices.com/\"},{\"lseId\":2478,\"name\":\"Juice Energy, Inc.\",\"code\":\"55986\",\"websiteHome\":null},{\"lseId\":2479,\"name\":\"Reliant Energy Solutions Northeast LLC\",\"code\":\"55991\",\"websiteHome\":null},{\"lseId\":2482,\"name\":\"Econnergy Energy Co Inc\",\"code\":\"5603\",\"websiteHome\":\"http://www.econnergy.com/\"},{\"lseId\":2431,\"name\":\"Glacial Energy Holdings\",\"code\":\"54871\",\"websiteHome\":null},{\"lseId\":2429,\"name\":\"Champion Energy Services LLC\",\"code\":\"54862\",\"websiteHome\":null},{\"lseId\":2427,\"name\":\"Direct Energy Services\",\"code\":\"54820\",\"websiteHome\":null},{\"lseId\":2281,\"name\":\"Shell Energy North America (US), L.P.\",\"code\":\"4410\",\"websiteHome\":null}]}"
|
163
|
+
http_version: "1.1"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.genability.com:80/rest/public/lses/2756.json?appId=ValidAppID&appKey=ValidAppKey
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json; charset=utf-8
|
10
|
+
user-agent:
|
11
|
+
- Genability API Ruby Gem
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
server:
|
20
|
+
- Apache-Coyote/1.1
|
21
|
+
content-type:
|
22
|
+
- application/json;charset=utf-8
|
23
|
+
transfer-encoding:
|
24
|
+
- chunked
|
25
|
+
date:
|
26
|
+
- Fri, 01 Jul 2011 18:52:46 GMT
|
27
|
+
body: "{\"status\":\"success\",\"count\":1,\"type\":\"LoadServingEntity\",\"results\":[{\"lseId\":2756,\"name\":\"Georgia Power Co\",\"code\":\"7140\",\"websiteHome\":\"http://www.georgiapower.com/\"}]}"
|
28
|
+
http_version: "1.1"
|