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
@@ -6,13 +6,9 @@ module Gonebusy
|
|
6
6
|
# @return [Date]
|
7
7
|
attr_accessor :date
|
8
8
|
|
9
|
-
#
|
10
|
-
# @return [DateRecursByEnum]
|
11
|
-
attr_accessor :date_recurs_by
|
12
|
-
|
13
|
-
# List of comma-separated days of the week this Booking falls on. Useful for recurring Bookings. If provided, at least one must be specified.
|
9
|
+
# New time of booking. Several formats are supported: '9am', '09:00', '9:00', '0900'
|
14
10
|
# @return [String]
|
15
|
-
attr_accessor :
|
11
|
+
attr_accessor :time
|
16
12
|
|
17
13
|
# New length of time, in minutes, for the desired booking - if Service allows requesting a variable amount of time
|
18
14
|
# @return [Integer]
|
@@ -22,21 +18,25 @@ module Gonebusy
|
|
22
18
|
# @return [Date]
|
23
19
|
attr_accessor :end_date
|
24
20
|
|
21
|
+
# One of the possible recurrence values.
|
22
|
+
# @return [RecursByEnum]
|
23
|
+
attr_accessor :recurs_by
|
24
|
+
|
25
25
|
# Optional frequency of recurrence as specified by :recurs_by. E.g, :single, :every, :every_other, etc.
|
26
26
|
# @return [FrequencyEnum]
|
27
27
|
attr_accessor :frequency
|
28
28
|
|
29
|
+
# List of comma-separated days of the week this Booking falls on. Useful for recurring Bookings. If provided, at least one must be specified.
|
30
|
+
# @return [String]
|
31
|
+
attr_accessor :days
|
32
|
+
|
29
33
|
# Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc.
|
30
34
|
# @return [OccurrenceEnum]
|
31
35
|
attr_accessor :occurrence
|
32
36
|
|
33
|
-
#
|
34
|
-
# @return [
|
35
|
-
attr_accessor :
|
36
|
-
|
37
|
-
# New time of booking. Several formats are supported: '9am', '09:00', '9:00', '0900'
|
38
|
-
# @return [String]
|
39
|
-
attr_accessor :time
|
37
|
+
# Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Recurring Booking examples.
|
38
|
+
# @return [DateRecursByEnum]
|
39
|
+
attr_accessor :date_recurs_by
|
40
40
|
|
41
41
|
# When a recurring booking, one of: ['instance', 'all', 'infinite']
|
42
42
|
# @return [String]
|
@@ -44,73 +44,71 @@ module Gonebusy
|
|
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["date"] = "date"
|
50
|
+
@_hash["time"] = "time"
|
51
|
+
@_hash["duration"] = "duration"
|
52
|
+
@_hash["end_date"] = "end_date"
|
53
|
+
@_hash["recurs_by"] = "recurs_by"
|
54
|
+
@_hash["frequency"] = "frequency"
|
55
|
+
@_hash["days"] = "days"
|
56
|
+
@_hash["occurrence"] = "occurrence"
|
57
|
+
@_hash["date_recurs_by"] = "date_recurs_by"
|
58
|
+
@_hash["update_recurring"] = "update_recurring"
|
59
59
|
end
|
60
|
-
@
|
60
|
+
@_hash
|
61
61
|
end
|
62
62
|
|
63
63
|
def initialize(date = nil,
|
64
|
-
|
65
|
-
days = nil,
|
64
|
+
time = nil,
|
66
65
|
duration = nil,
|
67
66
|
end_date = nil,
|
67
|
+
recurs_by = nil,
|
68
68
|
frequency = nil,
|
69
|
+
days = nil,
|
69
70
|
occurrence = nil,
|
70
|
-
|
71
|
-
time = nil,
|
71
|
+
date_recurs_by = nil,
|
72
72
|
update_recurring = nil)
|
73
73
|
@date = date
|
74
|
-
@
|
75
|
-
@days = days
|
74
|
+
@time = time
|
76
75
|
@duration = duration
|
77
76
|
@end_date = end_date
|
77
|
+
@recurs_by = recurs_by
|
78
78
|
@frequency = frequency
|
79
|
+
@days = days
|
79
80
|
@occurrence = occurrence
|
80
|
-
@
|
81
|
-
@time = time
|
81
|
+
@date_recurs_by = date_recurs_by
|
82
82
|
@update_recurring = update_recurring
|
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
|
-
date = hash['date']
|
92
|
-
date_recurs_by = hash['date_recurs_by']
|
93
|
-
days = hash['days']
|
94
|
-
duration = hash['duration']
|
95
|
-
end_date = hash['end_date']
|
96
|
-
frequency = hash['frequency']
|
97
|
-
occurrence = hash['occurrence']
|
98
|
-
recurs_by = hash['recurs_by']
|
99
|
-
time = hash['time']
|
100
|
-
update_recurring = hash['update_recurring']
|
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
|
+
date = hash['date']
|
91
|
+
time = hash['time']
|
92
|
+
duration = hash['duration']
|
93
|
+
end_date = hash['end_date']
|
94
|
+
recurs_by = hash['recurs_by']
|
95
|
+
frequency = hash['frequency']
|
96
|
+
days = hash['days']
|
97
|
+
occurrence = hash['occurrence']
|
98
|
+
date_recurs_by = hash['date_recurs_by']
|
99
|
+
update_recurring = hash['update_recurring']
|
100
|
+
|
101
|
+
# Create object from extracted values
|
102
|
+
UpdateBookingByIdBody.new(date,
|
103
|
+
time,
|
104
|
+
duration,
|
105
|
+
end_date,
|
106
|
+
recurs_by,
|
107
|
+
frequency,
|
108
|
+
days,
|
109
|
+
occurrence,
|
110
|
+
date_recurs_by,
|
111
|
+
update_recurring)
|
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["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
|
+
UpdateBookingByIdResponse.new(booking)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -2,10 +2,6 @@
|
|
2
2
|
|
3
3
|
module Gonebusy
|
4
4
|
class UpdatePricingModelByIdBody < BaseModel
|
5
|
-
# 3 Letter ISO Currency Code
|
6
|
-
# @return [String]
|
7
|
-
attr_accessor :currency
|
8
|
-
|
9
5
|
# PricingModel Name
|
10
6
|
# @return [String]
|
11
7
|
attr_accessor :name
|
@@ -18,45 +14,47 @@ module Gonebusy
|
|
18
14
|
# @return [Float]
|
19
15
|
attr_accessor :price
|
20
16
|
|
17
|
+
# 3 Letter ISO Currency Code
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :currency
|
20
|
+
|
21
21
|
# A mapping from model property names to API property names
|
22
22
|
def self.names
|
23
|
-
if @
|
24
|
-
@
|
25
|
-
@
|
26
|
-
@
|
27
|
-
@
|
28
|
-
@
|
23
|
+
if @_hash.nil?
|
24
|
+
@_hash = {}
|
25
|
+
@_hash["name"] = "name"
|
26
|
+
@_hash["notes"] = "notes"
|
27
|
+
@_hash["price"] = "price"
|
28
|
+
@_hash["currency"] = "currency"
|
29
29
|
end
|
30
|
-
@
|
30
|
+
@_hash
|
31
31
|
end
|
32
32
|
|
33
|
-
def initialize(
|
34
|
-
name = nil,
|
33
|
+
def initialize(name = nil,
|
35
34
|
notes = nil,
|
36
|
-
price = nil
|
37
|
-
|
35
|
+
price = nil,
|
36
|
+
currency = nil)
|
38
37
|
@name = name
|
39
38
|
@notes = notes
|
40
39
|
@price = price
|
40
|
+
@currency = currency
|
41
41
|
end
|
42
42
|
|
43
43
|
# Creates an instance of the object from a hash
|
44
44
|
def self.from_hash(hash)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
price)
|
59
|
-
end
|
45
|
+
return nil unless hash
|
46
|
+
|
47
|
+
# Extract variables from the hash
|
48
|
+
name = hash['name']
|
49
|
+
notes = hash['notes']
|
50
|
+
price = hash['price']
|
51
|
+
currency = hash['currency']
|
52
|
+
|
53
|
+
# Create object from extracted values
|
54
|
+
UpdatePricingModelByIdBody.new(name,
|
55
|
+
notes,
|
56
|
+
price,
|
57
|
+
currency)
|
60
58
|
end
|
61
59
|
end
|
62
60
|
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["pricing_model"] = "pricing_model"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(pricing_model = 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
|
-
pricing_model = EntitiesPricingModelResponse.from_hash(hash['pricing_model']) if hash['pricing_model']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
pricing_model = EntitiesPricingModelResponse.from_hash(hash['pricing_model']) if hash['pricing_model']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
UpdatePricingModelByIdResponse.new(pricing_model)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -2,70 +2,68 @@
|
|
2
2
|
|
3
3
|
module Gonebusy
|
4
4
|
class UpdateResourceByIdBody < BaseModel
|
5
|
-
#
|
6
|
-
# @return [
|
7
|
-
attr_accessor :
|
5
|
+
# Resource Name
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :name
|
8
8
|
|
9
9
|
# Optional Description
|
10
10
|
# @return [String]
|
11
11
|
attr_accessor :description
|
12
12
|
|
13
|
+
# Optional Capacity
|
14
|
+
# @return [Integer]
|
15
|
+
attr_accessor :capacity
|
16
|
+
|
13
17
|
# Optional Gender
|
14
18
|
# @return [GenderEnum]
|
15
19
|
attr_accessor :gender
|
16
20
|
|
17
|
-
# Resource Name
|
18
|
-
# @return [String]
|
19
|
-
attr_accessor :name
|
20
|
-
|
21
21
|
# When Resource is a Thing, the type Id
|
22
22
|
# @return [Integer]
|
23
23
|
attr_accessor :thing_type_id
|
24
24
|
|
25
25
|
# A mapping from model property names to API property names
|
26
26
|
def self.names
|
27
|
-
if @
|
28
|
-
@
|
29
|
-
@
|
30
|
-
@
|
31
|
-
@
|
32
|
-
@
|
33
|
-
@
|
27
|
+
if @_hash.nil?
|
28
|
+
@_hash = {}
|
29
|
+
@_hash["name"] = "name"
|
30
|
+
@_hash["description"] = "description"
|
31
|
+
@_hash["capacity"] = "capacity"
|
32
|
+
@_hash["gender"] = "gender"
|
33
|
+
@_hash["thing_type_id"] = "thing_type_id"
|
34
34
|
end
|
35
|
-
@
|
35
|
+
@_hash
|
36
36
|
end
|
37
37
|
|
38
|
-
def initialize(
|
38
|
+
def initialize(name = nil,
|
39
39
|
description = nil,
|
40
|
+
capacity = nil,
|
40
41
|
gender = nil,
|
41
|
-
name = nil,
|
42
42
|
thing_type_id = nil)
|
43
|
-
@
|
43
|
+
@name = name
|
44
44
|
@description = description
|
45
|
+
@capacity = capacity
|
45
46
|
@gender = gender
|
46
|
-
@name = name
|
47
47
|
@thing_type_id = thing_type_id
|
48
48
|
end
|
49
49
|
|
50
50
|
# Creates an instance of the object from a hash
|
51
51
|
def self.from_hash(hash)
|
52
|
-
|
53
|
-
nil
|
54
|
-
else
|
55
|
-
# Extract variables from the hash
|
56
|
-
capacity = hash['capacity']
|
57
|
-
description = hash['description']
|
58
|
-
gender = hash['gender']
|
59
|
-
name = hash['name']
|
60
|
-
thing_type_id = hash['thing_type_id']
|
52
|
+
return nil unless hash
|
61
53
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
54
|
+
# Extract variables from the hash
|
55
|
+
name = hash['name']
|
56
|
+
description = hash['description']
|
57
|
+
capacity = hash['capacity']
|
58
|
+
gender = hash['gender']
|
59
|
+
thing_type_id = hash['thing_type_id']
|
60
|
+
|
61
|
+
# Create object from extracted values
|
62
|
+
UpdateResourceByIdBody.new(name,
|
63
|
+
description,
|
64
|
+
capacity,
|
65
|
+
gender,
|
66
|
+
thing_type_id)
|
69
67
|
end
|
70
68
|
end
|
71
69
|
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["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
|
+
UpdateResourceByIdResponse.new(resource)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -2,115 +2,113 @@
|
|
2
2
|
|
3
3
|
module Gonebusy
|
4
4
|
class UpdateScheduleTimeWindowByIdBody < BaseModel
|
5
|
-
#
|
6
|
-
# @return [
|
7
|
-
attr_accessor :
|
8
|
-
|
9
|
-
# List of comma-separated days of the week this window of time falls on. If provided, at least one must be specified.
|
10
|
-
# @return [String]
|
11
|
-
attr_accessor :days
|
5
|
+
# Start Date of TimeWindow. Several formats are supported: '2014-10-31', 'October 31, 2014'.
|
6
|
+
# @return [Date]
|
7
|
+
attr_accessor :start_date
|
12
8
|
|
13
9
|
# End Date of TimeWindow, leave blank for infinitely available. Several formats are supported: '2014-10-31', 'October 31, 2014'.
|
14
10
|
# @return [Date]
|
15
11
|
attr_accessor :end_date
|
16
12
|
|
13
|
+
# Start Time of first TimeWindow. Several formats are supported: '9am', '09:00', '9:00', '0900'
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :start_time
|
16
|
+
|
17
17
|
# End Time of first TimeWindow. Several formats are supported: '5pm', '17:00', '1700'
|
18
18
|
# @return [String]
|
19
19
|
attr_accessor :end_time
|
20
20
|
|
21
|
-
# Optional
|
22
|
-
# @return [
|
23
|
-
attr_accessor :
|
21
|
+
# Optional total number of minutes in TimeWindow. Useful when duration of window is greater than 24 hours.
|
22
|
+
# @return [Integer]
|
23
|
+
attr_accessor :total_minutes
|
24
24
|
|
25
|
-
#
|
26
|
-
# @return [
|
27
|
-
attr_accessor :
|
25
|
+
# List of comma-separated days of the week this window of time falls on. If provided, at least one must be specified.
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :days
|
28
28
|
|
29
29
|
# One of the possible recurrence values
|
30
30
|
# @return [RecursByEnum]
|
31
31
|
attr_accessor :recurs_by
|
32
32
|
|
33
|
-
#
|
34
|
-
# @return [
|
35
|
-
attr_accessor :
|
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
36
|
|
37
|
-
#
|
38
|
-
# @return [
|
39
|
-
attr_accessor :
|
37
|
+
# Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc. If not provided, assumed to be :every. See Schedule examples.
|
38
|
+
# @return [OccurrenceEnum]
|
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["end_date"] = "end_date"
|
51
|
+
@_hash["start_time"] = "start_time"
|
52
|
+
@_hash["end_time"] = "end_time"
|
53
|
+
@_hash["total_minutes"] = "total_minutes"
|
54
|
+
@_hash["days"] = "days"
|
55
|
+
@_hash["recurs_by"] = "recurs_by"
|
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(
|
64
|
-
days = nil,
|
63
|
+
def initialize(start_date = nil,
|
65
64
|
end_date = nil,
|
65
|
+
start_time = nil,
|
66
66
|
end_time = nil,
|
67
|
+
total_minutes = nil,
|
68
|
+
days = nil,
|
69
|
+
recurs_by = nil,
|
67
70
|
frequency = nil,
|
68
71
|
occurrence = nil,
|
69
|
-
|
70
|
-
|
71
|
-
start_time = nil,
|
72
|
-
total_minutes = nil)
|
73
|
-
@date_recurs_by = date_recurs_by
|
74
|
-
@days = days
|
72
|
+
date_recurs_by = nil)
|
73
|
+
@start_date = start_date
|
75
74
|
@end_date = end_date
|
75
|
+
@start_time = start_time
|
76
76
|
@end_time = end_time
|
77
|
+
@total_minutes = total_minutes
|
78
|
+
@days = days
|
79
|
+
@recurs_by = recurs_by
|
77
80
|
@frequency = frequency
|
78
81
|
@occurrence = occurrence
|
79
|
-
@
|
80
|
-
@start_date = start_date
|
81
|
-
@start_time = start_time
|
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
|
-
|
88
|
-
nil
|
89
|
-
else
|
90
|
-
# Extract variables from the hash
|
91
|
-
date_recurs_by = hash['date_recurs_by']
|
92
|
-
days = hash['days']
|
93
|
-
end_date = hash['end_date']
|
94
|
-
end_time = hash['end_time']
|
95
|
-
frequency = hash['frequency']
|
96
|
-
occurrence = hash['occurrence']
|
97
|
-
recurs_by = hash['recurs_by']
|
98
|
-
start_date = hash['start_date']
|
99
|
-
start_time = hash['start_time']
|
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
|
+
end_date = hash['end_date']
|
92
|
+
start_time = hash['start_time']
|
93
|
+
end_time = hash['end_time']
|
94
|
+
total_minutes = hash['total_minutes']
|
95
|
+
days = hash['days']
|
96
|
+
recurs_by = hash['recurs_by']
|
97
|
+
frequency = hash['frequency']
|
98
|
+
occurrence = hash['occurrence']
|
99
|
+
date_recurs_by = hash['date_recurs_by']
|
100
|
+
|
101
|
+
# Create object from extracted values
|
102
|
+
UpdateScheduleTimeWindowByIdBody.new(start_date,
|
103
|
+
end_date,
|
104
|
+
start_time,
|
105
|
+
end_time,
|
106
|
+
total_minutes,
|
107
|
+
days,
|
108
|
+
recurs_by,
|
109
|
+
frequency,
|
110
|
+
occurrence,
|
111
|
+
date_recurs_by)
|
114
112
|
end
|
115
113
|
end
|
116
114
|
end
|