gonebusy-ruby-client 0.0.9 → 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.
- checksums.yaml +4 -4
- data/README.md +29 -68
- data/lib/gonebusy/api_helper.rb +181 -149
- data/lib/gonebusy/configuration.rb +51 -16
- data/lib/gonebusy/controllers/base_controller.rb +46 -45
- data/lib/gonebusy/controllers/bookings_controller.rb +257 -293
- data/lib/gonebusy/controllers/categories_controller.rb +151 -180
- data/lib/gonebusy/controllers/pricing_models_controller.rb +202 -241
- data/lib/gonebusy/controllers/resources_controller.rb +295 -355
- data/lib/gonebusy/controllers/schedules_controller.rb +361 -428
- data/lib/gonebusy/controllers/search_controller.rb +52 -63
- data/lib/gonebusy/controllers/services_controller.rb +310 -367
- data/lib/gonebusy/controllers/users_controller.rb +199 -239
- data/lib/gonebusy/exceptions/api_exception.rb +16 -16
- data/lib/gonebusy/exceptions/entities_error_error_exception.rb +27 -0
- data/lib/gonebusy/exceptions/entities_error_exception.rb +26 -26
- data/lib/gonebusy/gonebusy_client.rb +58 -58
- data/lib/gonebusy/http/auth/custom_auth.rb +15 -15
- data/lib/gonebusy/http/faraday_client.rb +43 -41
- data/lib/gonebusy/http/http_call_back.rb +17 -17
- data/lib/gonebusy/http/http_client.rb +84 -82
- data/lib/gonebusy/http/http_context.rb +15 -15
- data/lib/gonebusy/http/http_method_enum.rb +7 -7
- data/lib/gonebusy/http/http_request.rb +44 -44
- data/lib/gonebusy/http/http_response.rb +19 -19
- data/lib/gonebusy/models/base_model.rb +31 -31
- data/lib/gonebusy/models/cancel_booking_by_id_response.rb +35 -35
- data/lib/gonebusy/models/create_booking_body.rb +134 -80
- data/lib/gonebusy/models/create_booking_response.rb +35 -35
- data/lib/gonebusy/models/create_category_body.rb +71 -71
- data/lib/gonebusy/models/create_category_response.rb +35 -35
- data/lib/gonebusy/models/create_pricing_model_body.rb +80 -80
- data/lib/gonebusy/models/create_pricing_model_response.rb +35 -35
- data/lib/gonebusy/models/create_resource_body.rb +89 -89
- data/lib/gonebusy/models/create_resource_response.rb +35 -35
- data/lib/gonebusy/models/create_schedule_body.rb +143 -144
- data/lib/gonebusy/models/create_schedule_response.rb +35 -35
- data/lib/gonebusy/models/create_schedule_time_window_body.rb +116 -117
- data/lib/gonebusy/models/create_schedule_time_window_response.rb +35 -35
- data/lib/gonebusy/models/create_service_body.rb +107 -107
- data/lib/gonebusy/models/create_service_response.rb +35 -35
- data/lib/gonebusy/models/create_user_body.rb +89 -89
- data/lib/gonebusy/models/create_user_response.rb +35 -35
- data/lib/gonebusy/models/date_recurs_by_enum.rb +12 -12
- data/lib/gonebusy/models/delete_resource_by_id_response.rb +35 -35
- data/lib/gonebusy/models/delete_schedule_by_id_response.rb +35 -35
- data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +35 -35
- data/lib/gonebusy/models/delete_service_by_id_response.rb +35 -35
- data/lib/gonebusy/models/entities_address_entity.rb +116 -116
- data/lib/gonebusy/models/entities_availability_response.rb +58 -58
- data/lib/gonebusy/models/entities_booking_response.rb +71 -71
- data/lib/gonebusy/models/entities_category_response.rb +98 -98
- data/lib/gonebusy/models/entities_pricing_model_response.rb +89 -89
- data/lib/gonebusy/models/entities_resource_availabilities.rb +49 -49
- data/lib/gonebusy/models/entities_resource_response.rb +107 -107
- data/lib/gonebusy/models/entities_schedule_response.rb +76 -76
- data/lib/gonebusy/models/entities_search_response.rb +54 -54
- data/lib/gonebusy/models/entities_service_response.rb +134 -130
- data/lib/gonebusy/models/entities_slots.rb +44 -45
- data/lib/gonebusy/models/entities_thing_type_response.rb +44 -44
- data/lib/gonebusy/models/entities_time_window_response.rb +134 -135
- data/lib/gonebusy/models/entities_user_response.rb +152 -152
- data/lib/gonebusy/models/frequency_enum.rb +17 -17
- data/lib/gonebusy/models/gender_enum.rb +9 -9
- data/lib/gonebusy/models/get_booking_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_bookings_response.rb +40 -40
- data/lib/gonebusy/models/get_categories_response.rb +40 -40
- data/lib/gonebusy/models/get_category_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_pricing_models_response.rb +40 -40
- data/lib/gonebusy/models/get_resource_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_resource_things_response.rb +40 -40
- data/lib/gonebusy/models/get_resources_response.rb +40 -40
- data/lib/gonebusy/models/get_schedule_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_schedules_response.rb +40 -40
- data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_service_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_services_response.rb +40 -40
- data/lib/gonebusy/models/get_user_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_users_response.rb +40 -40
- data/lib/gonebusy/models/occurrence_enum.rb +21 -21
- data/lib/gonebusy/models/recurs_by_enum.rb +15 -15
- data/lib/gonebusy/models/search_query_response.rb +35 -35
- data/lib/gonebusy/models/update_booking_by_id_body.rb +116 -0
- data/lib/gonebusy/models/update_booking_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +62 -62
- data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_resource_by_id_body.rb +71 -71
- data/lib/gonebusy/models/update_resource_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +116 -117
- data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_service_by_id_body.rb +98 -98
- data/lib/gonebusy/models/update_service_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_user_by_id_body.rb +89 -89
- data/lib/gonebusy/models/update_user_by_id_response.rb +35 -35
- data/lib/gonebusy.rb +108 -104
- metadata +53 -17
@@ -1,239 +1,199 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class UsersController < BaseController
|
5
|
-
@@instance = UsersController.new
|
6
|
-
# Singleton instance of the controller class
|
7
|
-
def self.instance
|
8
|
-
@@instance
|
9
|
-
end
|
10
|
-
|
11
|
-
#
|
12
|
-
# @param [String] authorization Required parameter: A valid API key, in the format 'Token API_KEY'
|
13
|
-
# @param [
|
14
|
-
# @param [
|
15
|
-
# @return
|
16
|
-
def
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
_query_builder << '/users
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
#
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
#
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
#
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
# validate and preprocess url
|
202
|
-
_query_url = APIHelper.clean_url _query_builder
|
203
|
-
|
204
|
-
# prepare headers
|
205
|
-
_headers = {
|
206
|
-
'accept' => 'application/json',
|
207
|
-
'Authorization' => Configuration.authorization,
|
208
|
-
'Authorization' => options['authorization']
|
209
|
-
}
|
210
|
-
|
211
|
-
# create the HttpRequest object for the call
|
212
|
-
_request = @http_client.get _query_url, headers: _headers
|
213
|
-
|
214
|
-
# apply authentication
|
215
|
-
CustomAuth.apply(_request)
|
216
|
-
|
217
|
-
# execute the request
|
218
|
-
_context = execute_request(_request)
|
219
|
-
|
220
|
-
# endpoint error handling using HTTP status codes.
|
221
|
-
if _context.response.status_code == 400
|
222
|
-
raise EntitiesErrorException.new '400 - Bad Request', _context
|
223
|
-
elsif _context.response.status_code == 401
|
224
|
-
raise EntitiesErrorException.new '401 - Unauthorized/Missing Token', _context
|
225
|
-
elsif _context.response.status_code == 403
|
226
|
-
raise EntitiesErrorException.new '403 - Forbidden', _context
|
227
|
-
elsif _context.response.status_code == 500
|
228
|
-
raise APIException.new '500 - Unexpected error', _context
|
229
|
-
end
|
230
|
-
|
231
|
-
# global error handling using HTTP status codes.
|
232
|
-
validate_response(_context)
|
233
|
-
|
234
|
-
# return appropriate response type
|
235
|
-
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
236
|
-
return GetUsersResponse.from_hash(decoded)
|
237
|
-
end
|
238
|
-
end
|
239
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class UsersController < BaseController
|
5
|
+
@@instance = UsersController.new
|
6
|
+
# Singleton instance of the controller class
|
7
|
+
def self.instance
|
8
|
+
@@instance
|
9
|
+
end
|
10
|
+
|
11
|
+
# Return all Users that your account has access to. Includes your own User as well as any Users for which you are the Account Manager.
|
12
|
+
# @param [String] authorization Required parameter: A valid API key, in the format 'Token API_KEY'
|
13
|
+
# @param [Integer] page Optional parameter: Page offset to fetch.
|
14
|
+
# @param [Integer] per_page Optional parameter: Number of results to return per page.
|
15
|
+
# @return GetUsersResponse response from the API call
|
16
|
+
def get_users(authorization,
|
17
|
+
page = 1,
|
18
|
+
per_page = 10)
|
19
|
+
|
20
|
+
# prepare query url
|
21
|
+
_query_builder = Configuration.get_base_uri()
|
22
|
+
_query_builder << '/users'
|
23
|
+
_query_builder = APIHelper.append_url_with_query_parameters _query_builder, {
|
24
|
+
'page' => page,
|
25
|
+
'per_page' => per_page
|
26
|
+
}, array_serialization: Configuration.array_serialization
|
27
|
+
_query_url = APIHelper.clean_url _query_builder
|
28
|
+
|
29
|
+
# prepare headers
|
30
|
+
_headers = {
|
31
|
+
'accept' => 'application/json',
|
32
|
+
'Authorization' => Configuration.authorization,
|
33
|
+
'Authorization' => authorization
|
34
|
+
}
|
35
|
+
|
36
|
+
# prepare and execute HttpRequest
|
37
|
+
_request = @http_client.get _query_url, headers: _headers
|
38
|
+
CustomAuth.apply(_request)
|
39
|
+
_context = execute_request(_request)
|
40
|
+
|
41
|
+
# validate response against endpoint and global error codes
|
42
|
+
if _context.response.status_code == 400
|
43
|
+
raise EntitiesErrorErrorException.new 'Bad Request', _context
|
44
|
+
elsif _context.response.status_code == 401
|
45
|
+
raise EntitiesErrorErrorException.new 'Unauthorized/Missing Token', _context
|
46
|
+
elsif _context.response.status_code == 403
|
47
|
+
raise EntitiesErrorErrorException.new 'Forbidden', _context
|
48
|
+
elsif !_context.response.status_code.between?(200, 208)
|
49
|
+
raise APIException.new 'Unexpected error', _context
|
50
|
+
end
|
51
|
+
validate_response(_context)
|
52
|
+
|
53
|
+
# return appropriate response type
|
54
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
55
|
+
return GetUsersResponse.from_hash(decoded)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Create a User
|
59
|
+
# @param [String] authorization Required parameter: A valid API key, in the format 'Token API_KEY'
|
60
|
+
# @param [CreateUserBody] create_user_body Optional parameter: the content of the request
|
61
|
+
# @return CreateUserResponse response from the API call
|
62
|
+
def create_user(authorization,
|
63
|
+
create_user_body = nil)
|
64
|
+
|
65
|
+
# prepare query url
|
66
|
+
_query_builder = Configuration.get_base_uri()
|
67
|
+
_query_builder << '/users/new'
|
68
|
+
_query_url = APIHelper.clean_url _query_builder
|
69
|
+
|
70
|
+
# prepare headers
|
71
|
+
_headers = {
|
72
|
+
'accept' => 'application/json',
|
73
|
+
'content-type' => 'application/json; charset=utf-8',
|
74
|
+
'Authorization' => Configuration.authorization,
|
75
|
+
'Authorization' => authorization
|
76
|
+
}
|
77
|
+
|
78
|
+
# prepare and execute HttpRequest
|
79
|
+
_request = @http_client.post _query_url, headers: _headers, parameters: create_user_body.to_json
|
80
|
+
CustomAuth.apply(_request)
|
81
|
+
_context = execute_request(_request)
|
82
|
+
|
83
|
+
# validate response against endpoint and global error codes
|
84
|
+
if _context.response.status_code == 400
|
85
|
+
raise EntitiesErrorErrorException.new 'Bad Request', _context
|
86
|
+
elsif _context.response.status_code == 401
|
87
|
+
raise EntitiesErrorErrorException.new 'Unauthorized/Missing Token', _context
|
88
|
+
elsif _context.response.status_code == 403
|
89
|
+
raise EntitiesErrorErrorException.new 'Forbidden', _context
|
90
|
+
elsif _context.response.status_code == 422
|
91
|
+
raise EntitiesErrorErrorException.new 'Unprocessable Entity', _context
|
92
|
+
elsif !_context.response.status_code.between?(200, 208)
|
93
|
+
raise APIException.new 'Unexpected error', _context
|
94
|
+
end
|
95
|
+
validate_response(_context)
|
96
|
+
|
97
|
+
# return appropriate response type
|
98
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
99
|
+
return CreateUserResponse.from_hash(decoded)
|
100
|
+
end
|
101
|
+
|
102
|
+
# Return a User by id.
|
103
|
+
# @param [String] authorization Required parameter: A valid API key, in the format 'Token API_KEY'
|
104
|
+
# @param [String] id Required parameter: Example:
|
105
|
+
# @return GetUserByIdResponse response from the API call
|
106
|
+
def get_user_by_id(authorization,
|
107
|
+
id)
|
108
|
+
|
109
|
+
# prepare query url
|
110
|
+
_query_builder = Configuration.get_base_uri()
|
111
|
+
_query_builder << '/users/{id}'
|
112
|
+
_query_builder = APIHelper.append_url_with_template_parameters _query_builder, {
|
113
|
+
'id' => id
|
114
|
+
}
|
115
|
+
_query_url = APIHelper.clean_url _query_builder
|
116
|
+
|
117
|
+
# prepare headers
|
118
|
+
_headers = {
|
119
|
+
'accept' => 'application/json',
|
120
|
+
'Authorization' => Configuration.authorization,
|
121
|
+
'Authorization' => authorization
|
122
|
+
}
|
123
|
+
|
124
|
+
# prepare and execute HttpRequest
|
125
|
+
_request = @http_client.get _query_url, headers: _headers
|
126
|
+
CustomAuth.apply(_request)
|
127
|
+
_context = execute_request(_request)
|
128
|
+
|
129
|
+
# validate response against endpoint and global error codes
|
130
|
+
if _context.response.status_code == 400
|
131
|
+
raise EntitiesErrorErrorException.new 'Bad Request', _context
|
132
|
+
elsif _context.response.status_code == 401
|
133
|
+
raise EntitiesErrorErrorException.new 'Unauthorized/Missing Token', _context
|
134
|
+
elsif _context.response.status_code == 403
|
135
|
+
raise EntitiesErrorErrorException.new 'Forbidden', _context
|
136
|
+
elsif _context.response.status_code == 404
|
137
|
+
raise EntitiesErrorErrorException.new 'Not Found', _context
|
138
|
+
elsif !_context.response.status_code.between?(200, 208)
|
139
|
+
raise APIException.new 'Unexpected error', _context
|
140
|
+
end
|
141
|
+
validate_response(_context)
|
142
|
+
|
143
|
+
# return appropriate response type
|
144
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
145
|
+
return GetUserByIdResponse.from_hash(decoded)
|
146
|
+
end
|
147
|
+
|
148
|
+
# Update a User by id, with params.
|
149
|
+
# @param [String] authorization Required parameter: A valid API key, in the format 'Token API_KEY'
|
150
|
+
# @param [String] id Required parameter: Example:
|
151
|
+
# @param [UpdateUserByIdBody] update_user_by_id_body Optional parameter: the content of the request
|
152
|
+
# @return UpdateUserByIdResponse response from the API call
|
153
|
+
def update_user_by_id(authorization,
|
154
|
+
id,
|
155
|
+
update_user_by_id_body = nil)
|
156
|
+
|
157
|
+
# prepare query url
|
158
|
+
_query_builder = Configuration.get_base_uri()
|
159
|
+
_query_builder << '/users/{id}'
|
160
|
+
_query_builder = APIHelper.append_url_with_template_parameters _query_builder, {
|
161
|
+
'id' => id
|
162
|
+
}
|
163
|
+
_query_url = APIHelper.clean_url _query_builder
|
164
|
+
|
165
|
+
# prepare headers
|
166
|
+
_headers = {
|
167
|
+
'accept' => 'application/json',
|
168
|
+
'content-type' => 'application/json; charset=utf-8',
|
169
|
+
'Authorization' => Configuration.authorization,
|
170
|
+
'Authorization' => authorization
|
171
|
+
}
|
172
|
+
|
173
|
+
# prepare and execute HttpRequest
|
174
|
+
_request = @http_client.put _query_url, headers: _headers, parameters: update_user_by_id_body.to_json
|
175
|
+
CustomAuth.apply(_request)
|
176
|
+
_context = execute_request(_request)
|
177
|
+
|
178
|
+
# validate response against endpoint and global error codes
|
179
|
+
if _context.response.status_code == 400
|
180
|
+
raise EntitiesErrorErrorException.new 'Bad Request', _context
|
181
|
+
elsif _context.response.status_code == 401
|
182
|
+
raise EntitiesErrorErrorException.new 'Unauthorized/Missing Token', _context
|
183
|
+
elsif _context.response.status_code == 403
|
184
|
+
raise EntitiesErrorErrorException.new 'Forbidden', _context
|
185
|
+
elsif _context.response.status_code == 404
|
186
|
+
raise EntitiesErrorErrorException.new 'Not Found', _context
|
187
|
+
elsif _context.response.status_code == 422
|
188
|
+
raise EntitiesErrorErrorException.new 'Unprocessable Entity', _context
|
189
|
+
elsif !_context.response.status_code.between?(200, 208)
|
190
|
+
raise APIException.new 'Unexpected error', _context
|
191
|
+
end
|
192
|
+
validate_response(_context)
|
193
|
+
|
194
|
+
# return appropriate response type
|
195
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
196
|
+
return UpdateUserByIdResponse.from_hash(decoded)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
@@ -1,16 +1,16 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class APIException < StandardError
|
5
|
-
attr_reader :context, :response_code
|
6
|
-
|
7
|
-
# The constructor.
|
8
|
-
# @param [String] The reason for raising an exception
|
9
|
-
# @param [HttpContext] The HttpContext of the API call.
|
10
|
-
def initialize(reason, context)
|
11
|
-
super(reason)
|
12
|
-
@context = context
|
13
|
-
@response_code = context.response.status_code
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class APIException < StandardError
|
5
|
+
attr_reader :context, :response_code
|
6
|
+
|
7
|
+
# The constructor.
|
8
|
+
# @param [String] The reason for raising an exception
|
9
|
+
# @param [HttpContext] The HttpContext of the API call.
|
10
|
+
def initialize(reason, context)
|
11
|
+
super(reason)
|
12
|
+
@context = context
|
13
|
+
@response_code = context.response.status_code
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|