aeries-api 1.1.0 → 1.1.1
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.
- checksums.yaml +4 -4
- metadata +12 -33
- data/.gitignore +0 -14
- data/.rspec +0 -3
- data/.travis.yml +0 -8
- data/Gemfile +0 -6
- data/LICENSE.txt +0 -21
- data/README.md +0 -85
- data/Rakefile +0 -6
- data/aeries-api.gemspec +0 -44
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/aeries-api/client/contacts.rb +0 -11
- data/lib/aeries-api/client/schools.rb +0 -17
- data/lib/aeries-api/client/student_groups.rb +0 -11
- data/lib/aeries-api/client/student_pictures.rb +0 -17
- data/lib/aeries-api/client/student_programs.rb +0 -11
- data/lib/aeries-api/client/students.rb +0 -22
- data/lib/aeries-api/client/supplemental.rb +0 -27
- data/lib/aeries-api/client.rb +0 -52
- data/lib/aeries-api/error_handler.rb +0 -22
- data/lib/aeries-api/version.rb +0 -3
- data/lib/aeries-api.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3c2dfe4a1a36e7e4dae6997fca6c6ed51bee6a0e224f2bc3a06b886d051d873
|
4
|
+
data.tar.gz: b0025b4018cb3b7da024990b163684eefc99f364466a1e63dd2206fcdc6f55ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8421dd38a16a6d141d3122359983c50ddffe29b760686eb80fb7f0a017905c10e9c560219ca618ddca80447ecc674f42a0af3a4a7d6887f9e8bf073c4f43a53d
|
7
|
+
data.tar.gz: baab9f86b3761139ddb06e84a5cd8fc2a99f060561fca03fdd8bf0dafe9a879fa34d3d735de0db01a0d5b20e7589b063749cbd71e2d5232c3bdbf024949f0ec7
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aeries-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derek Povah
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -126,44 +126,23 @@ dependencies:
|
|
126
126
|
name: httparty
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - "
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
131
|
+
version: '0.21'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - "
|
136
|
+
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
|
-
description:
|
138
|
+
version: '0.21'
|
139
|
+
description:
|
140
140
|
email:
|
141
141
|
- derek@derekpovah.com
|
142
142
|
executables: []
|
143
143
|
extensions: []
|
144
144
|
extra_rdoc_files: []
|
145
|
-
files:
|
146
|
-
- ".gitignore"
|
147
|
-
- ".rspec"
|
148
|
-
- ".travis.yml"
|
149
|
-
- Gemfile
|
150
|
-
- LICENSE.txt
|
151
|
-
- README.md
|
152
|
-
- Rakefile
|
153
|
-
- aeries-api.gemspec
|
154
|
-
- bin/console
|
155
|
-
- bin/setup
|
156
|
-
- lib/aeries-api.rb
|
157
|
-
- lib/aeries-api/client.rb
|
158
|
-
- lib/aeries-api/client/contacts.rb
|
159
|
-
- lib/aeries-api/client/schools.rb
|
160
|
-
- lib/aeries-api/client/student_groups.rb
|
161
|
-
- lib/aeries-api/client/student_pictures.rb
|
162
|
-
- lib/aeries-api/client/student_programs.rb
|
163
|
-
- lib/aeries-api/client/students.rb
|
164
|
-
- lib/aeries-api/client/supplemental.rb
|
165
|
-
- lib/aeries-api/error_handler.rb
|
166
|
-
- lib/aeries-api/version.rb
|
145
|
+
files: []
|
167
146
|
homepage: https://github.com/derekpovah/aeries-api
|
168
147
|
licenses:
|
169
148
|
- MIT
|
@@ -171,7 +150,7 @@ metadata:
|
|
171
150
|
allowed_push_host: https://rubygems.org
|
172
151
|
homepage_uri: https://github.com/derekpovah/aeries-api
|
173
152
|
source_code_uri: https://github.com/derekpovah/aeries-api
|
174
|
-
post_install_message:
|
153
|
+
post_install_message:
|
175
154
|
rdoc_options: []
|
176
155
|
require_paths:
|
177
156
|
- lib
|
@@ -186,8 +165,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
165
|
- !ruby/object:Gem::Version
|
187
166
|
version: '0'
|
188
167
|
requirements: []
|
189
|
-
rubygems_version: 3.
|
190
|
-
signing_key:
|
168
|
+
rubygems_version: 3.5.22
|
169
|
+
signing_key:
|
191
170
|
specification_version: 4
|
192
171
|
summary: A simple REST client for the Aeries SIS API
|
193
172
|
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2019 Derek Povah
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
aeries-api
|
2
|
-
==========
|
3
|
-
|
4
|
-
This gem provides an interface to the [Aeries SIS API](https://support.aeries.com/support/solutions/articles/14000077926-aeries-api-full-documentation).
|
5
|
-
|
6
|
-
I will implement endpoints as I need them, but will also consider pull requests that add support for additional endpoints. At the time of writing, this gem is designed to be used with version 3 of the Aeries API.
|
7
|
-
|
8
|
-
Installation
|
9
|
-
------------
|
10
|
-
|
11
|
-
Add this line to your application's Gemfile:
|
12
|
-
|
13
|
-
```ruby
|
14
|
-
gem 'aeries-api'
|
15
|
-
```
|
16
|
-
|
17
|
-
Usage
|
18
|
-
-----
|
19
|
-
|
20
|
-
#### Setup
|
21
|
-
|
22
|
-
Initialize the client:
|
23
|
-
|
24
|
-
```ruby
|
25
|
-
aeries = AeriesApi::Client.new(
|
26
|
-
aeries_cert: '477abe9e7d27439681d62f4e0de1f5e1',
|
27
|
-
base_uri: ' https://demo.aeries.net/aeries/api/v5'
|
28
|
-
)
|
29
|
-
```
|
30
|
-
|
31
|
-
The client can also be configured via the environment:
|
32
|
-
|
33
|
-
```ruby
|
34
|
-
ENV['AERIES_CERT'] = '477abe9e7d27439681d62f4e0de1f5e1'
|
35
|
-
ENV['AERIES_BASE_URI'] = ' https://demo.aeries.net/aeries/api/v5'
|
36
|
-
|
37
|
-
aeries = AeriesApi::Client.new
|
38
|
-
```
|
39
|
-
|
40
|
-
#### Retrieving Data
|
41
|
-
|
42
|
-
Most endpoints require a school code so it should be passed as an argument. Keyword arguments are then used to pass additional data to the API. Example:
|
43
|
-
|
44
|
-
```ruby
|
45
|
-
aeries.students(school_code: 99, grade_level: 4)
|
46
|
-
```
|
47
|
-
|
48
|
-
Available Methods:
|
49
|
-
|
50
|
-
```ruby
|
51
|
-
# /api/v5/schools
|
52
|
-
schools # returns all schools
|
53
|
-
|
54
|
-
# /api/v5/schools/#{school_code}
|
55
|
-
school(school_code: school_code) # returns a single school
|
56
|
-
|
57
|
-
# /api/v5/schools/#{school_code}/StudentGroups
|
58
|
-
student_groups(school_code: school_code) # returns all student groups at a school
|
59
|
-
|
60
|
-
# /api/v5/schools/#{school_code}/students
|
61
|
-
students(school_code: school_code) # returns all students at a school
|
62
|
-
|
63
|
-
# /api/v5/schools/#{school_code}/students/grade/#{grade_level}
|
64
|
-
students(school_code: school_code, grade_level: grade_level) # returns students in a specific grade level
|
65
|
-
|
66
|
-
# /api/v5/schools/#{school_code}/students/#{student_id}
|
67
|
-
student(school_code: school_code, student_id: student_id) # returns a single student
|
68
|
-
|
69
|
-
# /api/v5/schools/#{school_code}/contacts/#{student_id}
|
70
|
-
contacts(school_code: school_code, student_id: student_id) # returns contacts for a student
|
71
|
-
|
72
|
-
# /api/v5/schools/#{school_code}/StudentPictures
|
73
|
-
student_picture(school_code: school_code) # returns all student pictures at a school
|
74
|
-
|
75
|
-
# /api/v5/schools/#{school_code}/StudentPictures/#{student_id}
|
76
|
-
student_pictures(school_code: school_code, student_id: student_id) # returns a single student's picture
|
77
|
-
|
78
|
-
# /api/v5/schools/#{school_code}/students/#{student_id}/programs
|
79
|
-
student_programs(school_code: school_code, student_id: student_id) # returns a single student's picture
|
80
|
-
```
|
81
|
-
|
82
|
-
License
|
83
|
-
-------
|
84
|
-
|
85
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
DELETED
data/aeries-api.gemspec
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'aeries-api/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'aeries-api'
|
8
|
-
spec.version = AeriesApi::VERSION
|
9
|
-
spec.authors = ['Derek Povah']
|
10
|
-
spec.email = ['derek@derekpovah.com']
|
11
|
-
|
12
|
-
spec.summary = %q{A simple REST client for the Aeries SIS API}
|
13
|
-
spec.homepage = 'https://github.com/derekpovah/aeries-api'
|
14
|
-
spec.license = 'MIT'
|
15
|
-
|
16
|
-
if spec.respond_to?(:metadata)
|
17
|
-
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
18
|
-
|
19
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
-
spec.metadata['source_code_uri'] = spec.homepage
|
21
|
-
else
|
22
|
-
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
23
|
-
'public gem pushes.'
|
24
|
-
end
|
25
|
-
|
26
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
27
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
28
|
-
end
|
29
|
-
spec.bindir = 'exe'
|
30
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
-
spec.require_paths = ['lib']
|
32
|
-
spec.required_ruby_version = '>= 2.4.0'
|
33
|
-
|
34
|
-
spec.add_development_dependency 'bundler'
|
35
|
-
spec.add_development_dependency 'rake', "~> 12.3.3"
|
36
|
-
spec.add_development_dependency 'rspec', "~> 3.0"
|
37
|
-
spec.add_development_dependency 'pry'
|
38
|
-
spec.add_development_dependency 'sinatra'
|
39
|
-
spec.add_development_dependency 'webmock'
|
40
|
-
|
41
|
-
spec.add_dependency 'activesupport'
|
42
|
-
spec.add_dependency 'hashie'
|
43
|
-
spec.add_dependency 'httparty'
|
44
|
-
end
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'aeries/api'
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require 'irb'
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
module AeriesApi
|
2
|
-
class Client
|
3
|
-
module Contacts
|
4
|
-
def contacts(school_code:, student_id:)
|
5
|
-
response = self.class.get("/schools/#{school_code}/contacts/#{student_id}")
|
6
|
-
@error_handler.handle_error(response)
|
7
|
-
mash_and_underscore_keys(response.parsed_response)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module AeriesApi
|
2
|
-
class Client
|
3
|
-
module Schools
|
4
|
-
def school(school_code:)
|
5
|
-
response = self.class.get("/schools/#{school_code}")
|
6
|
-
@error_handler.handle_error(response)
|
7
|
-
mash_and_underscore_keys(response.parsed_response)
|
8
|
-
end
|
9
|
-
|
10
|
-
def schools
|
11
|
-
response = self.class.get('/schools')
|
12
|
-
@error_handler.handle_error(response)
|
13
|
-
mash_and_underscore_keys(response.parsed_response)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module AeriesApi
|
2
|
-
class Client
|
3
|
-
module StudentGroups
|
4
|
-
def student_groups(school_code:)
|
5
|
-
response = self.class.get("/schools/#{school_code}/studentgroups")
|
6
|
-
@error_handler.handle_error(response)
|
7
|
-
mash_and_underscore_keys(response.parsed_response)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module AeriesApi
|
2
|
-
class Client
|
3
|
-
module StudentPictures
|
4
|
-
def student_picture(school_code:, student_id:)
|
5
|
-
response = self.class.get("/schools/#{school_code}/studentpictures/#{student_id}")
|
6
|
-
@error_handler.handle_error(response)
|
7
|
-
mash_and_underscore_keys(response.parsed_response)
|
8
|
-
end
|
9
|
-
|
10
|
-
def student_pictures(school_code:)
|
11
|
-
response = self.class.get("/schools/#{school_code}/studentpictures")
|
12
|
-
@error_handler.handle_error(response)
|
13
|
-
mash_and_underscore_keys(response.parsed_response)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module AeriesApi
|
2
|
-
class Client
|
3
|
-
module StudentPrograms
|
4
|
-
def student_programs(school_code:, student_id:)
|
5
|
-
response = self.class.get("/schools/#{school_code}/students/#{student_id}/programs")
|
6
|
-
@error_handler.handle_error(response)
|
7
|
-
mash_and_underscore_keys(response.parsed_response)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module AeriesApi
|
2
|
-
class Client
|
3
|
-
module Students
|
4
|
-
def student(school_code:, student_id:)
|
5
|
-
response = self.class.get("/schools/#{school_code}/students/#{student_id}")
|
6
|
-
@error_handler.handle_error(response)
|
7
|
-
mash_and_underscore_keys(response.parsed_response)
|
8
|
-
end
|
9
|
-
|
10
|
-
def students(school_code:, grade: nil)
|
11
|
-
if grade
|
12
|
-
endpoint = "/schools/#{school_code}/students/grade/#{grade}"
|
13
|
-
else
|
14
|
-
endpoint = "/schools/#{school_code}/students"
|
15
|
-
end
|
16
|
-
response = self.class.get(endpoint)
|
17
|
-
@error_handler.handle_error(response)
|
18
|
-
mash_and_underscore_keys(response.parsed_response)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module AeriesApi
|
2
|
-
class Client
|
3
|
-
module Supplemental
|
4
|
-
def school_supplemental(school_code:, student_id:)
|
5
|
-
response = self.class.get("/schools/#{school_code}/schoolsupplemental/#{student_id}")
|
6
|
-
@error_handler.handle_error(response)
|
7
|
-
mash_and_underscore_keys(response.parsed_response)
|
8
|
-
end
|
9
|
-
|
10
|
-
def district_supplemental(school_code:, student_id:)
|
11
|
-
response = self.class.get("/schools/#{school_code}/districtsupplemental/#{student_id}")
|
12
|
-
@error_handler.handle_error(response)
|
13
|
-
mash_and_underscore_keys(response.parsed_response)
|
14
|
-
end
|
15
|
-
|
16
|
-
def update_school_supplemental(school_code:, student_number:, columns:)
|
17
|
-
options = {
|
18
|
-
body: { Columns: camelize_keys(columns) }.to_json,
|
19
|
-
}
|
20
|
-
|
21
|
-
response = self.class.post("/updateschoolsupplemental/#{school_code}/#{student_number}", options)
|
22
|
-
@error_handler.handle_error(response)
|
23
|
-
mash_and_underscore_keys(response.parsed_response)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
data/lib/aeries-api/client.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'active_support/core_ext/string/inflections'
|
2
|
-
require 'active_support/core_ext/hash/keys'
|
3
|
-
require 'hashie'
|
4
|
-
|
5
|
-
require 'aeries-api/client/contacts'
|
6
|
-
require 'aeries-api/client/schools'
|
7
|
-
require 'aeries-api/client/students'
|
8
|
-
require 'aeries-api/client/student_groups'
|
9
|
-
require 'aeries-api/client/student_pictures'
|
10
|
-
require 'aeries-api/client/student_programs'
|
11
|
-
require 'aeries-api/client/supplemental'
|
12
|
-
require 'aeries-api/error_handler'
|
13
|
-
|
14
|
-
module AeriesApi
|
15
|
-
class Client
|
16
|
-
include HTTParty
|
17
|
-
include AeriesApi::Client::Contacts
|
18
|
-
include AeriesApi::Client::Schools
|
19
|
-
include AeriesApi::Client::Students
|
20
|
-
include AeriesApi::Client::StudentGroups
|
21
|
-
include AeriesApi::Client::StudentPictures
|
22
|
-
include AeriesApi::Client::StudentPrograms
|
23
|
-
include AeriesApi::Client::Supplemental
|
24
|
-
|
25
|
-
format :json
|
26
|
-
|
27
|
-
def initialize(aeries_cert: nil, base_uri: nil)
|
28
|
-
@error_handler = AeriesApi::ErrorHandler.new
|
29
|
-
|
30
|
-
aeries_cert ||= ENV['AERIES_CERT']
|
31
|
-
base_uri ||= ENV['AERIES_BASE_URI']
|
32
|
-
|
33
|
-
self.class.default_options.merge!(headers: { 'AERIES-CERT': aeries_cert, 'Content-Type': 'application/json' }, base_uri: base_uri)
|
34
|
-
end
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
def camelize_keys(payload)
|
39
|
-
payload.each do |p|
|
40
|
-
p.deep_transform_keys! { |k| k.to_s.camelize }
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def mash_and_underscore_keys(parsed_response)
|
45
|
-
return Hashie::Mash.new(parsed_response.deep_transform_keys! { |k| k.underscore }) if parsed_response.is_a?(Hash)
|
46
|
-
parsed_response.each do |k, v|
|
47
|
-
v.is_a?(Array) ? mash_and_underscore_keys(v) : k.deep_transform_keys! { |k| k.underscore }
|
48
|
-
end
|
49
|
-
parsed_response.map! { |r| Hashie::Mash.new(r) }
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module AeriesApi
|
2
|
-
class ErrorHandler
|
3
|
-
def handle_error(response)
|
4
|
-
return if response.success?
|
5
|
-
raise http_errors[response.code].new(response)
|
6
|
-
end
|
7
|
-
|
8
|
-
private
|
9
|
-
|
10
|
-
def http_errors
|
11
|
-
{
|
12
|
-
400 => AeriesApi::BadRequest,
|
13
|
-
401 => AeriesApi::AuthenticationError,
|
14
|
-
404 => AeriesApi::NotFound,
|
15
|
-
500 => AeriesApi::ServerError,
|
16
|
-
502 => AeriesApi::ServerError,
|
17
|
-
503 => AeriesApi::ServerError,
|
18
|
-
504 => AeriesApi::ServerError,
|
19
|
-
}
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
data/lib/aeries-api/version.rb
DELETED
data/lib/aeries-api.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'httparty'
|
2
|
-
require 'aeries-api/version'
|
3
|
-
require 'aeries-api/client'
|
4
|
-
|
5
|
-
module AeriesApi
|
6
|
-
class ResponseError < StandardError
|
7
|
-
attr_accessor :response
|
8
|
-
|
9
|
-
def initialize(response)
|
10
|
-
message = response.parsed_response['Message']
|
11
|
-
super(message.length <= 50 ? message[0..50] : message)
|
12
|
-
@response = response
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
class AuthenticationError < ResponseError; end
|
17
|
-
|
18
|
-
class BadRequest < ResponseError; end
|
19
|
-
|
20
|
-
class Forbidden < ResponseError; end
|
21
|
-
|
22
|
-
class NotFound < ResponseError; end
|
23
|
-
|
24
|
-
class ServerError < ResponseError; end
|
25
|
-
end
|