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
@@ -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["id"] = "id"
|
18
|
+
@_hash["name"] = "name"
|
19
19
|
end
|
20
|
-
@
|
20
|
+
@_hash
|
21
21
|
end
|
22
22
|
|
23
23
|
def initialize(id = 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
|
-
id = hash['id']
|
36
|
-
name = hash['name']
|
31
|
+
return nil unless hash
|
37
32
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
33
|
+
# Extract variables from the hash
|
34
|
+
id = hash['id']
|
35
|
+
name = hash['name']
|
36
|
+
|
37
|
+
# Create object from extracted values
|
38
|
+
EntitiesThingTypeResponse.new(id,
|
39
|
+
name)
|
42
40
|
end
|
43
41
|
end
|
44
42
|
end
|
@@ -2,49 +2,49 @@
|
|
2
2
|
|
3
3
|
module Gonebusy
|
4
4
|
class EntitiesTimeWindowResponse < BaseModel
|
5
|
-
#
|
6
|
-
# @return [
|
7
|
-
attr_accessor :
|
5
|
+
# id of TimeWindow
|
6
|
+
# @return [Integer]
|
7
|
+
attr_accessor :id
|
8
8
|
|
9
|
-
#
|
10
|
-
# @return [
|
11
|
-
attr_accessor :
|
9
|
+
# start date
|
10
|
+
# @return [Date]
|
11
|
+
attr_accessor :start_date
|
12
12
|
|
13
13
|
# end date
|
14
14
|
# @return [Date]
|
15
15
|
attr_accessor :end_date
|
16
16
|
|
17
|
+
# start time
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :start_time
|
20
|
+
|
17
21
|
# end time
|
18
22
|
# @return [String]
|
19
23
|
attr_accessor :end_time
|
20
24
|
|
25
|
+
# total minutes spanned
|
26
|
+
# @return [Integer]
|
27
|
+
attr_accessor :total_minutes
|
28
|
+
|
29
|
+
# recurs by
|
30
|
+
# @return [String]
|
31
|
+
attr_accessor :recurs_by
|
32
|
+
|
21
33
|
# frequency
|
22
34
|
# @return [String]
|
23
35
|
attr_accessor :frequency
|
24
36
|
|
25
|
-
# id of TimeWindow
|
26
|
-
# @return [Integer]
|
27
|
-
attr_accessor :id
|
28
|
-
|
29
37
|
# occurrence
|
30
38
|
# @return [String]
|
31
39
|
attr_accessor :occurrence
|
32
40
|
|
33
|
-
#
|
34
|
-
# @return [String]
|
35
|
-
attr_accessor :recurs_by
|
36
|
-
|
37
|
-
# start date
|
38
|
-
# @return [Date]
|
39
|
-
attr_accessor :start_date
|
40
|
-
|
41
|
-
# start time
|
41
|
+
# date_recurs_by
|
42
42
|
# @return [String]
|
43
|
-
attr_accessor :
|
43
|
+
attr_accessor :date_recurs_by
|
44
44
|
|
45
|
-
#
|
46
|
-
# @return [
|
47
|
-
attr_accessor :
|
45
|
+
# array of days of week TimeWindow falls on
|
46
|
+
# @return [List of String]
|
47
|
+
attr_accessor :days
|
48
48
|
|
49
49
|
# true is available, false is unavailable
|
50
50
|
# @return [Boolean]
|
@@ -52,83 +52,81 @@ module Gonebusy
|
|
52
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["start_date"] = "start_date"
|
59
|
+
@_hash["end_date"] = "end_date"
|
60
|
+
@_hash["start_time"] = "start_time"
|
61
|
+
@_hash["end_time"] = "end_time"
|
62
|
+
@_hash["total_minutes"] = "total_minutes"
|
63
|
+
@_hash["recurs_by"] = "recurs_by"
|
64
|
+
@_hash["frequency"] = "frequency"
|
65
|
+
@_hash["occurrence"] = "occurrence"
|
66
|
+
@_hash["date_recurs_by"] = "date_recurs_by"
|
67
|
+
@_hash["days"] = "days"
|
68
|
+
@_hash["unavailable"] = "unavailable"
|
69
69
|
end
|
70
|
-
@
|
70
|
+
@_hash
|
71
71
|
end
|
72
72
|
|
73
|
-
def initialize(
|
74
|
-
|
73
|
+
def initialize(id = nil,
|
74
|
+
start_date = nil,
|
75
75
|
end_date = nil,
|
76
|
+
start_time = nil,
|
76
77
|
end_time = nil,
|
78
|
+
total_minutes = nil,
|
79
|
+
recurs_by = nil,
|
77
80
|
frequency = nil,
|
78
|
-
id = nil,
|
79
81
|
occurrence = nil,
|
80
|
-
|
81
|
-
|
82
|
-
start_time = nil,
|
83
|
-
total_minutes = nil,
|
82
|
+
date_recurs_by = nil,
|
83
|
+
days = nil,
|
84
84
|
unavailable = nil)
|
85
|
-
@date_recurs_by = date_recurs_by
|
86
|
-
@days = days
|
87
|
-
@end_date = end_date
|
88
|
-
@end_time = end_time
|
89
|
-
@frequency = frequency
|
90
85
|
@id = id
|
91
|
-
@occurrence = occurrence
|
92
|
-
@recurs_by = recurs_by
|
93
86
|
@start_date = start_date
|
87
|
+
@end_date = end_date
|
94
88
|
@start_time = start_time
|
89
|
+
@end_time = end_time
|
95
90
|
@total_minutes = total_minutes
|
91
|
+
@recurs_by = recurs_by
|
92
|
+
@frequency = frequency
|
93
|
+
@occurrence = occurrence
|
94
|
+
@date_recurs_by = date_recurs_by
|
95
|
+
@days = days
|
96
96
|
@unavailable = unavailable
|
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
|
-
unavailable)
|
131
|
-
end
|
101
|
+
return nil unless hash
|
102
|
+
|
103
|
+
# Extract variables from the hash
|
104
|
+
id = hash['id']
|
105
|
+
start_date = hash['start_date']
|
106
|
+
end_date = hash['end_date']
|
107
|
+
start_time = hash['start_time']
|
108
|
+
end_time = hash['end_time']
|
109
|
+
total_minutes = hash['total_minutes']
|
110
|
+
recurs_by = hash['recurs_by']
|
111
|
+
frequency = hash['frequency']
|
112
|
+
occurrence = hash['occurrence']
|
113
|
+
date_recurs_by = hash['date_recurs_by']
|
114
|
+
days = hash['days']
|
115
|
+
unavailable = hash['unavailable']
|
116
|
+
|
117
|
+
# Create object from extracted values
|
118
|
+
EntitiesTimeWindowResponse.new(id,
|
119
|
+
start_date,
|
120
|
+
end_date,
|
121
|
+
start_time,
|
122
|
+
end_time,
|
123
|
+
total_minutes,
|
124
|
+
recurs_by,
|
125
|
+
frequency,
|
126
|
+
occurrence,
|
127
|
+
date_recurs_by,
|
128
|
+
days,
|
129
|
+
unavailable)
|
132
130
|
end
|
133
131
|
end
|
134
132
|
end
|
@@ -2,151 +2,149 @@
|
|
2
2
|
|
3
3
|
module Gonebusy
|
4
4
|
class EntitiesUserResponse < BaseModel
|
5
|
-
# id of
|
5
|
+
# id of User
|
6
6
|
# @return [Integer]
|
7
|
-
attr_accessor :
|
8
|
-
|
9
|
-
# address of User
|
10
|
-
# @return [EntitiesAddressEntity]
|
11
|
-
attr_accessor :address
|
7
|
+
attr_accessor :id
|
12
8
|
|
13
|
-
#
|
14
|
-
# @return [
|
15
|
-
attr_accessor :
|
9
|
+
# id of defacto Resource for User
|
10
|
+
# @return [Integer]
|
11
|
+
attr_accessor :resource_id
|
16
12
|
|
17
|
-
#
|
18
|
-
# @return [
|
19
|
-
attr_accessor :
|
13
|
+
# id of Account Manager user for User
|
14
|
+
# @return [Integer]
|
15
|
+
attr_accessor :account_manager_id
|
20
16
|
|
21
17
|
# email of User
|
22
18
|
# @return [String]
|
23
19
|
attr_accessor :email
|
24
20
|
|
25
|
-
#
|
21
|
+
# phone number of User
|
26
22
|
# @return [String]
|
27
|
-
attr_accessor :
|
23
|
+
attr_accessor :phone
|
28
24
|
|
29
25
|
# first name of User
|
30
26
|
# @return [String]
|
31
27
|
attr_accessor :first_name
|
32
28
|
|
33
|
-
# id of User
|
34
|
-
# @return [Integer]
|
35
|
-
attr_accessor :id
|
36
|
-
|
37
29
|
# last name of User
|
38
30
|
# @return [String]
|
39
31
|
attr_accessor :last_name
|
40
32
|
|
33
|
+
# status of user
|
34
|
+
# @return [Boolean]
|
35
|
+
attr_accessor :disabled
|
36
|
+
|
37
|
+
# business name for User
|
38
|
+
# @return [String]
|
39
|
+
attr_accessor :business_name
|
40
|
+
|
41
|
+
# external url to business
|
42
|
+
# @return [String]
|
43
|
+
attr_accessor :external_url
|
44
|
+
|
41
45
|
# permalink of User
|
42
46
|
# @return [String]
|
43
47
|
attr_accessor :permalink
|
44
48
|
|
45
|
-
#
|
49
|
+
# timezone of User,
|
46
50
|
# @return [String]
|
47
|
-
attr_accessor :
|
51
|
+
attr_accessor :timezone
|
48
52
|
|
49
|
-
#
|
50
|
-
# @return [
|
51
|
-
attr_accessor :
|
53
|
+
# address of User
|
54
|
+
# @return [EntitiesAddressEntity]
|
55
|
+
attr_accessor :address
|
52
56
|
|
53
57
|
# User account type
|
54
58
|
# @return [String]
|
55
59
|
attr_accessor :role
|
56
60
|
|
57
|
-
# timezone of User,
|
58
|
-
# @return [String]
|
59
|
-
attr_accessor :timezone
|
60
|
-
|
61
61
|
# A mapping from model property names to API property names
|
62
62
|
def self.names
|
63
|
-
if @
|
64
|
-
@
|
65
|
-
@
|
66
|
-
@
|
67
|
-
@
|
68
|
-
@
|
69
|
-
@
|
70
|
-
@
|
71
|
-
@
|
72
|
-
@
|
73
|
-
@
|
74
|
-
@
|
75
|
-
@
|
76
|
-
@
|
77
|
-
@
|
78
|
-
@
|
63
|
+
if @_hash.nil?
|
64
|
+
@_hash = {}
|
65
|
+
@_hash["id"] = "id"
|
66
|
+
@_hash["resource_id"] = "resource_id"
|
67
|
+
@_hash["account_manager_id"] = "account_manager_id"
|
68
|
+
@_hash["email"] = "email"
|
69
|
+
@_hash["phone"] = "phone"
|
70
|
+
@_hash["first_name"] = "first_name"
|
71
|
+
@_hash["last_name"] = "last_name"
|
72
|
+
@_hash["disabled"] = "disabled"
|
73
|
+
@_hash["business_name"] = "business_name"
|
74
|
+
@_hash["external_url"] = "external_url"
|
75
|
+
@_hash["permalink"] = "permalink"
|
76
|
+
@_hash["timezone"] = "timezone"
|
77
|
+
@_hash["address"] = "address"
|
78
|
+
@_hash["role"] = "role"
|
79
79
|
end
|
80
|
-
@
|
80
|
+
@_hash
|
81
81
|
end
|
82
82
|
|
83
|
-
def initialize(
|
84
|
-
|
85
|
-
|
86
|
-
disabled = nil,
|
83
|
+
def initialize(id = nil,
|
84
|
+
resource_id = nil,
|
85
|
+
account_manager_id = nil,
|
87
86
|
email = nil,
|
88
|
-
|
87
|
+
phone = nil,
|
89
88
|
first_name = nil,
|
90
|
-
id = nil,
|
91
89
|
last_name = nil,
|
90
|
+
disabled = nil,
|
91
|
+
business_name = nil,
|
92
|
+
external_url = nil,
|
92
93
|
permalink = nil,
|
93
|
-
|
94
|
-
|
95
|
-
role = nil
|
96
|
-
|
94
|
+
timezone = nil,
|
95
|
+
address = nil,
|
96
|
+
role = nil)
|
97
|
+
@id = id
|
98
|
+
@resource_id = resource_id
|
97
99
|
@account_manager_id = account_manager_id
|
98
|
-
@address = address
|
99
|
-
@business_name = business_name
|
100
|
-
@disabled = disabled
|
101
100
|
@email = email
|
102
|
-
@
|
101
|
+
@phone = phone
|
103
102
|
@first_name = first_name
|
104
|
-
@id = id
|
105
103
|
@last_name = last_name
|
104
|
+
@disabled = disabled
|
105
|
+
@business_name = business_name
|
106
|
+
@external_url = external_url
|
106
107
|
@permalink = permalink
|
107
|
-
@phone = phone
|
108
|
-
@resource_id = resource_id
|
109
|
-
@role = role
|
110
108
|
@timezone = timezone
|
109
|
+
@address = address
|
110
|
+
@role = role
|
111
111
|
end
|
112
112
|
|
113
113
|
# Creates an instance of the object from a hash
|
114
114
|
def self.from_hash(hash)
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
timezone)
|
149
|
-
end
|
115
|
+
return nil unless hash
|
116
|
+
|
117
|
+
# Extract variables from the hash
|
118
|
+
id = hash['id']
|
119
|
+
resource_id = hash['resource_id']
|
120
|
+
account_manager_id = hash['account_manager_id']
|
121
|
+
email = hash['email']
|
122
|
+
phone = hash['phone']
|
123
|
+
first_name = hash['first_name']
|
124
|
+
last_name = hash['last_name']
|
125
|
+
disabled = hash['disabled']
|
126
|
+
business_name = hash['business_name']
|
127
|
+
external_url = hash['external_url']
|
128
|
+
permalink = hash['permalink']
|
129
|
+
timezone = hash['timezone']
|
130
|
+
address = EntitiesAddressEntity.from_hash(hash['address']) if hash['address']
|
131
|
+
role = hash['role']
|
132
|
+
|
133
|
+
# Create object from extracted values
|
134
|
+
EntitiesUserResponse.new(id,
|
135
|
+
resource_id,
|
136
|
+
account_manager_id,
|
137
|
+
email,
|
138
|
+
phone,
|
139
|
+
first_name,
|
140
|
+
last_name,
|
141
|
+
disabled,
|
142
|
+
business_name,
|
143
|
+
external_url,
|
144
|
+
permalink,
|
145
|
+
timezone,
|
146
|
+
address,
|
147
|
+
role)
|
150
148
|
end
|
151
149
|
end
|
152
150
|
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["booking"] = "booking"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(booking = 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
|
-
booking = EntitiesBookingResponse.from_hash(hash['booking']) if hash['booking']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
booking = EntitiesBookingResponse.from_hash(hash['booking']) if hash['booking']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
GetBookingByIdResponse.new(booking)
|
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["bookings"] = "bookings"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(bookings = 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
|
-
bookings = nil
|
30
|
-
if hash['bookings'] != nil
|
31
|
-
bookings = Array.new
|
32
|
-
hash['bookings'].each{|structure| bookings << (EntitiesBookingResponse.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
|
+
bookings = nil
|
29
|
+
if hash['bookings'] != nil
|
30
|
+
bookings = Array.new
|
31
|
+
hash['bookings'].each{|structure| bookings << (EntitiesBookingResponse.from_hash(structure) if structure)}
|
37
32
|
end
|
33
|
+
|
34
|
+
# Create object from extracted values
|
35
|
+
GetBookingsResponse.new(bookings)
|
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["categories"] = "categories"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(categories = 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
|
-
categories = nil
|
30
|
-
if hash['categories'] != nil
|
31
|
-
categories = Array.new
|
32
|
-
hash['categories'].each{|structure| categories << (EntitiesCategoryResponse.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
|
+
categories = nil
|
29
|
+
if hash['categories'] != nil
|
30
|
+
categories = Array.new
|
31
|
+
hash['categories'].each{|structure| categories << (EntitiesCategoryResponse.from_hash(structure) if structure)}
|
37
32
|
end
|
33
|
+
|
34
|
+
# Create object from extracted values
|
35
|
+
GetCategoriesResponse.new(categories)
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|