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