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.
- checksums.yaml +4 -4
- data/README.md +29 -68
- data/lib/gonebusy/api_helper.rb +181 -149
- data/lib/gonebusy/configuration.rb +51 -16
- data/lib/gonebusy/controllers/base_controller.rb +46 -45
- data/lib/gonebusy/controllers/bookings_controller.rb +257 -293
- data/lib/gonebusy/controllers/categories_controller.rb +151 -180
- data/lib/gonebusy/controllers/pricing_models_controller.rb +202 -241
- data/lib/gonebusy/controllers/resources_controller.rb +295 -355
- data/lib/gonebusy/controllers/schedules_controller.rb +361 -428
- data/lib/gonebusy/controllers/search_controller.rb +52 -63
- data/lib/gonebusy/controllers/services_controller.rb +310 -367
- data/lib/gonebusy/controllers/users_controller.rb +199 -239
- data/lib/gonebusy/exceptions/api_exception.rb +16 -16
- data/lib/gonebusy/exceptions/entities_error_error_exception.rb +27 -0
- data/lib/gonebusy/exceptions/entities_error_exception.rb +26 -26
- data/lib/gonebusy/gonebusy_client.rb +58 -58
- data/lib/gonebusy/http/auth/custom_auth.rb +15 -15
- data/lib/gonebusy/http/faraday_client.rb +43 -41
- data/lib/gonebusy/http/http_call_back.rb +17 -17
- data/lib/gonebusy/http/http_client.rb +84 -82
- data/lib/gonebusy/http/http_context.rb +15 -15
- data/lib/gonebusy/http/http_method_enum.rb +7 -7
- data/lib/gonebusy/http/http_request.rb +44 -44
- data/lib/gonebusy/http/http_response.rb +19 -19
- data/lib/gonebusy/models/base_model.rb +31 -31
- data/lib/gonebusy/models/cancel_booking_by_id_response.rb +35 -35
- data/lib/gonebusy/models/create_booking_body.rb +134 -80
- data/lib/gonebusy/models/create_booking_response.rb +35 -35
- data/lib/gonebusy/models/create_category_body.rb +71 -71
- data/lib/gonebusy/models/create_category_response.rb +35 -35
- data/lib/gonebusy/models/create_pricing_model_body.rb +80 -80
- data/lib/gonebusy/models/create_pricing_model_response.rb +35 -35
- data/lib/gonebusy/models/create_resource_body.rb +89 -89
- data/lib/gonebusy/models/create_resource_response.rb +35 -35
- data/lib/gonebusy/models/create_schedule_body.rb +143 -144
- data/lib/gonebusy/models/create_schedule_response.rb +35 -35
- data/lib/gonebusy/models/create_schedule_time_window_body.rb +116 -117
- data/lib/gonebusy/models/create_schedule_time_window_response.rb +35 -35
- data/lib/gonebusy/models/create_service_body.rb +107 -107
- data/lib/gonebusy/models/create_service_response.rb +35 -35
- data/lib/gonebusy/models/create_user_body.rb +89 -89
- data/lib/gonebusy/models/create_user_response.rb +35 -35
- data/lib/gonebusy/models/date_recurs_by_enum.rb +12 -12
- data/lib/gonebusy/models/delete_resource_by_id_response.rb +35 -35
- data/lib/gonebusy/models/delete_schedule_by_id_response.rb +35 -35
- data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +35 -35
- data/lib/gonebusy/models/delete_service_by_id_response.rb +35 -35
- data/lib/gonebusy/models/entities_address_entity.rb +116 -116
- data/lib/gonebusy/models/entities_availability_response.rb +58 -58
- data/lib/gonebusy/models/entities_booking_response.rb +71 -71
- data/lib/gonebusy/models/entities_category_response.rb +98 -98
- data/lib/gonebusy/models/entities_pricing_model_response.rb +89 -89
- data/lib/gonebusy/models/entities_resource_availabilities.rb +49 -49
- data/lib/gonebusy/models/entities_resource_response.rb +107 -107
- data/lib/gonebusy/models/entities_schedule_response.rb +76 -76
- data/lib/gonebusy/models/entities_search_response.rb +54 -54
- data/lib/gonebusy/models/entities_service_response.rb +134 -130
- data/lib/gonebusy/models/entities_slots.rb +44 -45
- data/lib/gonebusy/models/entities_thing_type_response.rb +44 -44
- data/lib/gonebusy/models/entities_time_window_response.rb +134 -135
- data/lib/gonebusy/models/entities_user_response.rb +152 -152
- data/lib/gonebusy/models/frequency_enum.rb +17 -17
- data/lib/gonebusy/models/gender_enum.rb +9 -9
- data/lib/gonebusy/models/get_booking_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_bookings_response.rb +40 -40
- data/lib/gonebusy/models/get_categories_response.rb +40 -40
- data/lib/gonebusy/models/get_category_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_pricing_models_response.rb +40 -40
- data/lib/gonebusy/models/get_resource_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_resource_things_response.rb +40 -40
- data/lib/gonebusy/models/get_resources_response.rb +40 -40
- data/lib/gonebusy/models/get_schedule_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_schedules_response.rb +40 -40
- data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_service_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_services_response.rb +40 -40
- data/lib/gonebusy/models/get_user_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_users_response.rb +40 -40
- data/lib/gonebusy/models/occurrence_enum.rb +21 -21
- data/lib/gonebusy/models/recurs_by_enum.rb +15 -15
- data/lib/gonebusy/models/search_query_response.rb +35 -35
- data/lib/gonebusy/models/update_booking_by_id_body.rb +116 -0
- data/lib/gonebusy/models/update_booking_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +62 -62
- data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_resource_by_id_body.rb +71 -71
- data/lib/gonebusy/models/update_resource_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +116 -117
- data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_service_by_id_body.rb +98 -98
- data/lib/gonebusy/models/update_service_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_user_by_id_body.rb +89 -89
- data/lib/gonebusy/models/update_user_by_id_response.rb +35 -35
- data/lib/gonebusy.rb +108 -104
- metadata +53 -17
@@ -1,35 +1,35 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class CreateScheduleResponse < BaseModel
|
5
|
-
# TODO: Write general description for this method
|
6
|
-
# @return [EntitiesScheduleResponse]
|
7
|
-
attr_accessor :schedule
|
8
|
-
|
9
|
-
# A mapping from model property names to API property names
|
10
|
-
def self.names
|
11
|
-
if @hash.nil?
|
12
|
-
@hash = {}
|
13
|
-
@hash["schedule"] = "schedule"
|
14
|
-
end
|
15
|
-
@hash
|
16
|
-
end
|
17
|
-
|
18
|
-
def initialize(schedule = nil)
|
19
|
-
@schedule = schedule
|
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
|
-
schedule = EntitiesScheduleResponse.from_hash(hash[
|
29
|
-
|
30
|
-
# Create object from extracted values
|
31
|
-
CreateScheduleResponse.new(schedule)
|
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 CreateScheduleResponse < BaseModel
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [EntitiesScheduleResponse]
|
7
|
+
attr_accessor :schedule
|
8
|
+
|
9
|
+
# A mapping from model property names to API property names
|
10
|
+
def self.names
|
11
|
+
if @hash.nil?
|
12
|
+
@hash = {}
|
13
|
+
@hash["schedule"] = "schedule"
|
14
|
+
end
|
15
|
+
@hash
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(schedule = nil)
|
19
|
+
@schedule = schedule
|
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
|
+
schedule = EntitiesScheduleResponse.from_hash(hash['schedule']) if hash['schedule']
|
29
|
+
|
30
|
+
# Create object from extracted values
|
31
|
+
CreateScheduleResponse.new(schedule)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -1,117 +1,116 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
#
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
#
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
#
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
#
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
#
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
#
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
#
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
#
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
#
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
@hash =
|
50
|
-
@hash["
|
51
|
-
@hash["
|
52
|
-
@hash["
|
53
|
-
@hash["
|
54
|
-
@hash["
|
55
|
-
@hash["
|
56
|
-
@hash["
|
57
|
-
@hash["
|
58
|
-
@hash["
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
@
|
75
|
-
@
|
76
|
-
@
|
77
|
-
@
|
78
|
-
@
|
79
|
-
@
|
80
|
-
@
|
81
|
-
@
|
82
|
-
@
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
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.
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :days
|
8
|
+
|
9
|
+
# End Time of TimeWindow. Several formats are supported: '5pm', '17:00', '1700'
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :end_time
|
12
|
+
|
13
|
+
# One of the possible recurrence values
|
14
|
+
# @return [RecursByEnum]
|
15
|
+
attr_accessor :recurs_by
|
16
|
+
|
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
|
+
# Optional End Date of TimeWindow, leave blank for infinitely available. Several formats are supported: '2014-10-31', 'October 31, 2014'.
|
30
|
+
# @return [Date]
|
31
|
+
attr_accessor :end_date
|
32
|
+
|
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
|
+
# @return [FrequencyEnum]
|
35
|
+
attr_accessor :frequency
|
36
|
+
|
37
|
+
# Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc. If not provided, assumed to be :every
|
38
|
+
# @return [OccurrenceEnum]
|
39
|
+
attr_accessor :occurrence
|
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
|
44
|
+
|
45
|
+
# A mapping from model property names to API property names
|
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"
|
59
|
+
end
|
60
|
+
@hash
|
61
|
+
end
|
62
|
+
|
63
|
+
def initialize(days = nil,
|
64
|
+
end_time = nil,
|
65
|
+
recurs_by = nil,
|
66
|
+
start_date = nil,
|
67
|
+
start_time = nil,
|
68
|
+
date_recurs_by = nil,
|
69
|
+
end_date = nil,
|
70
|
+
frequency = nil,
|
71
|
+
occurrence = nil,
|
72
|
+
total_minutes = nil)
|
73
|
+
@days = days
|
74
|
+
@end_time = end_time
|
75
|
+
@recurs_by = recurs_by
|
76
|
+
@start_date = start_date
|
77
|
+
@start_time = start_time
|
78
|
+
@date_recurs_by = date_recurs_by
|
79
|
+
@end_date = end_date
|
80
|
+
@frequency = frequency
|
81
|
+
@occurrence = occurrence
|
82
|
+
@total_minutes = total_minutes
|
83
|
+
end
|
84
|
+
|
85
|
+
# Creates an instance of the object from a hash
|
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']
|
101
|
+
|
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
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
@@ -1,35 +1,35 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class CreateScheduleTimeWindowResponse < BaseModel
|
5
|
-
# TODO: Write general description for this method
|
6
|
-
# @return [EntitiesScheduleResponse]
|
7
|
-
attr_accessor :schedule
|
8
|
-
|
9
|
-
# A mapping from model property names to API property names
|
10
|
-
def self.names
|
11
|
-
if @hash.nil?
|
12
|
-
@hash = {}
|
13
|
-
@hash["schedule"] = "schedule"
|
14
|
-
end
|
15
|
-
@hash
|
16
|
-
end
|
17
|
-
|
18
|
-
def initialize(schedule = nil)
|
19
|
-
@schedule = schedule
|
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
|
-
schedule = EntitiesScheduleResponse.from_hash(hash[
|
29
|
-
|
30
|
-
# Create object from extracted values
|
31
|
-
CreateScheduleTimeWindowResponse.new(schedule)
|
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 CreateScheduleTimeWindowResponse < BaseModel
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [EntitiesScheduleResponse]
|
7
|
+
attr_accessor :schedule
|
8
|
+
|
9
|
+
# A mapping from model property names to API property names
|
10
|
+
def self.names
|
11
|
+
if @hash.nil?
|
12
|
+
@hash = {}
|
13
|
+
@hash["schedule"] = "schedule"
|
14
|
+
end
|
15
|
+
@hash
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(schedule = nil)
|
19
|
+
@schedule = schedule
|
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
|
+
schedule = EntitiesScheduleResponse.from_hash(hash['schedule']) if hash['schedule']
|
29
|
+
|
30
|
+
# Create object from extracted values
|
31
|
+
CreateScheduleTimeWindowResponse.new(schedule)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -1,107 +1,107 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class CreateServiceBody < BaseModel
|
5
|
-
# Service Description
|
6
|
-
# @return [String]
|
7
|
-
attr_accessor :description
|
8
|
-
|
9
|
-
# Duration of the Service
|
10
|
-
# @return [Integer]
|
11
|
-
attr_accessor :duration
|
12
|
-
|
13
|
-
#
|
14
|
-
# @return [
|
15
|
-
attr_accessor :
|
16
|
-
|
17
|
-
# Service
|
18
|
-
# @return [String]
|
19
|
-
attr_accessor :
|
20
|
-
|
21
|
-
#
|
22
|
-
# @return [
|
23
|
-
attr_accessor :
|
24
|
-
|
25
|
-
# Optional Price Model Id
|
26
|
-
# @return [Integer]
|
27
|
-
attr_accessor :price_model_id
|
28
|
-
|
29
|
-
# Optional List of comma-separated Resource IDs that will provide this Service, default: API user's resource id
|
30
|
-
# @return [String]
|
31
|
-
attr_accessor :resources
|
32
|
-
|
33
|
-
# Optional abbreviated Service name
|
34
|
-
# @return [String]
|
35
|
-
attr_accessor :short_name
|
36
|
-
|
37
|
-
# ID of User to create Service for. You must be authorized to manage this User Id.
|
38
|
-
# @return [Integer]
|
39
|
-
attr_accessor :user_id
|
40
|
-
|
41
|
-
# A mapping from model property names to API property names
|
42
|
-
def self.names
|
43
|
-
if @hash.nil?
|
44
|
-
@hash = {}
|
45
|
-
@hash["description"] = "description"
|
46
|
-
@hash["duration"] = "duration"
|
47
|
-
@hash["
|
48
|
-
@hash["
|
49
|
-
@hash["
|
50
|
-
@hash["price_model_id"] = "price_model_id"
|
51
|
-
@hash["resources"] = "resources"
|
52
|
-
@hash["short_name"] = "short_name"
|
53
|
-
@hash["user_id"] = "user_id"
|
54
|
-
end
|
55
|
-
@hash
|
56
|
-
end
|
57
|
-
|
58
|
-
def initialize(description = nil,
|
59
|
-
duration = nil,
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
price_model_id = nil,
|
64
|
-
resources = nil,
|
65
|
-
short_name = nil,
|
66
|
-
user_id = nil)
|
67
|
-
@description = description
|
68
|
-
@duration = duration
|
69
|
-
@
|
70
|
-
@
|
71
|
-
@
|
72
|
-
@price_model_id = price_model_id
|
73
|
-
@resources = resources
|
74
|
-
@short_name = short_name
|
75
|
-
@user_id = user_id
|
76
|
-
end
|
77
|
-
|
78
|
-
# Creates an instance of the object from a hash
|
79
|
-
def self.from_hash(hash)
|
80
|
-
if hash == nil
|
81
|
-
nil
|
82
|
-
else
|
83
|
-
# Extract variables from the hash
|
84
|
-
description = hash[
|
85
|
-
duration = hash[
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
price_model_id = hash[
|
90
|
-
resources = hash[
|
91
|
-
short_name = hash[
|
92
|
-
user_id = hash[
|
93
|
-
|
94
|
-
# Create object from extracted values
|
95
|
-
CreateServiceBody.new(description,
|
96
|
-
duration,
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
price_model_id,
|
101
|
-
resources,
|
102
|
-
short_name,
|
103
|
-
user_id)
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class CreateServiceBody < BaseModel
|
5
|
+
# Service Description
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :description
|
8
|
+
|
9
|
+
# Duration in minutes of the Service
|
10
|
+
# @return [Integer]
|
11
|
+
attr_accessor :duration
|
12
|
+
|
13
|
+
# Service Name
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :name
|
16
|
+
|
17
|
+
# Optional List of comma-separated Category IDs to associate with Service
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :categories
|
20
|
+
|
21
|
+
# Max duration of the Service in minutes
|
22
|
+
# @return [Integer]
|
23
|
+
attr_accessor :max_duration
|
24
|
+
|
25
|
+
# Optional Price Model Id
|
26
|
+
# @return [Integer]
|
27
|
+
attr_accessor :price_model_id
|
28
|
+
|
29
|
+
# Optional List of comma-separated Resource IDs that will provide this Service, default: API user's resource id
|
30
|
+
# @return [String]
|
31
|
+
attr_accessor :resources
|
32
|
+
|
33
|
+
# Optional abbreviated Service name
|
34
|
+
# @return [String]
|
35
|
+
attr_accessor :short_name
|
36
|
+
|
37
|
+
# ID of User to create Service for. You must be authorized to manage this User Id.
|
38
|
+
# @return [Integer]
|
39
|
+
attr_accessor :user_id
|
40
|
+
|
41
|
+
# A mapping from model property names to API property names
|
42
|
+
def self.names
|
43
|
+
if @hash.nil?
|
44
|
+
@hash = {}
|
45
|
+
@hash["description"] = "description"
|
46
|
+
@hash["duration"] = "duration"
|
47
|
+
@hash["name"] = "name"
|
48
|
+
@hash["categories"] = "categories"
|
49
|
+
@hash["max_duration"] = "max_duration"
|
50
|
+
@hash["price_model_id"] = "price_model_id"
|
51
|
+
@hash["resources"] = "resources"
|
52
|
+
@hash["short_name"] = "short_name"
|
53
|
+
@hash["user_id"] = "user_id"
|
54
|
+
end
|
55
|
+
@hash
|
56
|
+
end
|
57
|
+
|
58
|
+
def initialize(description = nil,
|
59
|
+
duration = nil,
|
60
|
+
name = nil,
|
61
|
+
categories = nil,
|
62
|
+
max_duration = nil,
|
63
|
+
price_model_id = nil,
|
64
|
+
resources = nil,
|
65
|
+
short_name = nil,
|
66
|
+
user_id = nil)
|
67
|
+
@description = description
|
68
|
+
@duration = duration
|
69
|
+
@name = name
|
70
|
+
@categories = categories
|
71
|
+
@max_duration = max_duration
|
72
|
+
@price_model_id = price_model_id
|
73
|
+
@resources = resources
|
74
|
+
@short_name = short_name
|
75
|
+
@user_id = user_id
|
76
|
+
end
|
77
|
+
|
78
|
+
# Creates an instance of the object from a hash
|
79
|
+
def self.from_hash(hash)
|
80
|
+
if hash == nil
|
81
|
+
nil
|
82
|
+
else
|
83
|
+
# Extract variables from the hash
|
84
|
+
description = hash['description']
|
85
|
+
duration = hash['duration']
|
86
|
+
name = hash['name']
|
87
|
+
categories = hash['categories']
|
88
|
+
max_duration = hash['max_duration']
|
89
|
+
price_model_id = hash['price_model_id']
|
90
|
+
resources = hash['resources']
|
91
|
+
short_name = hash['short_name']
|
92
|
+
user_id = hash['user_id']
|
93
|
+
|
94
|
+
# Create object from extracted values
|
95
|
+
CreateServiceBody.new(description,
|
96
|
+
duration,
|
97
|
+
name,
|
98
|
+
categories,
|
99
|
+
max_duration,
|
100
|
+
price_model_id,
|
101
|
+
resources,
|
102
|
+
short_name,
|
103
|
+
user_id)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|