gonebusy-ruby-client 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +2 -1
- data/lib/gonebusy/controllers/bookings_controller.rb +77 -74
- data/lib/gonebusy/controllers/categories_controller.rb +29 -29
- data/lib/gonebusy/controllers/pricing_models_controller.rb +47 -47
- data/lib/gonebusy/controllers/resources_controller.rb +77 -77
- data/lib/gonebusy/controllers/schedules_controller.rb +92 -92
- data/lib/gonebusy/controllers/services_controller.rb +86 -86
- data/lib/gonebusy/controllers/users_controller.rb +56 -56
- data/lib/gonebusy/models/cancel_booking_by_id_response.rb +10 -12
- data/lib/gonebusy/models/create_booking_body.rb +78 -80
- data/lib/gonebusy/models/create_booking_response.rb +10 -12
- data/lib/gonebusy/models/create_category_body.rb +34 -36
- data/lib/gonebusy/models/create_category_response.rb +10 -12
- data/lib/gonebusy/models/create_pricing_model_body.rb +35 -37
- data/lib/gonebusy/models/create_pricing_model_response.rb +10 -12
- data/lib/gonebusy/models/create_resource_body.rb +39 -41
- data/lib/gonebusy/models/create_resource_response.rb +10 -12
- data/lib/gonebusy/models/create_schedule_body.rb +92 -94
- data/lib/gonebusy/models/create_schedule_response.rb +10 -12
- data/lib/gonebusy/models/create_schedule_time_window_body.rb +64 -66
- data/lib/gonebusy/models/create_schedule_time_window_response.rb +10 -12
- data/lib/gonebusy/models/create_service_body.rb +57 -59
- data/lib/gonebusy/models/create_service_response.rb +10 -12
- data/lib/gonebusy/models/create_user_body.rb +40 -42
- data/lib/gonebusy/models/create_user_response.rb +10 -12
- data/lib/gonebusy/models/delete_resource_by_id_response.rb +10 -12
- data/lib/gonebusy/models/delete_schedule_by_id_response.rb +10 -12
- data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +10 -12
- data/lib/gonebusy/models/delete_service_by_id_response.rb +10 -12
- data/lib/gonebusy/models/entities_address_entity.rb +69 -71
- data/lib/gonebusy/models/entities_availability_response.rb +21 -23
- data/lib/gonebusy/models/entities_booking_response.rb +32 -34
- data/lib/gonebusy/models/entities_category_response.rb +52 -54
- data/lib/gonebusy/models/entities_pricing_model_response.rb +44 -46
- data/lib/gonebusy/models/entities_resource_availabilities.rb +24 -26
- data/lib/gonebusy/models/entities_resource_response.rb +60 -62
- data/lib/gonebusy/models/entities_schedule_response.rb +26 -28
- data/lib/gonebusy/models/entities_search_response.rb +29 -31
- data/lib/gonebusy/models/entities_service_response.rb +82 -84
- data/lib/gonebusy/models/entities_slots.rb +13 -15
- data/lib/gonebusy/models/entities_thing_type_response.rb +13 -15
- data/lib/gonebusy/models/entities_time_window_response.rb +81 -83
- data/lib/gonebusy/models/entities_user_response.rb +95 -97
- data/lib/gonebusy/models/get_booking_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_bookings_response.rb +14 -16
- data/lib/gonebusy/models/get_categories_response.rb +14 -16
- data/lib/gonebusy/models/get_category_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_pricing_models_response.rb +14 -16
- data/lib/gonebusy/models/get_resource_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_resource_things_response.rb +14 -16
- data/lib/gonebusy/models/get_resources_response.rb +14 -16
- data/lib/gonebusy/models/get_schedule_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_schedules_response.rb +14 -16
- data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_service_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_services_response.rb +14 -16
- data/lib/gonebusy/models/get_user_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_users_response.rb +14 -16
- data/lib/gonebusy/models/search_query_response.rb +10 -12
- data/lib/gonebusy/models/update_booking_by_id_body.rb +58 -60
- data/lib/gonebusy/models/update_booking_by_id_response.rb +10 -12
- data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +28 -30
- data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +10 -12
- data/lib/gonebusy/models/update_resource_by_id_body.rb +33 -35
- data/lib/gonebusy/models/update_resource_by_id_response.rb +10 -12
- data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +71 -73
- data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +10 -12
- data/lib/gonebusy/models/update_service_by_id_body.rb +43 -45
- data/lib/gonebusy/models/update_service_by_id_response.rb +10 -12
- data/lib/gonebusy/models/update_user_by_id_body.rb +41 -43
- data/lib/gonebusy/models/update_user_by_id_response.rb +10 -12
- data/lib/gonebusy.rb +67 -67
- metadata +2 -3
- data/lib/gonebusy/exceptions/entities_error_exception.rb +0 -27
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["category"] = "category"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(category = nil)
|
@@ -21,15 +21,13 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
category = EntitiesCategoryResponse.from_hash(hash['category']) if hash['category']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
category = EntitiesCategoryResponse.from_hash(hash['category']) if hash['category']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
GetCategoryByIdResponse.new(category)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["pricing_model"] = "pricing_model"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(pricing_model = nil)
|
@@ -21,15 +21,13 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
pricing_model = EntitiesPricingModelResponse.from_hash(hash['pricing_model']) if hash['pricing_model']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
pricing_model = EntitiesPricingModelResponse.from_hash(hash['pricing_model']) if hash['pricing_model']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
GetPricingModelByIdResponse.new(pricing_model)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["pricing_models"] = "pricing_models"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(pricing_models = nil)
|
@@ -21,20 +21,18 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
# Parameter is an array, so we need to iterate through it
|
29
|
-
pricing_models = nil
|
30
|
-
if hash['pricing_models'] != nil
|
31
|
-
pricing_models = Array.new
|
32
|
-
hash['pricing_models'].each{|structure| pricing_models << (EntitiesPricingModelResponse.from_hash(structure) if structure)}
|
33
|
-
end
|
24
|
+
return nil unless hash
|
34
25
|
|
35
|
-
|
36
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
# Parameter is an array, so we need to iterate through it
|
28
|
+
pricing_models = nil
|
29
|
+
if hash['pricing_models'] != nil
|
30
|
+
pricing_models = Array.new
|
31
|
+
hash['pricing_models'].each{|structure| pricing_models << (EntitiesPricingModelResponse.from_hash(structure) if structure)}
|
37
32
|
end
|
33
|
+
|
34
|
+
# Create object from extracted values
|
35
|
+
GetPricingModelsResponse.new(pricing_models)
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["resource"] = "resource"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(resource = nil)
|
@@ -21,15 +21,13 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
resource = EntitiesResourceResponse.from_hash(hash['resource']) if hash['resource']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
resource = EntitiesResourceResponse.from_hash(hash['resource']) if hash['resource']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
GetResourceByIdResponse.new(resource)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["things"] = "things"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(things = nil)
|
@@ -21,20 +21,18 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
# Parameter is an array, so we need to iterate through it
|
29
|
-
things = nil
|
30
|
-
if hash['things'] != nil
|
31
|
-
things = Array.new
|
32
|
-
hash['things'].each{|structure| things << (EntitiesThingTypeResponse.from_hash(structure) if structure)}
|
33
|
-
end
|
24
|
+
return nil unless hash
|
34
25
|
|
35
|
-
|
36
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
# Parameter is an array, so we need to iterate through it
|
28
|
+
things = nil
|
29
|
+
if hash['things'] != nil
|
30
|
+
things = Array.new
|
31
|
+
hash['things'].each{|structure| things << (EntitiesThingTypeResponse.from_hash(structure) if structure)}
|
37
32
|
end
|
33
|
+
|
34
|
+
# Create object from extracted values
|
35
|
+
GetResourceThingsResponse.new(things)
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["resources"] = "resources"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(resources = nil)
|
@@ -21,20 +21,18 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
# Parameter is an array, so we need to iterate through it
|
29
|
-
resources = nil
|
30
|
-
if hash['resources'] != nil
|
31
|
-
resources = Array.new
|
32
|
-
hash['resources'].each{|structure| resources << (EntitiesResourceResponse.from_hash(structure) if structure)}
|
33
|
-
end
|
24
|
+
return nil unless hash
|
34
25
|
|
35
|
-
|
36
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
# Parameter is an array, so we need to iterate through it
|
28
|
+
resources = nil
|
29
|
+
if hash['resources'] != nil
|
30
|
+
resources = Array.new
|
31
|
+
hash['resources'].each{|structure| resources << (EntitiesResourceResponse.from_hash(structure) if structure)}
|
37
32
|
end
|
33
|
+
|
34
|
+
# Create object from extracted values
|
35
|
+
GetResourcesResponse.new(resources)
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["schedule"] = "schedule"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(schedule = nil)
|
@@ -21,15 +21,13 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
schedule = EntitiesScheduleResponse.from_hash(hash['schedule']) if hash['schedule']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
schedule = EntitiesScheduleResponse.from_hash(hash['schedule']) if hash['schedule']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
GetScheduleByIdResponse.new(schedule)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["schedules"] = "schedules"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(schedules = nil)
|
@@ -21,20 +21,18 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
# Parameter is an array, so we need to iterate through it
|
29
|
-
schedules = nil
|
30
|
-
if hash['schedules'] != nil
|
31
|
-
schedules = Array.new
|
32
|
-
hash['schedules'].each{|structure| schedules << (EntitiesScheduleResponse.from_hash(structure) if structure)}
|
33
|
-
end
|
24
|
+
return nil unless hash
|
34
25
|
|
35
|
-
|
36
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
# Parameter is an array, so we need to iterate through it
|
28
|
+
schedules = nil
|
29
|
+
if hash['schedules'] != nil
|
30
|
+
schedules = Array.new
|
31
|
+
hash['schedules'].each{|structure| schedules << (EntitiesScheduleResponse.from_hash(structure) if structure)}
|
37
32
|
end
|
33
|
+
|
34
|
+
# Create object from extracted values
|
35
|
+
GetSchedulesResponse.new(schedules)
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["service"] = "service"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(service = nil)
|
@@ -21,15 +21,13 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
service = EntitiesAvailabilityResponse.from_hash(hash['service']) if hash['service']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
service = EntitiesAvailabilityResponse.from_hash(hash['service']) if hash['service']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
GetServiceAvailableSlotsByIdResponse.new(service)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["service"] = "service"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(service = nil)
|
@@ -21,15 +21,13 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
service = EntitiesServiceResponse.from_hash(hash['service']) if hash['service']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
service = EntitiesServiceResponse.from_hash(hash['service']) if hash['service']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
GetServiceByIdResponse.new(service)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["services"] = "services"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(services = nil)
|
@@ -21,20 +21,18 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
# Parameter is an array, so we need to iterate through it
|
29
|
-
services = nil
|
30
|
-
if hash['services'] != nil
|
31
|
-
services = Array.new
|
32
|
-
hash['services'].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
|
33
|
-
end
|
24
|
+
return nil unless hash
|
34
25
|
|
35
|
-
|
36
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
# Parameter is an array, so we need to iterate through it
|
28
|
+
services = nil
|
29
|
+
if hash['services'] != nil
|
30
|
+
services = Array.new
|
31
|
+
hash['services'].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
|
37
32
|
end
|
33
|
+
|
34
|
+
# Create object from extracted values
|
35
|
+
GetServicesResponse.new(services)
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["user"] = "user"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(user = nil)
|
@@ -21,15 +21,13 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
user = EntitiesUserResponse.from_hash(hash['user']) if hash['user']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
user = EntitiesUserResponse.from_hash(hash['user']) if hash['user']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
GetUserByIdResponse.new(user)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["users"] = "users"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(users = nil)
|
@@ -21,20 +21,18 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
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
|
24
|
+
return nil unless hash
|
34
25
|
|
35
|
-
|
36
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
# Parameter is an array, so we need to iterate through it
|
28
|
+
users = nil
|
29
|
+
if hash['users'] != nil
|
30
|
+
users = Array.new
|
31
|
+
hash['users'].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
|
37
32
|
end
|
33
|
+
|
34
|
+
# Create object from extracted values
|
35
|
+
GetUsersResponse.new(users)
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|
@@ -8,11 +8,11 @@ module Gonebusy
|
|
8
8
|
|
9
9
|
# A mapping from model property names to API property names
|
10
10
|
def self.names
|
11
|
-
if @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["results"] = "results"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(results = nil)
|
@@ -21,15 +21,13 @@ module Gonebusy
|
|
21
21
|
|
22
22
|
# Creates an instance of the object from a hash
|
23
23
|
def self.from_hash(hash)
|
24
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
results = EntitiesSearchResponse.from_hash(hash['results']) if hash['results']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
results = EntitiesSearchResponse.from_hash(hash['results']) if hash['results']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
SearchQueryResponse.new(results)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|