gonebusy-ruby-client 0.0.4 → 0.0.5
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/lib/gonebusy/controllers/users_controller.rb +0 -49
- data/lib/gonebusy.rb +0 -1
- metadata +1 -2
- data/lib/gonebusy/models/get_users_pros_response.rb +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e47bfd95b768b9f211ab5d49e0b2547a3def3fc2
|
4
|
+
data.tar.gz: 3a8cdc9b502b45da701f3035a480b216c42cb041
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a27f54aba124f47cee5a412084ce47058808d436d58d2b87d9cf92296140f39f51632a7b746bbee8f19d0c980753eef667a61d3f0202e41b934280365a29e73d
|
7
|
+
data.tar.gz: 6cc93ecf9a54c87ed7cc9cc5c3a2fbda526053946cf04c7116e08bf656e7bd03c834b0f5d2b1270f09ff28658b00ee1fb398d2e70d924c1a808b3225cdc21aaf
|
@@ -126,55 +126,6 @@ module Gonebusy
|
|
126
126
|
return GetUserByIdResponse.from_hash(decoded)
|
127
127
|
end
|
128
128
|
|
129
|
-
# Return list of active Pro Users.
|
130
|
-
# @param [String] authorization Required parameter: A valid API key, in the format 'Token API_KEY'
|
131
|
-
# @return GetUsersProsResponse response from the API call
|
132
|
-
def get_users_pros(authorization)
|
133
|
-
|
134
|
-
# the base uri for api requests
|
135
|
-
_query_builder = Configuration.base_uri.dup
|
136
|
-
|
137
|
-
# prepare query string for API call
|
138
|
-
_query_builder << '/users/pros'
|
139
|
-
|
140
|
-
# validate and preprocess url
|
141
|
-
_query_url = APIHelper.clean_url _query_builder
|
142
|
-
|
143
|
-
# prepare headers
|
144
|
-
_headers = {
|
145
|
-
'accept' => 'application/json',
|
146
|
-
'Authorization' => Configuration.authorization,
|
147
|
-
'Authorization' => authorization
|
148
|
-
}
|
149
|
-
|
150
|
-
# create the HttpRequest object for the call
|
151
|
-
_request = @http_client.get _query_url, headers: _headers
|
152
|
-
|
153
|
-
# apply authentication
|
154
|
-
CustomAuth.apply(_request)
|
155
|
-
|
156
|
-
# execute the request
|
157
|
-
_context = execute_request(_request)
|
158
|
-
|
159
|
-
# endpoint error handling using HTTP status codes.
|
160
|
-
if _context.response.status_code == 400
|
161
|
-
raise EntitiesErrorException.new '400 - Bad Request', _context
|
162
|
-
elsif _context.response.status_code == 401
|
163
|
-
raise EntitiesErrorException.new '401 - Unauthorized/Missing Token', _context
|
164
|
-
elsif _context.response.status_code == 403
|
165
|
-
raise EntitiesErrorException.new '403 - Forbidden', _context
|
166
|
-
elsif _context.response.status_code == 500
|
167
|
-
raise APIException.new '500 - Unexpected error', _context
|
168
|
-
end
|
169
|
-
|
170
|
-
# global error handling using HTTP status codes.
|
171
|
-
validate_response(_context)
|
172
|
-
|
173
|
-
# return appropriate response type
|
174
|
-
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
175
|
-
return GetUsersProsResponse.from_hash(decoded)
|
176
|
-
end
|
177
|
-
|
178
129
|
# Create a User
|
179
130
|
# @param [String] authorization Required parameter: A valid API key, in the format 'Token API_KEY'
|
180
131
|
# @param [CreateUserBody] create_user_body Required parameter: the content of the request
|
data/lib/gonebusy.rb
CHANGED
@@ -77,7 +77,6 @@ require_relative 'gonebusy/models/delete_service_by_id_response.rb'
|
|
77
77
|
require_relative 'gonebusy/models/get_users_response.rb'
|
78
78
|
require_relative 'gonebusy/models/create_user_body.rb'
|
79
79
|
require_relative 'gonebusy/models/create_user_response.rb'
|
80
|
-
require_relative 'gonebusy/models/get_users_pros_response.rb'
|
81
80
|
require_relative 'gonebusy/models/get_user_by_id_response.rb'
|
82
81
|
require_relative 'gonebusy/models/update_user_by_id_body.rb'
|
83
82
|
require_relative 'gonebusy/models/update_user_by_id_response.rb'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gonebusy-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Agranov
|
@@ -143,7 +143,6 @@ files:
|
|
143
143
|
- lib/gonebusy/models/get_service_by_id_response.rb
|
144
144
|
- lib/gonebusy/models/get_services_response.rb
|
145
145
|
- lib/gonebusy/models/get_user_by_id_response.rb
|
146
|
-
- lib/gonebusy/models/get_users_pros_response.rb
|
147
146
|
- lib/gonebusy/models/get_users_response.rb
|
148
147
|
- lib/gonebusy/models/occurrence_enum.rb
|
149
148
|
- lib/gonebusy/models/recurs_by_enum.rb
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class GetUsersProsResponse < BaseModel
|
5
|
-
# TODO: Write general description for this method
|
6
|
-
# @return [List of EntitiesUserResponse]
|
7
|
-
attr_accessor :users
|
8
|
-
|
9
|
-
# A mapping from model property names to API property names
|
10
|
-
def self.names
|
11
|
-
if @hash.nil?
|
12
|
-
@hash = {}
|
13
|
-
@hash["users"] = "users"
|
14
|
-
end
|
15
|
-
@hash
|
16
|
-
end
|
17
|
-
|
18
|
-
def initialize(users = nil)
|
19
|
-
@users = users
|
20
|
-
end
|
21
|
-
|
22
|
-
# Creates an instance of the object from a hash
|
23
|
-
def self.from_hash(hash)
|
24
|
-
if hash == nil
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
# Parameter is an array, so we need to iterate through it
|
29
|
-
users = nil
|
30
|
-
if hash["users"] != nil
|
31
|
-
users = Array.new
|
32
|
-
hash["users"].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
|
33
|
-
end
|
34
|
-
|
35
|
-
# Create object from extracted values
|
36
|
-
GetUsersProsResponse.new(users)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|