Class: Gonebusy::UpdateScheduleTimeWindowByIdBody
- Defined in:
- lib/gonebusy/models/update_schedule_time_window_by_id_body.rb
Instance Attribute Summary collapse
-
#date_recurs_by ⇒ DateRecursByEnum
Required only when :recurs_by is ‘monthly’ or ‘yearly’ to differentiate between exact date or ‘day in month/year’.
-
#days ⇒ String
List of comma-separated days of the week this window of time falls on.
-
#end_date ⇒ DateTime
End Date of TimeWindow, leave blank for infinitely available.
-
#end_time ⇒ String
End Time of first TimeWindow.
-
#frequency ⇒ FrequencyEnum
Optional frequency of recurrence as specified by :recurs_by.
-
#occurrence ⇒ OccurrenceEnum
Optional occurrence of frequency.
-
#recurs_by ⇒ RecursByEnum
One of the possible recurrence values.
-
#start_date ⇒ DateTime
Start Date of TimeWindow.
-
#start_time ⇒ String
Start Time of first TimeWindow.
-
#total_minutes ⇒ Integer
Optional total number of minutes in TimeWindow.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(date_recurs_by = nil, days = nil, end_date = nil, end_time = nil, frequency = nil, occurrence = nil, recurs_by = nil, start_date = nil, start_time = nil, total_minutes = nil) ⇒ UpdateScheduleTimeWindowByIdBody
constructor
A new instance of UpdateScheduleTimeWindowByIdBody.
Methods inherited from BaseModel
Constructor Details
#initialize(date_recurs_by = nil, days = nil, end_date = nil, end_time = nil, frequency = nil, occurrence = nil, recurs_by = nil, start_date = nil, start_time = nil, total_minutes = nil) ⇒ UpdateScheduleTimeWindowByIdBody
Returns a new instance of UpdateScheduleTimeWindowByIdBody.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 64 def initialize(date_recurs_by = nil, days = nil, end_date = nil, end_time = nil, frequency = nil, occurrence = nil, recurs_by = nil, start_date = nil, start_time = nil, total_minutes = nil) @date_recurs_by = date_recurs_by @days = days @end_date = end_date @end_time = end_time @frequency = frequency @occurrence = occurrence @recurs_by = recurs_by @start_date = start_date @start_time = start_time @total_minutes = total_minutes end |
Instance Attribute Details
#date_recurs_by ⇒ DateRecursByEnum
Required only when :recurs_by is ‘monthly’ or ‘yearly’ to differentiate between exact date or ‘day in month/year’. See Schedule examples.
8 9 10 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 8 def date_recurs_by @date_recurs_by end |
#days ⇒ String
List of comma-separated days of the week this window of time falls on. If provided, at least one must be specified.
12 13 14 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 12 def days @days end |
#end_date ⇒ DateTime
End Date of TimeWindow, leave blank for infinitely available. Several formats are supported: ‘2014-10-31’, ‘October 31, 2014’.
16 17 18 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 16 def end_date @end_date end |
#end_time ⇒ String
End Time of first TimeWindow. Several formats are supported: ‘5pm’, ‘17:00’, ‘1700’
20 21 22 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 20 def end_time @end_time end |
#frequency ⇒ FrequencyEnum
Optional frequency of recurrence as specified by :recurs_by. E.g, :single, :every, :every_other, etc. If not provided, assumed to be :every
24 25 26 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 24 def frequency @frequency end |
#occurrence ⇒ OccurrenceEnum
Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc. If not provided, assumed to be :every. See Schedule examples.
28 29 30 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 28 def occurrence @occurrence end |
#recurs_by ⇒ RecursByEnum
One of the possible recurrence values
32 33 34 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 32 def recurs_by @recurs_by end |
#start_date ⇒ DateTime
Start Date of TimeWindow. Several formats are supported: ‘2014-10-31’, ‘October 31, 2014’.
36 37 38 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 36 def start_date @start_date end |
#start_time ⇒ String
Start Time of first TimeWindow. Several formats are supported: ‘9am’, ‘09:00’, ‘9:00’, ‘0900’
40 41 42 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 40 def start_time @start_time end |
#total_minutes ⇒ Integer
Optional total number of minutes in TimeWindow. Useful when duration of window is greater than 24 hours.
44 45 46 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 44 def total_minutes @total_minutes end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
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 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 87 def self.from_hash(hash) if hash == nil nil else # Extract variables from the hash date_recurs_by = hash["date_recurs_by"] days = hash["days"] end_date = DateTime.iso8601(hash["end_date"]) if hash["end_date"] end_time = hash["end_time"] frequency = hash["frequency"] occurrence = hash["occurrence"] recurs_by = hash["recurs_by"] start_date = DateTime.iso8601(hash["start_date"]) if hash["start_date"] start_time = hash["start_time"] total_minutes = hash["total_minutes"] # Create object from extracted values UpdateScheduleTimeWindowByIdBody.new(date_recurs_by, days, end_date, end_time, frequency, occurrence, recurs_by, start_date, start_time, total_minutes) end end |
.names ⇒ Object
A mapping from model property names to API property names
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/gonebusy/models/update_schedule_time_window_by_id_body.rb', line 47 def self.names if @hash.nil? @hash = {} @hash["date_recurs_by"] = "date_recurs_by" @hash["days"] = "days" @hash["end_date"] = "end_date" @hash["end_time"] = "end_time" @hash["frequency"] = "frequency" @hash["occurrence"] = "occurrence" @hash["recurs_by"] = "recurs_by" @hash["start_date"] = "start_date" @hash["start_time"] = "start_time" @hash["total_minutes"] = "total_minutes" end @hash end |