gonebusy-ruby-client 0.1.0 → 0.1.1
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/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
@@ -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 @
|
16
|
-
@
|
17
|
-
@
|
18
|
-
@
|
15
|
+
if @_hash.nil?
|
16
|
+
@_hash = {}
|
17
|
+
@_hash["id"] = "id"
|
18
|
+
@_hash["available_slots"] = "available_slots"
|
19
19
|
end
|
20
|
-
@
|
20
|
+
@_hash
|
21
21
|
end
|
22
22
|
|
23
|
-
def initialize(
|
24
|
-
|
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
|
-
|
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
|
-
|
44
|
-
|
45
|
-
|
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 @
|
44
|
-
@
|
45
|
-
@
|
46
|
-
@
|
47
|
-
@
|
48
|
-
@
|
49
|
-
@
|
50
|
-
@
|
51
|
-
@
|
52
|
-
@
|
53
|
-
@
|
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
|
-
@
|
55
|
+
@_hash
|
56
56
|
end
|
57
57
|
|
58
|
-
def initialize(
|
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
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
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
|
-
|
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
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
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 @
|
28
|
-
@
|
29
|
-
@
|
30
|
-
@
|
31
|
-
@
|
32
|
-
@
|
33
|
-
@
|
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
|
-
@
|
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
|
-
|
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
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
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 @
|
16
|
-
@
|
17
|
-
@
|
18
|
-
@
|
15
|
+
if @_hash.nil?
|
16
|
+
@_hash = {}
|
17
|
+
@_hash["users"] = "users"
|
18
|
+
@_hash["services"] = "services"
|
19
19
|
end
|
20
|
-
@
|
20
|
+
@_hash
|
21
21
|
end
|
22
22
|
|
23
|
-
def initialize(
|
24
|
-
|
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
|
-
|
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
|
-
|
49
|
-
|
50
|
-
|
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
|
-
#
|
6
|
-
# @return [
|
7
|
-
attr_accessor :
|
5
|
+
# id of Service
|
6
|
+
# @return [Integer]
|
7
|
+
attr_accessor :id
|
8
8
|
|
9
|
-
#
|
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 :
|
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
|
-
#
|
29
|
+
# description of Service
|
30
30
|
# @return [String]
|
31
|
-
attr_accessor :
|
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 @
|
56
|
-
@
|
57
|
-
@
|
58
|
-
@
|
59
|
-
@
|
60
|
-
@
|
61
|
-
@
|
62
|
-
@
|
63
|
-
@
|
64
|
-
@
|
65
|
-
@
|
66
|
-
@
|
67
|
-
@
|
68
|
-
@
|
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
|
-
@
|
70
|
+
@_hash
|
71
71
|
end
|
72
72
|
|
73
|
-
def initialize(
|
74
|
-
|
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
|
-
|
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
|
-
|
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
|
-
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 @
|
16
|
-
@
|
17
|
-
@
|
18
|
-
@
|
15
|
+
if @_hash.nil?
|
16
|
+
@_hash = {}
|
17
|
+
@_hash["date"] = "date"
|
18
|
+
@_hash["slots"] = "slots"
|
19
19
|
end
|
20
|
-
@
|
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
|
-
|
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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|