gonebusy-ruby-client 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -6,13 +6,9 @@ module Gonebusy
6
6
  # @return [Date]
7
7
  attr_accessor :date
8
8
 
9
- # Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Recurring Booking examples.
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 :days
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
- # One of the possible recurrence values.
34
- # @return [RecursByEnum]
35
- attr_accessor :recurs_by
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 @hash.nil?
48
- @hash = {}
49
- @hash["date"] = "date"
50
- @hash["date_recurs_by"] = "date_recurs_by"
51
- @hash["days"] = "days"
52
- @hash["duration"] = "duration"
53
- @hash["end_date"] = "end_date"
54
- @hash["frequency"] = "frequency"
55
- @hash["occurrence"] = "occurrence"
56
- @hash["recurs_by"] = "recurs_by"
57
- @hash["time"] = "time"
58
- @hash["update_recurring"] = "update_recurring"
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
- @hash
60
+ @_hash
61
61
  end
62
62
 
63
63
  def initialize(date = nil,
64
- date_recurs_by = nil,
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
- recurs_by = nil,
71
- time = nil,
71
+ date_recurs_by = nil,
72
72
  update_recurring = nil)
73
73
  @date = date
74
- @date_recurs_by = date_recurs_by
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
- @recurs_by = recurs_by
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
- if hash == nil
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
- # Create object from extracted values
103
- UpdateBookingByIdBody.new(date,
104
- date_recurs_by,
105
- days,
106
- duration,
107
- end_date,
108
- frequency,
109
- occurrence,
110
- recurs_by,
111
- time,
112
- update_recurring)
113
- end
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 @hash.nil?
12
- @hash = {}
13
- @hash["booking"] = "booking"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["booking"] = "booking"
14
14
  end
15
- @hash
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
- if hash == nil
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
- # Create object from extracted values
31
- UpdateBookingByIdResponse.new(booking)
32
- end
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 @hash.nil?
24
- @hash = {}
25
- @hash["currency"] = "currency"
26
- @hash["name"] = "name"
27
- @hash["notes"] = "notes"
28
- @hash["price"] = "price"
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
- @hash
30
+ @_hash
31
31
  end
32
32
 
33
- def initialize(currency = nil,
34
- name = nil,
33
+ def initialize(name = nil,
35
34
  notes = nil,
36
- price = nil)
37
- @currency = currency
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
- if hash == nil
46
- nil
47
- else
48
- # Extract variables from the hash
49
- currency = hash['currency']
50
- name = hash['name']
51
- notes = hash['notes']
52
- price = hash['price']
53
-
54
- # Create object from extracted values
55
- UpdatePricingModelByIdBody.new(currency,
56
- name,
57
- notes,
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 @hash.nil?
12
- @hash = {}
13
- @hash["pricing_model"] = "pricing_model"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["pricing_model"] = "pricing_model"
14
14
  end
15
- @hash
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
- if hash == nil
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
- # Create object from extracted values
31
- UpdatePricingModelByIdResponse.new(pricing_model)
32
- end
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
- # Optional Capacity
6
- # @return [Integer]
7
- attr_accessor :capacity
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 @hash.nil?
28
- @hash = {}
29
- @hash["capacity"] = "capacity"
30
- @hash["description"] = "description"
31
- @hash["gender"] = "gender"
32
- @hash["name"] = "name"
33
- @hash["thing_type_id"] = "thing_type_id"
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
- @hash
35
+ @_hash
36
36
  end
37
37
 
38
- def initialize(capacity = nil,
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
- @capacity = capacity
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
- if hash == nil
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
- # Create object from extracted values
63
- UpdateResourceByIdBody.new(capacity,
64
- description,
65
- gender,
66
- name,
67
- thing_type_id)
68
- end
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 @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
- UpdateResourceByIdResponse.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
+ 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
- # Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Schedule examples.
6
- # @return [DateRecursByEnum]
7
- attr_accessor :date_recurs_by
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 frequency of recurrence as specified by :recurs_by. E.g, :single, :every, :every_other, etc. If not provided, assumed to be :every
22
- # @return [FrequencyEnum]
23
- attr_accessor :frequency
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
- # Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc. If not provided, assumed to be :every. See Schedule examples.
26
- # @return [OccurrenceEnum]
27
- attr_accessor :occurrence
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
- # Start Date of TimeWindow. Several formats are supported: '2014-10-31', 'October 31, 2014'.
34
- # @return [Date]
35
- attr_accessor :start_date
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
- # Start Time of first TimeWindow. Several formats are supported: '9am', '09:00', '9:00', '0900'
38
- # @return [String]
39
- attr_accessor :start_time
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
- # 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["date_recurs_by"] = "date_recurs_by"
50
- @hash["days"] = "days"
51
- @hash["end_date"] = "end_date"
52
- @hash["end_time"] = "end_time"
53
- @hash["frequency"] = "frequency"
54
- @hash["occurrence"] = "occurrence"
55
- @hash["recurs_by"] = "recurs_by"
56
- @hash["start_date"] = "start_date"
57
- @hash["start_time"] = "start_time"
58
- @hash["total_minutes"] = "total_minutes"
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
- @hash
60
+ @_hash
61
61
  end
62
62
 
63
- def initialize(date_recurs_by = nil,
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
- recurs_by = nil,
70
- start_date = nil,
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
- @recurs_by = recurs_by
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
- if hash == nil
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
- # Create object from extracted values
103
- UpdateScheduleTimeWindowByIdBody.new(date_recurs_by,
104
- days,
105
- end_date,
106
- end_time,
107
- frequency,
108
- occurrence,
109
- recurs_by,
110
- start_date,
111
- start_time,
112
- total_minutes)
113
- end
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