Class: Gonebusy::UpdateBookingByIdBody
- Defined in:
- lib/gonebusy/models/update_booking_by_id_body.rb
Instance Attribute Summary collapse
-
#date ⇒ Date
New date of booking.
-
#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 Booking falls on.
-
#description ⇒ String
New description for Booking.
-
#duration ⇒ Integer
New length of time, in minutes, for the desired booking - if Service allows requesting a variable amount of time.
-
#end_date ⇒ Date
New end date of a recurring booking.
-
#frequency ⇒ FrequencyEnum
Optional frequency of recurrence as specified by :recurs_by.
-
#name ⇒ String
New name for Booking.
-
#occurrence ⇒ OccurrenceEnum
Optional occurrence of frequency.
-
#recurs_by ⇒ RecursByEnum
One of the possible recurrence values.
-
#time ⇒ String
New time of booking.
-
#update_recurring ⇒ String
When a recurring booking, one of: [‘instance’, ‘all’, ‘infinite’].
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 = nil, time = nil, duration = nil, end_date = nil, recurs_by = nil, frequency = nil, days = nil, occurrence = nil, date_recurs_by = nil, update_recurring = nil, name = nil, description = nil) ⇒ UpdateBookingByIdBody
constructor
A new instance of UpdateBookingByIdBody.
Methods inherited from BaseModel
Constructor Details
#initialize(date = nil, time = nil, duration = nil, end_date = nil, recurs_by = nil, frequency = nil, days = nil, occurrence = nil, date_recurs_by = nil, update_recurring = nil, name = nil, description = nil) ⇒ UpdateBookingByIdBody
Returns a new instance of UpdateBookingByIdBody.
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 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 73 def initialize(date = nil, time = nil, duration = nil, end_date = nil, recurs_by = nil, frequency = nil, days = nil, occurrence = nil, date_recurs_by = nil, update_recurring = nil, name = nil, description = nil) @date = date @time = time @duration = duration @end_date = end_date @recurs_by = recurs_by @frequency = frequency @days = days @occurrence = occurrence @date_recurs_by = date_recurs_by @update_recurring = update_recurring @name = name @description = description end |
Instance Attribute Details
#date ⇒ Date
New date of booking. If a recurring booking, must be a date of an instance. Several formats are supported: ‘2014-10-31’, ‘October 31, 2014’
7 8 9 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 7 def date @date end |
#date_recurs_by ⇒ DateRecursByEnum
Required only when :recurs_by is ‘monthly’ or ‘yearly’ to differentiate between exact date or ‘day in month/year’. See Recurring Booking examples.
39 40 41 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 39 def date_recurs_by @date_recurs_by end |
#days ⇒ String
List of comma-separated days of the week this Booking falls on. Useful for recurring Bookings. If provided, at least one must be specified.
31 32 33 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 31 def days @days end |
#description ⇒ String
New description for Booking.
51 52 53 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 51 def description @description end |
#duration ⇒ Integer
New length of time, in minutes, for the desired booking - if Service allows requesting a variable amount of time
15 16 17 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 15 def duration @duration end |
#end_date ⇒ Date
New end date of a recurring booking. If recurring, leave blank for infinite booking. Several formats are supported: ‘2014-10-31’, ‘October 31, 2014’.
19 20 21 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 19 def end_date @end_date end |
#frequency ⇒ FrequencyEnum
Optional frequency of recurrence as specified by :recurs_by. E.g, :single, :every, :every_other, etc.
27 28 29 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 27 def frequency @frequency end |
#name ⇒ String
New name for Booking.
47 48 49 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 47 def name @name end |
#occurrence ⇒ OccurrenceEnum
Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc.
35 36 37 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 35 def occurrence @occurrence end |
#recurs_by ⇒ RecursByEnum
One of the possible recurrence values.
23 24 25 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 23 def recurs_by @recurs_by end |
#time ⇒ String
New time of booking. Several formats are supported: ‘9am’, ‘09:00’, ‘9:00’, ‘0900’
11 12 13 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 11 def time @time end |
#update_recurring ⇒ String
When a recurring booking, one of: [‘instance’, ‘all’, ‘infinite’]
43 44 45 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 43 def update_recurring @update_recurring end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 100 def self.from_hash(hash) return nil unless hash # Extract variables from the hash date = hash['date'] time = hash['time'] duration = hash['duration'] end_date = hash['end_date'] recurs_by = hash['recurs_by'] frequency = hash['frequency'] days = hash['days'] occurrence = hash['occurrence'] date_recurs_by = hash['date_recurs_by'] update_recurring = hash['update_recurring'] name = hash['name'] description = hash['description'] # Create object from extracted values UpdateBookingByIdBody.new(date, time, duration, end_date, recurs_by, frequency, days, occurrence, date_recurs_by, update_recurring, name, description) end |
.names ⇒ Object
A mapping from model property names to API property names
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/gonebusy/models/update_booking_by_id_body.rb', line 54 def self.names if @_hash.nil? @_hash = {} @_hash["date"] = "date" @_hash["time"] = "time" @_hash["duration"] = "duration" @_hash["end_date"] = "end_date" @_hash["recurs_by"] = "recurs_by" @_hash["frequency"] = "frequency" @_hash["days"] = "days" @_hash["occurrence"] = "occurrence" @_hash["date_recurs_by"] = "date_recurs_by" @_hash["update_recurring"] = "update_recurring" @_hash["name"] = "name" @_hash["description"] = "description" end @_hash end |