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.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +2 -1
  4. data/lib/gonebusy/controllers/bookings_controller.rb +77 -74
  5. data/lib/gonebusy/controllers/categories_controller.rb +29 -29
  6. data/lib/gonebusy/controllers/pricing_models_controller.rb +47 -47
  7. data/lib/gonebusy/controllers/resources_controller.rb +77 -77
  8. data/lib/gonebusy/controllers/schedules_controller.rb +92 -92
  9. data/lib/gonebusy/controllers/services_controller.rb +86 -86
  10. data/lib/gonebusy/controllers/users_controller.rb +56 -56
  11. data/lib/gonebusy/models/cancel_booking_by_id_response.rb +10 -12
  12. data/lib/gonebusy/models/create_booking_body.rb +78 -80
  13. data/lib/gonebusy/models/create_booking_response.rb +10 -12
  14. data/lib/gonebusy/models/create_category_body.rb +34 -36
  15. data/lib/gonebusy/models/create_category_response.rb +10 -12
  16. data/lib/gonebusy/models/create_pricing_model_body.rb +35 -37
  17. data/lib/gonebusy/models/create_pricing_model_response.rb +10 -12
  18. data/lib/gonebusy/models/create_resource_body.rb +39 -41
  19. data/lib/gonebusy/models/create_resource_response.rb +10 -12
  20. data/lib/gonebusy/models/create_schedule_body.rb +92 -94
  21. data/lib/gonebusy/models/create_schedule_response.rb +10 -12
  22. data/lib/gonebusy/models/create_schedule_time_window_body.rb +64 -66
  23. data/lib/gonebusy/models/create_schedule_time_window_response.rb +10 -12
  24. data/lib/gonebusy/models/create_service_body.rb +57 -59
  25. data/lib/gonebusy/models/create_service_response.rb +10 -12
  26. data/lib/gonebusy/models/create_user_body.rb +40 -42
  27. data/lib/gonebusy/models/create_user_response.rb +10 -12
  28. data/lib/gonebusy/models/delete_resource_by_id_response.rb +10 -12
  29. data/lib/gonebusy/models/delete_schedule_by_id_response.rb +10 -12
  30. data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +10 -12
  31. data/lib/gonebusy/models/delete_service_by_id_response.rb +10 -12
  32. data/lib/gonebusy/models/entities_address_entity.rb +69 -71
  33. data/lib/gonebusy/models/entities_availability_response.rb +21 -23
  34. data/lib/gonebusy/models/entities_booking_response.rb +32 -34
  35. data/lib/gonebusy/models/entities_category_response.rb +52 -54
  36. data/lib/gonebusy/models/entities_pricing_model_response.rb +44 -46
  37. data/lib/gonebusy/models/entities_resource_availabilities.rb +24 -26
  38. data/lib/gonebusy/models/entities_resource_response.rb +60 -62
  39. data/lib/gonebusy/models/entities_schedule_response.rb +26 -28
  40. data/lib/gonebusy/models/entities_search_response.rb +29 -31
  41. data/lib/gonebusy/models/entities_service_response.rb +82 -84
  42. data/lib/gonebusy/models/entities_slots.rb +13 -15
  43. data/lib/gonebusy/models/entities_thing_type_response.rb +13 -15
  44. data/lib/gonebusy/models/entities_time_window_response.rb +81 -83
  45. data/lib/gonebusy/models/entities_user_response.rb +95 -97
  46. data/lib/gonebusy/models/get_booking_by_id_response.rb +10 -12
  47. data/lib/gonebusy/models/get_bookings_response.rb +14 -16
  48. data/lib/gonebusy/models/get_categories_response.rb +14 -16
  49. data/lib/gonebusy/models/get_category_by_id_response.rb +10 -12
  50. data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +10 -12
  51. data/lib/gonebusy/models/get_pricing_models_response.rb +14 -16
  52. data/lib/gonebusy/models/get_resource_by_id_response.rb +10 -12
  53. data/lib/gonebusy/models/get_resource_things_response.rb +14 -16
  54. data/lib/gonebusy/models/get_resources_response.rb +14 -16
  55. data/lib/gonebusy/models/get_schedule_by_id_response.rb +10 -12
  56. data/lib/gonebusy/models/get_schedules_response.rb +14 -16
  57. data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +10 -12
  58. data/lib/gonebusy/models/get_service_by_id_response.rb +10 -12
  59. data/lib/gonebusy/models/get_services_response.rb +14 -16
  60. data/lib/gonebusy/models/get_user_by_id_response.rb +10 -12
  61. data/lib/gonebusy/models/get_users_response.rb +14 -16
  62. data/lib/gonebusy/models/search_query_response.rb +10 -12
  63. data/lib/gonebusy/models/update_booking_by_id_body.rb +58 -60
  64. data/lib/gonebusy/models/update_booking_by_id_response.rb +10 -12
  65. data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +28 -30
  66. data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +10 -12
  67. data/lib/gonebusy/models/update_resource_by_id_body.rb +33 -35
  68. data/lib/gonebusy/models/update_resource_by_id_response.rb +10 -12
  69. data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +71 -73
  70. data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +10 -12
  71. data/lib/gonebusy/models/update_service_by_id_body.rb +43 -45
  72. data/lib/gonebusy/models/update_service_by_id_response.rb +10 -12
  73. data/lib/gonebusy/models/update_user_by_id_body.rb +41 -43
  74. data/lib/gonebusy/models/update_user_by_id_response.rb +10 -12
  75. data/lib/gonebusy.rb +67 -67
  76. metadata +2 -3
  77. data/lib/gonebusy/exceptions/entities_error_exception.rb +0 -27
@@ -2,48 +2,46 @@
2
2
 
3
3
  module Gonebusy
4
4
  class EntitiesResourceAvailabilities < BaseModel
5
- # array of available date and time slots
6
- # @return [List of EntitiesSlots]
7
- attr_accessor :available_slots
8
-
9
5
  # id of Resource
10
6
  # @return [Integer]
11
7
  attr_accessor :id
12
8
 
9
+ # array of available date and time slots
10
+ # @return [List of EntitiesSlots]
11
+ attr_accessor :available_slots
12
+
13
13
  # A mapping from model property names to API property names
14
14
  def self.names
15
- if @hash.nil?
16
- @hash = {}
17
- @hash["available_slots"] = "available_slots"
18
- @hash["id"] = "id"
15
+ if @_hash.nil?
16
+ @_hash = {}
17
+ @_hash["id"] = "id"
18
+ @_hash["available_slots"] = "available_slots"
19
19
  end
20
- @hash
20
+ @_hash
21
21
  end
22
22
 
23
- def initialize(available_slots = nil,
24
- id = nil)
25
- @available_slots = available_slots
23
+ def initialize(id = nil,
24
+ available_slots = nil)
26
25
  @id = id
26
+ @available_slots = available_slots
27
27
  end
28
28
 
29
29
  # Creates an instance of the object from a hash
30
30
  def self.from_hash(hash)
31
- if hash == nil
32
- nil
33
- else
34
- # Extract variables from the hash
35
- # Parameter is an array, so we need to iterate through it
36
- available_slots = nil
37
- if hash['available_slots'] != nil
38
- available_slots = Array.new
39
- hash['available_slots'].each{|structure| available_slots << (EntitiesSlots.from_hash(structure) if structure)}
40
- end
41
- id = hash['id']
31
+ return nil unless hash
42
32
 
43
- # Create object from extracted values
44
- EntitiesResourceAvailabilities.new(available_slots,
45
- id)
33
+ # Extract variables from the hash
34
+ id = hash['id']
35
+ # Parameter is an array, so we need to iterate through it
36
+ available_slots = nil
37
+ if hash['available_slots'] != nil
38
+ available_slots = Array.new
39
+ hash['available_slots'].each{|structure| available_slots << (EntitiesSlots.from_hash(structure) if structure)}
46
40
  end
41
+
42
+ # Create object from extracted values
43
+ EntitiesResourceAvailabilities.new(id,
44
+ available_slots)
47
45
  end
48
46
  end
49
47
  end
@@ -2,18 +2,6 @@
2
2
 
3
3
  module Gonebusy
4
4
  class EntitiesResourceResponse < BaseModel
5
- # capacity of Resource, if applicable
6
- # @return [Integer]
7
- attr_accessor :capacity
8
-
9
- # description of Resource
10
- # @return [String]
11
- attr_accessor :description
12
-
13
- # gender of Resource, if applicable
14
- # @return [String]
15
- attr_accessor :gender
16
-
17
5
  # id of Resource
18
6
  # @return [Integer]
19
7
  attr_accessor :id
@@ -22,86 +10,96 @@ module Gonebusy
22
10
  # @return [String]
23
11
  attr_accessor :name
24
12
 
13
+ # description of Resource
14
+ # @return [String]
15
+ attr_accessor :description
16
+
25
17
  # id of User owning Resource
26
18
  # @return [Integer]
27
19
  attr_accessor :owner_id
28
20
 
29
- # if Calendar is primary, if applicable
30
- # @return [Boolean]
31
- attr_accessor :primary_cal
32
-
33
21
  # type of Resource
34
22
  # @return [String]
35
23
  attr_accessor :resource_type
36
24
 
25
+ # capacity of Resource, if applicable
26
+ # @return [Integer]
27
+ attr_accessor :capacity
28
+
29
+ # gender of Resource, if applicable
30
+ # @return [String]
31
+ attr_accessor :gender
32
+
37
33
  # type Id of Thing Resource, if applicable
38
34
  # @return [Integer]
39
35
  attr_accessor :thing_type_id
40
36
 
37
+ # if Calendar is primary, if applicable
38
+ # @return [Boolean]
39
+ attr_accessor :primary_cal
40
+
41
41
  # A mapping from model property names to API property names
42
42
  def self.names
43
- if @hash.nil?
44
- @hash = {}
45
- @hash["capacity"] = "capacity"
46
- @hash["description"] = "description"
47
- @hash["gender"] = "gender"
48
- @hash["id"] = "id"
49
- @hash["name"] = "name"
50
- @hash["owner_id"] = "owner_id"
51
- @hash["primary_cal"] = "primary_cal"
52
- @hash["resource_type"] = "resource_type"
53
- @hash["thing_type_id"] = "thing_type_id"
43
+ if @_hash.nil?
44
+ @_hash = {}
45
+ @_hash["id"] = "id"
46
+ @_hash["name"] = "name"
47
+ @_hash["description"] = "description"
48
+ @_hash["owner_id"] = "owner_id"
49
+ @_hash["resource_type"] = "resource_type"
50
+ @_hash["capacity"] = "capacity"
51
+ @_hash["gender"] = "gender"
52
+ @_hash["thing_type_id"] = "thing_type_id"
53
+ @_hash["primary_cal"] = "primary_cal"
54
54
  end
55
- @hash
55
+ @_hash
56
56
  end
57
57
 
58
- def initialize(capacity = nil,
59
- description = nil,
60
- gender = nil,
61
- id = nil,
58
+ def initialize(id = nil,
62
59
  name = nil,
60
+ description = nil,
63
61
  owner_id = nil,
64
- primary_cal = nil,
65
62
  resource_type = nil,
66
- thing_type_id = nil)
67
- @capacity = capacity
68
- @description = description
69
- @gender = gender
63
+ capacity = nil,
64
+ gender = nil,
65
+ thing_type_id = nil,
66
+ primary_cal = nil)
70
67
  @id = id
71
68
  @name = name
69
+ @description = description
72
70
  @owner_id = owner_id
73
- @primary_cal = primary_cal
74
71
  @resource_type = resource_type
72
+ @capacity = capacity
73
+ @gender = gender
75
74
  @thing_type_id = thing_type_id
75
+ @primary_cal = primary_cal
76
76
  end
77
77
 
78
78
  # Creates an instance of the object from a hash
79
79
  def self.from_hash(hash)
80
- if hash == nil
81
- nil
82
- else
83
- # Extract variables from the hash
84
- capacity = hash['capacity']
85
- description = hash['description']
86
- gender = hash['gender']
87
- id = hash['id']
88
- name = hash['name']
89
- owner_id = hash['owner_id']
90
- primary_cal = hash['primary_cal']
91
- resource_type = hash['resource_type']
92
- thing_type_id = hash['thing_type_id']
80
+ return nil unless hash
93
81
 
94
- # Create object from extracted values
95
- EntitiesResourceResponse.new(capacity,
96
- description,
97
- gender,
98
- id,
99
- name,
100
- owner_id,
101
- primary_cal,
102
- resource_type,
103
- thing_type_id)
104
- end
82
+ # Extract variables from the hash
83
+ id = hash['id']
84
+ name = hash['name']
85
+ description = hash['description']
86
+ owner_id = hash['owner_id']
87
+ resource_type = hash['resource_type']
88
+ capacity = hash['capacity']
89
+ gender = hash['gender']
90
+ thing_type_id = hash['thing_type_id']
91
+ primary_cal = hash['primary_cal']
92
+
93
+ # Create object from extracted values
94
+ EntitiesResourceResponse.new(id,
95
+ name,
96
+ description,
97
+ owner_id,
98
+ resource_type,
99
+ capacity,
100
+ gender,
101
+ thing_type_id,
102
+ primary_cal)
105
103
  end
106
104
  end
107
105
  end
@@ -24,15 +24,15 @@ module Gonebusy
24
24
 
25
25
  # A mapping from model property names to API property names
26
26
  def self.names
27
- if @hash.nil?
28
- @hash = {}
29
- @hash["id"] = "id"
30
- @hash["owner_id"] = "owner_id"
31
- @hash["resource_id"] = "resource_id"
32
- @hash["service_id"] = "service_id"
33
- @hash["time_windows"] = "time_windows"
27
+ if @_hash.nil?
28
+ @_hash = {}
29
+ @_hash["id"] = "id"
30
+ @_hash["owner_id"] = "owner_id"
31
+ @_hash["resource_id"] = "resource_id"
32
+ @_hash["service_id"] = "service_id"
33
+ @_hash["time_windows"] = "time_windows"
34
34
  end
35
- @hash
35
+ @_hash
36
36
  end
37
37
 
38
38
  def initialize(id = nil,
@@ -49,28 +49,26 @@ module Gonebusy
49
49
 
50
50
  # Creates an instance of the object from a hash
51
51
  def self.from_hash(hash)
52
- if hash == nil
53
- nil
54
- else
55
- # Extract variables from the hash
56
- id = hash['id']
57
- owner_id = hash['owner_id']
58
- resource_id = hash['resource_id']
59
- service_id = hash['service_id']
60
- # Parameter is an array, so we need to iterate through it
61
- time_windows = nil
62
- if hash['time_windows'] != nil
63
- time_windows = Array.new
64
- hash['time_windows'].each{|structure| time_windows << (EntitiesTimeWindowResponse.from_hash(structure) if structure)}
65
- end
52
+ return nil unless hash
66
53
 
67
- # Create object from extracted values
68
- EntitiesScheduleResponse.new(id,
69
- owner_id,
70
- resource_id,
71
- service_id,
72
- time_windows)
54
+ # Extract variables from the hash
55
+ id = hash['id']
56
+ owner_id = hash['owner_id']
57
+ resource_id = hash['resource_id']
58
+ service_id = hash['service_id']
59
+ # Parameter is an array, so we need to iterate through it
60
+ time_windows = nil
61
+ if hash['time_windows'] != nil
62
+ time_windows = Array.new
63
+ hash['time_windows'].each{|structure| time_windows << (EntitiesTimeWindowResponse.from_hash(structure) if structure)}
73
64
  end
65
+
66
+ # Create object from extracted values
67
+ EntitiesScheduleResponse.new(id,
68
+ owner_id,
69
+ resource_id,
70
+ service_id,
71
+ time_windows)
74
72
  end
75
73
  end
76
74
  end
@@ -2,53 +2,51 @@
2
2
 
3
3
  module Gonebusy
4
4
  class EntitiesSearchResponse < BaseModel
5
- # array of Services matching query
6
- # @return [List of EntitiesServiceResponse]
7
- attr_accessor :services
8
-
9
5
  # array of Users matching query
10
6
  # @return [List of EntitiesUserResponse]
11
7
  attr_accessor :users
12
8
 
9
+ # array of Services matching query
10
+ # @return [List of EntitiesServiceResponse]
11
+ attr_accessor :services
12
+
13
13
  # A mapping from model property names to API property names
14
14
  def self.names
15
- if @hash.nil?
16
- @hash = {}
17
- @hash["services"] = "services"
18
- @hash["users"] = "users"
15
+ if @_hash.nil?
16
+ @_hash = {}
17
+ @_hash["users"] = "users"
18
+ @_hash["services"] = "services"
19
19
  end
20
- @hash
20
+ @_hash
21
21
  end
22
22
 
23
- def initialize(services = nil,
24
- users = nil)
25
- @services = services
23
+ def initialize(users = nil,
24
+ services = nil)
26
25
  @users = users
26
+ @services = services
27
27
  end
28
28
 
29
29
  # Creates an instance of the object from a hash
30
30
  def self.from_hash(hash)
31
- if hash == nil
32
- nil
33
- else
34
- # Extract variables from the hash
35
- # Parameter is an array, so we need to iterate through it
36
- services = nil
37
- if hash['services'] != nil
38
- services = Array.new
39
- hash['services'].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
40
- end
41
- # Parameter is an array, so we need to iterate through it
42
- users = nil
43
- if hash['users'] != nil
44
- users = Array.new
45
- hash['users'].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
46
- end
31
+ return nil unless hash
47
32
 
48
- # Create object from extracted values
49
- EntitiesSearchResponse.new(services,
50
- users)
33
+ # Extract variables from the hash
34
+ # Parameter is an array, so we need to iterate through it
35
+ users = nil
36
+ if hash['users'] != nil
37
+ users = Array.new
38
+ hash['users'].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
39
+ end
40
+ # Parameter is an array, so we need to iterate through it
41
+ services = nil
42
+ if hash['services'] != nil
43
+ services = Array.new
44
+ hash['services'].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
51
45
  end
46
+
47
+ # Create object from extracted values
48
+ EntitiesSearchResponse.new(users,
49
+ services)
52
50
  end
53
51
  end
54
52
  end
@@ -2,42 +2,46 @@
2
2
 
3
3
  module Gonebusy
4
4
  class EntitiesServiceResponse < BaseModel
5
- # array of Category ids Service belongs to
6
- # @return [List of Integer]
7
- attr_accessor :categories
5
+ # id of Service
6
+ # @return [Integer]
7
+ attr_accessor :id
8
8
 
9
- # description of Service
9
+ # id of owner of Service
10
+ # @return [Integer]
11
+ attr_accessor :owner_id
12
+
13
+ # name of Service
10
14
  # @return [String]
11
- attr_accessor :description
15
+ attr_accessor :name
16
+
17
+ # abbreviated name for Service
18
+ # @return [String]
19
+ attr_accessor :short_name
12
20
 
13
21
  # length of Service in minutes
14
22
  # @return [Integer]
15
23
  attr_accessor :duration
16
24
 
17
- # id of Service
18
- # @return [Integer]
19
- attr_accessor :id
20
-
21
- # status of Service
22
- # @return [Boolean]
23
- attr_accessor :is_active
24
-
25
25
  # max length of Service in minutes
26
26
  # @return [Integer]
27
27
  attr_accessor :max_duration
28
28
 
29
- # name of Service
29
+ # description of Service
30
30
  # @return [String]
31
- attr_accessor :name
32
-
33
- # id of owner of Service
34
- # @return [Integer]
35
- attr_accessor :owner_id
31
+ attr_accessor :description
36
32
 
37
33
  # id of Pricing Model
38
34
  # @return [Integer]
39
35
  attr_accessor :price_model_id
40
36
 
37
+ # status of Service
38
+ # @return [Boolean]
39
+ attr_accessor :is_active
40
+
41
+ # array of Category ids Service belongs to
42
+ # @return [List of Integer]
43
+ attr_accessor :categories
44
+
41
45
  # array of Resource ids offering Service
42
46
  # @return [List of Integer]
43
47
  attr_accessor :resources
@@ -46,89 +50,83 @@ module Gonebusy
46
50
  # @return [List of Integer]
47
51
  attr_accessor :schedules
48
52
 
49
- # abbreviated name for Service
50
- # @return [String]
51
- attr_accessor :short_name
52
-
53
53
  # A mapping from model property names to API property names
54
54
  def self.names
55
- if @hash.nil?
56
- @hash = {}
57
- @hash["categories"] = "categories"
58
- @hash["description"] = "description"
59
- @hash["duration"] = "duration"
60
- @hash["id"] = "id"
61
- @hash["is_active"] = "is_active"
62
- @hash["max_duration"] = "max_duration"
63
- @hash["name"] = "name"
64
- @hash["owner_id"] = "owner_id"
65
- @hash["price_model_id"] = "price_model_id"
66
- @hash["resources"] = "resources"
67
- @hash["schedules"] = "schedules"
68
- @hash["short_name"] = "short_name"
55
+ if @_hash.nil?
56
+ @_hash = {}
57
+ @_hash["id"] = "id"
58
+ @_hash["owner_id"] = "owner_id"
59
+ @_hash["name"] = "name"
60
+ @_hash["short_name"] = "short_name"
61
+ @_hash["duration"] = "duration"
62
+ @_hash["max_duration"] = "max_duration"
63
+ @_hash["description"] = "description"
64
+ @_hash["price_model_id"] = "price_model_id"
65
+ @_hash["is_active"] = "is_active"
66
+ @_hash["categories"] = "categories"
67
+ @_hash["resources"] = "resources"
68
+ @_hash["schedules"] = "schedules"
69
69
  end
70
- @hash
70
+ @_hash
71
71
  end
72
72
 
73
- def initialize(categories = nil,
74
- description = nil,
73
+ def initialize(id = nil,
74
+ owner_id = nil,
75
+ name = nil,
76
+ short_name = nil,
75
77
  duration = nil,
76
- id = nil,
77
- is_active = nil,
78
78
  max_duration = nil,
79
- name = nil,
80
- owner_id = nil,
79
+ description = nil,
81
80
  price_model_id = nil,
81
+ is_active = nil,
82
+ categories = nil,
82
83
  resources = nil,
83
- schedules = nil,
84
- short_name = nil)
85
- @categories = categories
86
- @description = description
87
- @duration = duration
84
+ schedules = nil)
88
85
  @id = id
89
- @is_active = is_active
90
- @max_duration = max_duration
91
- @name = name
92
86
  @owner_id = owner_id
87
+ @name = name
88
+ @short_name = short_name
89
+ @duration = duration
90
+ @max_duration = max_duration
91
+ @description = description
93
92
  @price_model_id = price_model_id
93
+ @is_active = is_active
94
+ @categories = categories
94
95
  @resources = resources
95
96
  @schedules = schedules
96
- @short_name = short_name
97
97
  end
98
98
 
99
99
  # Creates an instance of the object from a hash
100
100
  def self.from_hash(hash)
101
- if hash == nil
102
- nil
103
- else
104
- # Extract variables from the hash
105
- categories = hash['categories']
106
- description = hash['description']
107
- duration = hash['duration']
108
- id = hash['id']
109
- is_active = hash['is_active']
110
- max_duration = hash['max_duration']
111
- name = hash['name']
112
- owner_id = hash['owner_id']
113
- price_model_id = hash['price_model_id']
114
- resources = hash['resources']
115
- schedules = hash['schedules']
116
- short_name = hash['short_name']
117
-
118
- # Create object from extracted values
119
- EntitiesServiceResponse.new(categories,
120
- description,
121
- duration,
122
- id,
123
- is_active,
124
- max_duration,
125
- name,
126
- owner_id,
127
- price_model_id,
128
- resources,
129
- schedules,
130
- short_name)
131
- end
101
+ return nil unless hash
102
+
103
+ # Extract variables from the hash
104
+ id = hash['id']
105
+ owner_id = hash['owner_id']
106
+ name = hash['name']
107
+ short_name = hash['short_name']
108
+ duration = hash['duration']
109
+ max_duration = hash['max_duration']
110
+ description = hash['description']
111
+ price_model_id = hash['price_model_id']
112
+ is_active = hash['is_active']
113
+ categories = hash['categories']
114
+ resources = hash['resources']
115
+ schedules = hash['schedules']
116
+
117
+ # Create object from extracted values
118
+ EntitiesServiceResponse.new(id,
119
+ owner_id,
120
+ name,
121
+ short_name,
122
+ duration,
123
+ max_duration,
124
+ description,
125
+ price_model_id,
126
+ is_active,
127
+ categories,
128
+ resources,
129
+ schedules)
132
130
  end
133
131
  end
134
132
  end
@@ -12,12 +12,12 @@ module Gonebusy
12
12
 
13
13
  # A mapping from model property names to API property names
14
14
  def self.names
15
- if @hash.nil?
16
- @hash = {}
17
- @hash["date"] = "date"
18
- @hash["slots"] = "slots"
15
+ if @_hash.nil?
16
+ @_hash = {}
17
+ @_hash["date"] = "date"
18
+ @_hash["slots"] = "slots"
19
19
  end
20
- @hash
20
+ @_hash
21
21
  end
22
22
 
23
23
  def initialize(date = nil,
@@ -28,17 +28,15 @@ module Gonebusy
28
28
 
29
29
  # Creates an instance of the object from a hash
30
30
  def self.from_hash(hash)
31
- if hash == nil
32
- nil
33
- else
34
- # Extract variables from the hash
35
- date = hash['date']
36
- slots = hash['slots']
31
+ return nil unless hash
37
32
 
38
- # Create object from extracted values
39
- EntitiesSlots.new(date,
40
- slots)
41
- end
33
+ # Extract variables from the hash
34
+ date = hash['date']
35
+ slots = hash['slots']
36
+
37
+ # Create object from extracted values
38
+ EntitiesSlots.new(date,
39
+ slots)
42
40
  end
43
41
  end
44
42
  end