gonebusy-ruby-client 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +29 -68
  3. data/lib/gonebusy/api_helper.rb +181 -149
  4. data/lib/gonebusy/configuration.rb +51 -16
  5. data/lib/gonebusy/controllers/base_controller.rb +46 -45
  6. data/lib/gonebusy/controllers/bookings_controller.rb +257 -293
  7. data/lib/gonebusy/controllers/categories_controller.rb +151 -180
  8. data/lib/gonebusy/controllers/pricing_models_controller.rb +202 -241
  9. data/lib/gonebusy/controllers/resources_controller.rb +295 -355
  10. data/lib/gonebusy/controllers/schedules_controller.rb +361 -428
  11. data/lib/gonebusy/controllers/search_controller.rb +52 -63
  12. data/lib/gonebusy/controllers/services_controller.rb +310 -367
  13. data/lib/gonebusy/controllers/users_controller.rb +199 -239
  14. data/lib/gonebusy/exceptions/api_exception.rb +16 -16
  15. data/lib/gonebusy/exceptions/entities_error_error_exception.rb +27 -0
  16. data/lib/gonebusy/exceptions/entities_error_exception.rb +26 -26
  17. data/lib/gonebusy/gonebusy_client.rb +58 -58
  18. data/lib/gonebusy/http/auth/custom_auth.rb +15 -15
  19. data/lib/gonebusy/http/faraday_client.rb +43 -41
  20. data/lib/gonebusy/http/http_call_back.rb +17 -17
  21. data/lib/gonebusy/http/http_client.rb +84 -82
  22. data/lib/gonebusy/http/http_context.rb +15 -15
  23. data/lib/gonebusy/http/http_method_enum.rb +7 -7
  24. data/lib/gonebusy/http/http_request.rb +44 -44
  25. data/lib/gonebusy/http/http_response.rb +19 -19
  26. data/lib/gonebusy/models/base_model.rb +31 -31
  27. data/lib/gonebusy/models/cancel_booking_by_id_response.rb +35 -35
  28. data/lib/gonebusy/models/create_booking_body.rb +134 -80
  29. data/lib/gonebusy/models/create_booking_response.rb +35 -35
  30. data/lib/gonebusy/models/create_category_body.rb +71 -71
  31. data/lib/gonebusy/models/create_category_response.rb +35 -35
  32. data/lib/gonebusy/models/create_pricing_model_body.rb +80 -80
  33. data/lib/gonebusy/models/create_pricing_model_response.rb +35 -35
  34. data/lib/gonebusy/models/create_resource_body.rb +89 -89
  35. data/lib/gonebusy/models/create_resource_response.rb +35 -35
  36. data/lib/gonebusy/models/create_schedule_body.rb +143 -144
  37. data/lib/gonebusy/models/create_schedule_response.rb +35 -35
  38. data/lib/gonebusy/models/create_schedule_time_window_body.rb +116 -117
  39. data/lib/gonebusy/models/create_schedule_time_window_response.rb +35 -35
  40. data/lib/gonebusy/models/create_service_body.rb +107 -107
  41. data/lib/gonebusy/models/create_service_response.rb +35 -35
  42. data/lib/gonebusy/models/create_user_body.rb +89 -89
  43. data/lib/gonebusy/models/create_user_response.rb +35 -35
  44. data/lib/gonebusy/models/date_recurs_by_enum.rb +12 -12
  45. data/lib/gonebusy/models/delete_resource_by_id_response.rb +35 -35
  46. data/lib/gonebusy/models/delete_schedule_by_id_response.rb +35 -35
  47. data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +35 -35
  48. data/lib/gonebusy/models/delete_service_by_id_response.rb +35 -35
  49. data/lib/gonebusy/models/entities_address_entity.rb +116 -116
  50. data/lib/gonebusy/models/entities_availability_response.rb +58 -58
  51. data/lib/gonebusy/models/entities_booking_response.rb +71 -71
  52. data/lib/gonebusy/models/entities_category_response.rb +98 -98
  53. data/lib/gonebusy/models/entities_pricing_model_response.rb +89 -89
  54. data/lib/gonebusy/models/entities_resource_availabilities.rb +49 -49
  55. data/lib/gonebusy/models/entities_resource_response.rb +107 -107
  56. data/lib/gonebusy/models/entities_schedule_response.rb +76 -76
  57. data/lib/gonebusy/models/entities_search_response.rb +54 -54
  58. data/lib/gonebusy/models/entities_service_response.rb +134 -130
  59. data/lib/gonebusy/models/entities_slots.rb +44 -45
  60. data/lib/gonebusy/models/entities_thing_type_response.rb +44 -44
  61. data/lib/gonebusy/models/entities_time_window_response.rb +134 -135
  62. data/lib/gonebusy/models/entities_user_response.rb +152 -152
  63. data/lib/gonebusy/models/frequency_enum.rb +17 -17
  64. data/lib/gonebusy/models/gender_enum.rb +9 -9
  65. data/lib/gonebusy/models/get_booking_by_id_response.rb +35 -35
  66. data/lib/gonebusy/models/get_bookings_response.rb +40 -40
  67. data/lib/gonebusy/models/get_categories_response.rb +40 -40
  68. data/lib/gonebusy/models/get_category_by_id_response.rb +35 -35
  69. data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +35 -35
  70. data/lib/gonebusy/models/get_pricing_models_response.rb +40 -40
  71. data/lib/gonebusy/models/get_resource_by_id_response.rb +35 -35
  72. data/lib/gonebusy/models/get_resource_things_response.rb +40 -40
  73. data/lib/gonebusy/models/get_resources_response.rb +40 -40
  74. data/lib/gonebusy/models/get_schedule_by_id_response.rb +35 -35
  75. data/lib/gonebusy/models/get_schedules_response.rb +40 -40
  76. data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +35 -35
  77. data/lib/gonebusy/models/get_service_by_id_response.rb +35 -35
  78. data/lib/gonebusy/models/get_services_response.rb +40 -40
  79. data/lib/gonebusy/models/get_user_by_id_response.rb +35 -35
  80. data/lib/gonebusy/models/get_users_response.rb +40 -40
  81. data/lib/gonebusy/models/occurrence_enum.rb +21 -21
  82. data/lib/gonebusy/models/recurs_by_enum.rb +15 -15
  83. data/lib/gonebusy/models/search_query_response.rb +35 -35
  84. data/lib/gonebusy/models/update_booking_by_id_body.rb +116 -0
  85. data/lib/gonebusy/models/update_booking_by_id_response.rb +35 -35
  86. data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +62 -62
  87. data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +35 -35
  88. data/lib/gonebusy/models/update_resource_by_id_body.rb +71 -71
  89. data/lib/gonebusy/models/update_resource_by_id_response.rb +35 -35
  90. data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +116 -117
  91. data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +35 -35
  92. data/lib/gonebusy/models/update_service_by_id_body.rb +98 -98
  93. data/lib/gonebusy/models/update_service_by_id_response.rb +35 -35
  94. data/lib/gonebusy/models/update_user_by_id_body.rb +89 -89
  95. data/lib/gonebusy/models/update_user_by_id_response.rb +35 -35
  96. data/lib/gonebusy.rb +108 -104
  97. metadata +53 -17
@@ -1,89 +1,89 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class CreateResourceBody < BaseModel
5
- # Resource Name
6
- # @return [String]
7
- attr_accessor :name
8
-
9
- # Type of Resource
10
- # @return [String]
11
- attr_accessor :type
12
-
13
- # Optional Capacity
14
- # @return [Integer]
15
- attr_accessor :capacity
16
-
17
- # Optional Description
18
- # @return [String]
19
- attr_accessor :description
20
-
21
- # Optional Gender
22
- # @return [GenderEnum]
23
- attr_accessor :gender
24
-
25
- # When Resource is a Thing, the type Id
26
- # @return [Integer]
27
- attr_accessor :thing_type_id
28
-
29
- # Create a Resource for this User Id. You must be authorized to manage this User Id.
30
- # @return [Integer]
31
- attr_accessor :user_id
32
-
33
- # A mapping from model property names to API property names
34
- def self.names
35
- if @hash.nil?
36
- @hash = {}
37
- @hash["name"] = "name"
38
- @hash["type"] = "type"
39
- @hash["capacity"] = "capacity"
40
- @hash["description"] = "description"
41
- @hash["gender"] = "gender"
42
- @hash["thing_type_id"] = "thing_type_id"
43
- @hash["user_id"] = "user_id"
44
- end
45
- @hash
46
- end
47
-
48
- def initialize(name = nil,
49
- type = nil,
50
- capacity = nil,
51
- description = nil,
52
- gender = nil,
53
- thing_type_id = nil,
54
- user_id = nil)
55
- @name = name
56
- @type = type
57
- @capacity = capacity
58
- @description = description
59
- @gender = gender
60
- @thing_type_id = thing_type_id
61
- @user_id = user_id
62
- end
63
-
64
- # Creates an instance of the object from a hash
65
- def self.from_hash(hash)
66
- if hash == nil
67
- nil
68
- else
69
- # Extract variables from the hash
70
- name = hash["name"]
71
- type = hash["type"]
72
- capacity = hash["capacity"]
73
- description = hash["description"]
74
- gender = hash["gender"]
75
- thing_type_id = hash["thing_type_id"]
76
- user_id = hash["user_id"]
77
-
78
- # Create object from extracted values
79
- CreateResourceBody.new(name,
80
- type,
81
- capacity,
82
- description,
83
- gender,
84
- thing_type_id,
85
- user_id)
86
- end
87
- end
88
- end
89
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class CreateResourceBody < BaseModel
5
+ # Resource Name
6
+ # @return [String]
7
+ attr_accessor :name
8
+
9
+ # Type of Resource
10
+ # @return [String]
11
+ attr_accessor :type
12
+
13
+ # Optional Capacity
14
+ # @return [Integer]
15
+ attr_accessor :capacity
16
+
17
+ # Optional Description
18
+ # @return [String]
19
+ attr_accessor :description
20
+
21
+ # Optional Gender
22
+ # @return [GenderEnum]
23
+ attr_accessor :gender
24
+
25
+ # When Resource is a Thing, the type Id
26
+ # @return [Integer]
27
+ attr_accessor :thing_type_id
28
+
29
+ # Create a Resource for this User Id. You must be authorized to manage this User Id.
30
+ # @return [Integer]
31
+ attr_accessor :user_id
32
+
33
+ # A mapping from model property names to API property names
34
+ def self.names
35
+ if @hash.nil?
36
+ @hash = {}
37
+ @hash["name"] = "name"
38
+ @hash["type"] = "type"
39
+ @hash["capacity"] = "capacity"
40
+ @hash["description"] = "description"
41
+ @hash["gender"] = "gender"
42
+ @hash["thing_type_id"] = "thing_type_id"
43
+ @hash["user_id"] = "user_id"
44
+ end
45
+ @hash
46
+ end
47
+
48
+ def initialize(name = nil,
49
+ type = nil,
50
+ capacity = nil,
51
+ description = nil,
52
+ gender = nil,
53
+ thing_type_id = nil,
54
+ user_id = nil)
55
+ @name = name
56
+ @type = type
57
+ @capacity = capacity
58
+ @description = description
59
+ @gender = gender
60
+ @thing_type_id = thing_type_id
61
+ @user_id = user_id
62
+ end
63
+
64
+ # Creates an instance of the object from a hash
65
+ def self.from_hash(hash)
66
+ if hash == nil
67
+ nil
68
+ else
69
+ # Extract variables from the hash
70
+ name = hash['name']
71
+ type = hash['type']
72
+ capacity = hash['capacity']
73
+ description = hash['description']
74
+ gender = hash['gender']
75
+ thing_type_id = hash['thing_type_id']
76
+ user_id = hash['user_id']
77
+
78
+ # Create object from extracted values
79
+ CreateResourceBody.new(name,
80
+ type,
81
+ capacity,
82
+ description,
83
+ gender,
84
+ thing_type_id,
85
+ user_id)
86
+ end
87
+ end
88
+ end
89
+ end
@@ -1,35 +1,35 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class CreateResourceResponse < BaseModel
5
- # TODO: Write general description for this method
6
- # @return [EntitiesResourceResponse]
7
- attr_accessor :resource
8
-
9
- # A mapping from model property names to API property names
10
- def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["resource"] = "resource"
14
- end
15
- @hash
16
- end
17
-
18
- def initialize(resource = nil)
19
- @resource = resource
20
- end
21
-
22
- # Creates an instance of the object from a hash
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"]
29
-
30
- # Create object from extracted values
31
- CreateResourceResponse.new(resource)
32
- end
33
- end
34
- end
35
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class CreateResourceResponse < BaseModel
5
+ # TODO: Write general description for this method
6
+ # @return [EntitiesResourceResponse]
7
+ attr_accessor :resource
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["resource"] = "resource"
14
+ end
15
+ @hash
16
+ end
17
+
18
+ def initialize(resource = nil)
19
+ @resource = resource
20
+ end
21
+
22
+ # Creates an instance of the object from a hash
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']
29
+
30
+ # Create object from extracted values
31
+ CreateResourceResponse.new(resource)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,144 +1,143 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- require 'date'
4
- module Gonebusy
5
- class CreateScheduleBody < BaseModel
6
- # ID of Service being scheduled.
7
- # @return [Integer]
8
- attr_accessor :service_id
9
-
10
- # Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Schedule examples.
11
- # @return [DateRecursByEnum]
12
- attr_accessor :date_recurs_by
13
-
14
- # List of comma-separated days of the week this window of time falls on. If provided, at least one must be specified.
15
- # @return [String]
16
- attr_accessor :days
17
-
18
- # Optional End Date of first TimeWindow, leave blank for infinitely available. Several formats are supported: '2014-10-31', 'October 31, 2014'.
19
- # @return [DateTime]
20
- attr_accessor :end_date
21
-
22
- # End Time of first TimeWindow. Several formats are supported: '5pm', '17:00', '1700'
23
- # @return [String]
24
- attr_accessor :end_time
25
-
26
- # Optional frequency of recurrence as specified by :recurs_by. E.g, :single, :every, :every_other, etc. If not provided, assumed to be :every
27
- # @return [FrequencyEnum]
28
- attr_accessor :frequency
29
-
30
- # Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc. If not provided, assumed to be :every
31
- # @return [OccurrenceEnum]
32
- attr_accessor :occurrence
33
-
34
- # One of the possible recurrence values
35
- # @return [RecursByEnum]
36
- attr_accessor :recurs_by
37
-
38
- # 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.
39
- # @return [Integer]
40
- attr_accessor :resource_id
41
-
42
- # Start Date of first TimeWindow. Several formats are supported: '2014-10-31', 'October 31, 2014'.
43
- # @return [DateTime]
44
- attr_accessor :start_date
45
-
46
- # Start Time of first TimeWindow. Several formats are supported: '9am', '09:00', '9:00', '0900'
47
- # @return [String]
48
- attr_accessor :start_time
49
-
50
- # Optional total number of minutes in TimeWindow. Useful when duration of window is greater than 24 hours.
51
- # @return [Integer]
52
- attr_accessor :total_minutes
53
-
54
- # ID of User to create Schedule for. You must be authorized to manage this User Id and User must own desired Service and Resource.
55
- # @return [Integer]
56
- attr_accessor :user_id
57
-
58
- # A mapping from model property names to API property names
59
- def self.names
60
- if @hash.nil?
61
- @hash = {}
62
- @hash["service_id"] = "service_id"
63
- @hash["date_recurs_by"] = "date_recurs_by"
64
- @hash["days"] = "days"
65
- @hash["end_date"] = "end_date"
66
- @hash["end_time"] = "end_time"
67
- @hash["frequency"] = "frequency"
68
- @hash["occurrence"] = "occurrence"
69
- @hash["recurs_by"] = "recurs_by"
70
- @hash["resource_id"] = "resource_id"
71
- @hash["start_date"] = "start_date"
72
- @hash["start_time"] = "start_time"
73
- @hash["total_minutes"] = "total_minutes"
74
- @hash["user_id"] = "user_id"
75
- end
76
- @hash
77
- end
78
-
79
- def initialize(service_id = nil,
80
- date_recurs_by = nil,
81
- days = nil,
82
- end_date = nil,
83
- end_time = nil,
84
- frequency = nil,
85
- occurrence = nil,
86
- recurs_by = nil,
87
- resource_id = nil,
88
- start_date = nil,
89
- start_time = nil,
90
- total_minutes = nil,
91
- user_id = nil)
92
- @service_id = service_id
93
- @date_recurs_by = date_recurs_by
94
- @days = days
95
- @end_date = end_date
96
- @end_time = end_time
97
- @frequency = frequency
98
- @occurrence = occurrence
99
- @recurs_by = recurs_by
100
- @resource_id = resource_id
101
- @start_date = start_date
102
- @start_time = start_time
103
- @total_minutes = total_minutes
104
- @user_id = user_id
105
- end
106
-
107
- # Creates an instance of the object from a hash
108
- def self.from_hash(hash)
109
- if hash == nil
110
- nil
111
- else
112
- # Extract variables from the hash
113
- service_id = hash["service_id"]
114
- date_recurs_by = hash["date_recurs_by"]
115
- days = hash["days"]
116
- end_date = DateTime.iso8601(hash["end_date"]) if hash["end_date"]
117
- end_time = hash["end_time"]
118
- frequency = hash["frequency"]
119
- occurrence = hash["occurrence"]
120
- recurs_by = hash["recurs_by"]
121
- resource_id = hash["resource_id"]
122
- start_date = DateTime.iso8601(hash["start_date"]) if hash["start_date"]
123
- start_time = hash["start_time"]
124
- total_minutes = hash["total_minutes"]
125
- user_id = hash["user_id"]
126
-
127
- # Create object from extracted values
128
- CreateScheduleBody.new(service_id,
129
- date_recurs_by,
130
- days,
131
- end_date,
132
- end_time,
133
- frequency,
134
- occurrence,
135
- recurs_by,
136
- resource_id,
137
- start_date,
138
- start_time,
139
- total_minutes,
140
- user_id)
141
- end
142
- end
143
- end
144
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class CreateScheduleBody < BaseModel
5
+ # ID of Service being scheduled.
6
+ # @return [Integer]
7
+ attr_accessor :service_id
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
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
16
+
17
+ # Optional End Date of first TimeWindow, leave blank for infinitely available. Several formats are supported: '2014-10-31', 'October 31, 2014'.
18
+ # @return [Date]
19
+ attr_accessor :end_date
20
+
21
+ # End Time of first TimeWindow. Several formats are supported: '5pm', '17:00', '1700'
22
+ # @return [String]
23
+ attr_accessor :end_time
24
+
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
28
+
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
32
+
33
+ # One of the possible recurrence values
34
+ # @return [RecursByEnum]
35
+ attr_accessor :recurs_by
36
+
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
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
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
56
+
57
+ # A mapping from model property names to API property names
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"
74
+ end
75
+ @hash
76
+ end
77
+
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,
86
+ resource_id = nil,
87
+ start_date = nil,
88
+ start_time = nil,
89
+ total_minutes = nil,
90
+ user_id = nil)
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
99
+ @resource_id = resource_id
100
+ @start_date = start_date
101
+ @start_time = start_time
102
+ @total_minutes = total_minutes
103
+ @user_id = user_id
104
+ end
105
+
106
+ # Creates an instance of the object from a hash
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
141
+ end
142
+ end
143
+ end