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["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
|
+
CreateResourceResponse.new(resource)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -6,138 +6,136 @@ module Gonebusy
|
|
6
6
|
# @return [Integer]
|
7
7
|
attr_accessor :service_id
|
8
8
|
|
9
|
-
#
|
10
|
-
# @return [
|
11
|
-
attr_accessor :
|
9
|
+
# ID of User to create Schedule for. You must be authorized to manage this User Id and User must own desired Service and Resource.
|
10
|
+
# @return [Integer]
|
11
|
+
attr_accessor :user_id
|
12
12
|
|
13
|
-
#
|
14
|
-
# @return [
|
15
|
-
attr_accessor :
|
13
|
+
# ID of Resource being scheduled. If not provided and :user_id is not present, the default Resource of the API user is assumed to be the Resource being scheduled. If not provided and :user_id is present, the default Resource of the User is assumed to be the Resource being Scheduled.
|
14
|
+
# @return [Integer]
|
15
|
+
attr_accessor :resource_id
|
16
|
+
|
17
|
+
# Start Date of first TimeWindow. Several formats are supported: '2014-10-31', 'October 31, 2014'.
|
18
|
+
# @return [Date]
|
19
|
+
attr_accessor :start_date
|
16
20
|
|
17
21
|
# Optional End Date of first TimeWindow, leave blank for infinitely available. Several formats are supported: '2014-10-31', 'October 31, 2014'.
|
18
22
|
# @return [Date]
|
19
23
|
attr_accessor :end_date
|
20
24
|
|
25
|
+
# Start Time of first TimeWindow. Several formats are supported: '9am', '09:00', '9:00', '0900'
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :start_time
|
28
|
+
|
21
29
|
# End Time of first TimeWindow. Several formats are supported: '5pm', '17:00', '1700'
|
22
30
|
# @return [String]
|
23
31
|
attr_accessor :end_time
|
24
32
|
|
25
|
-
# Optional
|
26
|
-
# @return [
|
27
|
-
attr_accessor :
|
33
|
+
# Optional total number of minutes in TimeWindow. Useful when duration of window is greater than 24 hours.
|
34
|
+
# @return [Integer]
|
35
|
+
attr_accessor :total_minutes
|
28
36
|
|
29
|
-
#
|
30
|
-
# @return [
|
31
|
-
attr_accessor :
|
37
|
+
# List of comma-separated days of the week this window of time falls on. If provided, at least one must be specified.
|
38
|
+
# @return [String]
|
39
|
+
attr_accessor :days
|
32
40
|
|
33
41
|
# One of the possible recurrence values
|
34
42
|
# @return [RecursByEnum]
|
35
43
|
attr_accessor :recurs_by
|
36
44
|
|
37
|
-
#
|
38
|
-
# @return [
|
39
|
-
attr_accessor :
|
40
|
-
|
41
|
-
# Start Date of first TimeWindow. Several formats are supported: '2014-10-31', 'October 31, 2014'.
|
42
|
-
# @return [Date]
|
43
|
-
attr_accessor :start_date
|
44
|
-
|
45
|
-
# Start Time of first TimeWindow. Several formats are supported: '9am', '09:00', '9:00', '0900'
|
46
|
-
# @return [String]
|
47
|
-
attr_accessor :start_time
|
45
|
+
# Optional frequency of recurrence as specified by :recurs_by. E.g, :single, :every, :every_other, etc. If not provided, assumed to be :every
|
46
|
+
# @return [FrequencyEnum]
|
47
|
+
attr_accessor :frequency
|
48
48
|
|
49
|
-
# Optional
|
50
|
-
# @return [
|
51
|
-
attr_accessor :
|
49
|
+
# Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc. If not provided, assumed to be :every
|
50
|
+
# @return [OccurrenceEnum]
|
51
|
+
attr_accessor :occurrence
|
52
52
|
|
53
|
-
#
|
54
|
-
# @return [
|
55
|
-
attr_accessor :
|
53
|
+
# Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Schedule examples.
|
54
|
+
# @return [DateRecursByEnum]
|
55
|
+
attr_accessor :date_recurs_by
|
56
56
|
|
57
57
|
# A mapping from model property names to API property names
|
58
58
|
def self.names
|
59
|
-
if @
|
60
|
-
@
|
61
|
-
@
|
62
|
-
@
|
63
|
-
@
|
64
|
-
@
|
65
|
-
@
|
66
|
-
@
|
67
|
-
@
|
68
|
-
@
|
69
|
-
@
|
70
|
-
@
|
71
|
-
@
|
72
|
-
@
|
73
|
-
@
|
59
|
+
if @_hash.nil?
|
60
|
+
@_hash = {}
|
61
|
+
@_hash["service_id"] = "service_id"
|
62
|
+
@_hash["user_id"] = "user_id"
|
63
|
+
@_hash["resource_id"] = "resource_id"
|
64
|
+
@_hash["start_date"] = "start_date"
|
65
|
+
@_hash["end_date"] = "end_date"
|
66
|
+
@_hash["start_time"] = "start_time"
|
67
|
+
@_hash["end_time"] = "end_time"
|
68
|
+
@_hash["total_minutes"] = "total_minutes"
|
69
|
+
@_hash["days"] = "days"
|
70
|
+
@_hash["recurs_by"] = "recurs_by"
|
71
|
+
@_hash["frequency"] = "frequency"
|
72
|
+
@_hash["occurrence"] = "occurrence"
|
73
|
+
@_hash["date_recurs_by"] = "date_recurs_by"
|
74
74
|
end
|
75
|
-
@
|
75
|
+
@_hash
|
76
76
|
end
|
77
77
|
|
78
78
|
def initialize(service_id = nil,
|
79
|
-
|
80
|
-
days = nil,
|
81
|
-
end_date = nil,
|
82
|
-
end_time = nil,
|
83
|
-
frequency = nil,
|
84
|
-
occurrence = nil,
|
85
|
-
recurs_by = nil,
|
79
|
+
user_id = nil,
|
86
80
|
resource_id = nil,
|
87
81
|
start_date = nil,
|
82
|
+
end_date = nil,
|
88
83
|
start_time = nil,
|
84
|
+
end_time = nil,
|
89
85
|
total_minutes = nil,
|
90
|
-
|
86
|
+
days = nil,
|
87
|
+
recurs_by = nil,
|
88
|
+
frequency = nil,
|
89
|
+
occurrence = nil,
|
90
|
+
date_recurs_by = nil)
|
91
91
|
@service_id = service_id
|
92
|
-
@
|
93
|
-
@days = days
|
94
|
-
@end_date = end_date
|
95
|
-
@end_time = end_time
|
96
|
-
@frequency = frequency
|
97
|
-
@occurrence = occurrence
|
98
|
-
@recurs_by = recurs_by
|
92
|
+
@user_id = user_id
|
99
93
|
@resource_id = resource_id
|
100
94
|
@start_date = start_date
|
95
|
+
@end_date = end_date
|
101
96
|
@start_time = start_time
|
97
|
+
@end_time = end_time
|
102
98
|
@total_minutes = total_minutes
|
103
|
-
@
|
99
|
+
@days = days
|
100
|
+
@recurs_by = recurs_by
|
101
|
+
@frequency = frequency
|
102
|
+
@occurrence = occurrence
|
103
|
+
@date_recurs_by = date_recurs_by
|
104
104
|
end
|
105
105
|
|
106
106
|
# Creates an instance of the object from a hash
|
107
107
|
def self.from_hash(hash)
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
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
|
-
user_id)
|
140
|
-
end
|
108
|
+
return nil unless hash
|
109
|
+
|
110
|
+
# Extract variables from the hash
|
111
|
+
service_id = hash['service_id']
|
112
|
+
user_id = hash['user_id']
|
113
|
+
resource_id = hash['resource_id']
|
114
|
+
start_date = hash['start_date']
|
115
|
+
end_date = hash['end_date']
|
116
|
+
start_time = hash['start_time']
|
117
|
+
end_time = hash['end_time']
|
118
|
+
total_minutes = hash['total_minutes']
|
119
|
+
days = hash['days']
|
120
|
+
recurs_by = hash['recurs_by']
|
121
|
+
frequency = hash['frequency']
|
122
|
+
occurrence = hash['occurrence']
|
123
|
+
date_recurs_by = hash['date_recurs_by']
|
124
|
+
|
125
|
+
# Create object from extracted values
|
126
|
+
CreateScheduleBody.new(service_id,
|
127
|
+
user_id,
|
128
|
+
resource_id,
|
129
|
+
start_date,
|
130
|
+
end_date,
|
131
|
+
start_time,
|
132
|
+
end_time,
|
133
|
+
total_minutes,
|
134
|
+
days,
|
135
|
+
recurs_by,
|
136
|
+
frequency,
|
137
|
+
occurrence,
|
138
|
+
date_recurs_by)
|
141
139
|
end
|
142
140
|
end
|
143
141
|
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
|
+
CreateScheduleResponse.new(schedule)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -2,34 +2,34 @@
|
|
2
2
|
|
3
3
|
module Gonebusy
|
4
4
|
class CreateScheduleTimeWindowBody < BaseModel
|
5
|
-
#
|
5
|
+
# Start Date of TimeWindow. Several formats are supported: '2014-10-31', 'October 31, 2014'.
|
6
|
+
# @return [Date]
|
7
|
+
attr_accessor :start_date
|
8
|
+
|
9
|
+
# Start Time of TimeWindow. Several formats are supported: '9am', '09:00', '9:00', '0900'
|
6
10
|
# @return [String]
|
7
|
-
attr_accessor :
|
11
|
+
attr_accessor :start_time
|
8
12
|
|
9
13
|
# End Time of TimeWindow. Several formats are supported: '5pm', '17:00', '1700'
|
10
14
|
# @return [String]
|
11
15
|
attr_accessor :end_time
|
12
16
|
|
17
|
+
# List of comma-separated days of the week this window of time falls on. If provided, at least one must be specified.
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :days
|
20
|
+
|
13
21
|
# One of the possible recurrence values
|
14
22
|
# @return [RecursByEnum]
|
15
23
|
attr_accessor :recurs_by
|
16
24
|
|
17
|
-
# Start Date of TimeWindow. Several formats are supported: '2014-10-31', 'October 31, 2014'.
|
18
|
-
# @return [Date]
|
19
|
-
attr_accessor :start_date
|
20
|
-
|
21
|
-
# Start Time of TimeWindow. Several formats are supported: '9am', '09:00', '9:00', '0900'
|
22
|
-
# @return [String]
|
23
|
-
attr_accessor :start_time
|
24
|
-
|
25
|
-
# Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Schedule examples.
|
26
|
-
# @return [DateRecursByEnum]
|
27
|
-
attr_accessor :date_recurs_by
|
28
|
-
|
29
25
|
# Optional End Date of TimeWindow, leave blank for infinitely available. Several formats are supported: '2014-10-31', 'October 31, 2014'.
|
30
26
|
# @return [Date]
|
31
27
|
attr_accessor :end_date
|
32
28
|
|
29
|
+
# Optional total number of minutes in TimeWindow. Useful when duration of window is greater than 24 hours.
|
30
|
+
# @return [Integer]
|
31
|
+
attr_accessor :total_minutes
|
32
|
+
|
33
33
|
# Optional frequency of recurrence as specified by :recurs_by. E.g, :single, :every, :every_other, etc. If not provided, assumed to be :every
|
34
34
|
# @return [FrequencyEnum]
|
35
35
|
attr_accessor :frequency
|
@@ -38,79 +38,77 @@ module Gonebusy
|
|
38
38
|
# @return [OccurrenceEnum]
|
39
39
|
attr_accessor :occurrence
|
40
40
|
|
41
|
-
#
|
42
|
-
# @return [
|
43
|
-
attr_accessor :
|
41
|
+
# Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Schedule examples.
|
42
|
+
# @return [DateRecursByEnum]
|
43
|
+
attr_accessor :date_recurs_by
|
44
44
|
|
45
45
|
# A mapping from model property names to API property names
|
46
46
|
def self.names
|
47
|
-
if @
|
48
|
-
@
|
49
|
-
@
|
50
|
-
@
|
51
|
-
@
|
52
|
-
@
|
53
|
-
@
|
54
|
-
@
|
55
|
-
@
|
56
|
-
@
|
57
|
-
@
|
58
|
-
@
|
47
|
+
if @_hash.nil?
|
48
|
+
@_hash = {}
|
49
|
+
@_hash["start_date"] = "start_date"
|
50
|
+
@_hash["start_time"] = "start_time"
|
51
|
+
@_hash["end_time"] = "end_time"
|
52
|
+
@_hash["days"] = "days"
|
53
|
+
@_hash["recurs_by"] = "recurs_by"
|
54
|
+
@_hash["end_date"] = "end_date"
|
55
|
+
@_hash["total_minutes"] = "total_minutes"
|
56
|
+
@_hash["frequency"] = "frequency"
|
57
|
+
@_hash["occurrence"] = "occurrence"
|
58
|
+
@_hash["date_recurs_by"] = "date_recurs_by"
|
59
59
|
end
|
60
|
-
@
|
60
|
+
@_hash
|
61
61
|
end
|
62
62
|
|
63
|
-
def initialize(
|
63
|
+
def initialize(start_date = nil,
|
64
|
+
start_time = nil,
|
64
65
|
end_time = nil,
|
66
|
+
days = nil,
|
65
67
|
recurs_by = nil,
|
66
|
-
start_date = nil,
|
67
|
-
start_time = nil,
|
68
|
-
date_recurs_by = nil,
|
69
68
|
end_date = nil,
|
69
|
+
total_minutes = nil,
|
70
70
|
frequency = nil,
|
71
71
|
occurrence = nil,
|
72
|
-
|
73
|
-
@days = days
|
74
|
-
@end_time = end_time
|
75
|
-
@recurs_by = recurs_by
|
72
|
+
date_recurs_by = nil)
|
76
73
|
@start_date = start_date
|
77
74
|
@start_time = start_time
|
78
|
-
@
|
75
|
+
@end_time = end_time
|
76
|
+
@days = days
|
77
|
+
@recurs_by = recurs_by
|
79
78
|
@end_date = end_date
|
79
|
+
@total_minutes = total_minutes
|
80
80
|
@frequency = frequency
|
81
81
|
@occurrence = occurrence
|
82
|
-
@
|
82
|
+
@date_recurs_by = date_recurs_by
|
83
83
|
end
|
84
84
|
|
85
85
|
# Creates an instance of the object from a hash
|
86
86
|
def self.from_hash(hash)
|
87
|
-
|
88
|
-
nil
|
89
|
-
else
|
90
|
-
# Extract variables from the hash
|
91
|
-
days = hash['days']
|
92
|
-
end_time = hash['end_time']
|
93
|
-
recurs_by = hash['recurs_by']
|
94
|
-
start_date = hash['start_date']
|
95
|
-
start_time = hash['start_time']
|
96
|
-
date_recurs_by = hash['date_recurs_by']
|
97
|
-
end_date = hash['end_date']
|
98
|
-
frequency = hash['frequency']
|
99
|
-
occurrence = hash['occurrence']
|
100
|
-
total_minutes = hash['total_minutes']
|
87
|
+
return nil unless hash
|
101
88
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
89
|
+
# Extract variables from the hash
|
90
|
+
start_date = hash['start_date']
|
91
|
+
start_time = hash['start_time']
|
92
|
+
end_time = hash['end_time']
|
93
|
+
days = hash['days']
|
94
|
+
recurs_by = hash['recurs_by']
|
95
|
+
end_date = hash['end_date']
|
96
|
+
total_minutes = hash['total_minutes']
|
97
|
+
frequency = hash['frequency']
|
98
|
+
occurrence = hash['occurrence']
|
99
|
+
date_recurs_by = hash['date_recurs_by']
|
100
|
+
|
101
|
+
# Create object from extracted values
|
102
|
+
CreateScheduleTimeWindowBody.new(start_date,
|
103
|
+
start_time,
|
104
|
+
end_time,
|
105
|
+
days,
|
106
|
+
recurs_by,
|
107
|
+
end_date,
|
108
|
+
total_minutes,
|
109
|
+
frequency,
|
110
|
+
occurrence,
|
111
|
+
date_recurs_by)
|
114
112
|
end
|
115
113
|
end
|
116
114
|
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
|
+
CreateScheduleTimeWindowResponse.new(schedule)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|