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
@@ -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 @hash.nil?
12
- @hash = {}
13
- @hash["resource"] = "resource"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["resource"] = "resource"
14
14
  end
15
- @hash
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
- if hash == nil
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
- # Create object from extracted values
31
- CreateResourceResponse.new(resource)
32
- end
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
- # Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Schedule examples.
10
- # @return [DateRecursByEnum]
11
- attr_accessor :date_recurs_by
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
- # List of comma-separated days of the week this window of time falls on. If provided, at least one must be specified.
14
- # @return [String]
15
- attr_accessor :days
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 frequency of recurrence as specified by :recurs_by. E.g, :single, :every, :every_other, etc. If not provided, assumed to be :every
26
- # @return [FrequencyEnum]
27
- attr_accessor :frequency
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
- # Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc. If not provided, assumed to be :every
30
- # @return [OccurrenceEnum]
31
- attr_accessor :occurrence
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
- # 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.
38
- # @return [Integer]
39
- attr_accessor :resource_id
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 total number of minutes in TimeWindow. Useful when duration of window is greater than 24 hours.
50
- # @return [Integer]
51
- attr_accessor :total_minutes
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
- # ID of User to create Schedule for. You must be authorized to manage this User Id and User must own desired Service and Resource.
54
- # @return [Integer]
55
- attr_accessor :user_id
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 @hash.nil?
60
- @hash = {}
61
- @hash["service_id"] = "service_id"
62
- @hash["date_recurs_by"] = "date_recurs_by"
63
- @hash["days"] = "days"
64
- @hash["end_date"] = "end_date"
65
- @hash["end_time"] = "end_time"
66
- @hash["frequency"] = "frequency"
67
- @hash["occurrence"] = "occurrence"
68
- @hash["recurs_by"] = "recurs_by"
69
- @hash["resource_id"] = "resource_id"
70
- @hash["start_date"] = "start_date"
71
- @hash["start_time"] = "start_time"
72
- @hash["total_minutes"] = "total_minutes"
73
- @hash["user_id"] = "user_id"
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
- @hash
75
+ @_hash
76
76
  end
77
77
 
78
78
  def initialize(service_id = nil,
79
- date_recurs_by = nil,
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
- user_id = nil)
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
- @date_recurs_by = date_recurs_by
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
- @user_id = user_id
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
- if hash == nil
109
- nil
110
- else
111
- # Extract variables from the hash
112
- service_id = hash['service_id']
113
- date_recurs_by = hash['date_recurs_by']
114
- days = hash['days']
115
- end_date = hash['end_date']
116
- end_time = hash['end_time']
117
- frequency = hash['frequency']
118
- occurrence = hash['occurrence']
119
- recurs_by = hash['recurs_by']
120
- resource_id = hash['resource_id']
121
- start_date = hash['start_date']
122
- start_time = hash['start_time']
123
- total_minutes = hash['total_minutes']
124
- user_id = hash['user_id']
125
-
126
- # Create object from extracted values
127
- CreateScheduleBody.new(service_id,
128
- date_recurs_by,
129
- days,
130
- end_date,
131
- end_time,
132
- frequency,
133
- occurrence,
134
- recurs_by,
135
- resource_id,
136
- start_date,
137
- start_time,
138
- total_minutes,
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 @hash.nil?
12
- @hash = {}
13
- @hash["schedule"] = "schedule"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["schedule"] = "schedule"
14
14
  end
15
- @hash
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
- if hash == nil
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
- # Create object from extracted values
31
- CreateScheduleResponse.new(schedule)
32
- end
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
- # List of comma-separated days of the week this window of time falls on. If provided, at least one must be specified.
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 :days
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
- # Optional total number of minutes in TimeWindow. Useful when duration of window is greater than 24 hours.
42
- # @return [Integer]
43
- attr_accessor :total_minutes
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 @hash.nil?
48
- @hash = {}
49
- @hash["days"] = "days"
50
- @hash["end_time"] = "end_time"
51
- @hash["recurs_by"] = "recurs_by"
52
- @hash["start_date"] = "start_date"
53
- @hash["start_time"] = "start_time"
54
- @hash["date_recurs_by"] = "date_recurs_by"
55
- @hash["end_date"] = "end_date"
56
- @hash["frequency"] = "frequency"
57
- @hash["occurrence"] = "occurrence"
58
- @hash["total_minutes"] = "total_minutes"
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
- @hash
60
+ @_hash
61
61
  end
62
62
 
63
- def initialize(days = nil,
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
- total_minutes = nil)
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
- @date_recurs_by = date_recurs_by
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
- @total_minutes = total_minutes
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
- if hash == nil
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
- # Create object from extracted values
103
- CreateScheduleTimeWindowBody.new(days,
104
- end_time,
105
- recurs_by,
106
- start_date,
107
- start_time,
108
- date_recurs_by,
109
- end_date,
110
- frequency,
111
- occurrence,
112
- total_minutes)
113
- end
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 @hash.nil?
12
- @hash = {}
13
- @hash["schedule"] = "schedule"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["schedule"] = "schedule"
14
14
  end
15
- @hash
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
- if hash == nil
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
- # Create object from extracted values
31
- CreateScheduleTimeWindowResponse.new(schedule)
32
- end
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