Class: CalendarApi::CalendarListEntry
- Defined in:
- lib/calendar_api/models/calendar_list_entry.rb
Overview
An entry on the user’s calendar list.
Instance Attribute Summary collapse
-
#access_role ⇒ CalendarAccessRole
The user’s access role for a calendar.
-
#background_color ⇒ String
The main color of the calendar in hexadecimal format (e.g. “#0088aa”).
-
#color_id ⇒ String
The color of the calendar.
-
#conference_properties ⇒ CalendarListEntryConferenceProperties
Conference properties for this calendar.
-
#default_reminders ⇒ Array[Reminder]
The default reminders that the authenticated user has for this calendar.
-
#deleted ⇒ TrueClass | FalseClass
Whether the calendar list entry has been removed from the list.
-
#description ⇒ String
Description of the calendar.
-
#etag ⇒ String
ETag of the resource.
-
#foreground_color ⇒ String
The foreground color of the calendar in hexadecimal format (e.g. “#ffffff”).
-
#hidden ⇒ TrueClass | FalseClass
Whether the calendar has been hidden from the list.
-
#id ⇒ String
Identifier of the calendar.
-
#kind ⇒ String
Type of the resource.
-
#location ⇒ String
Geographic location of the calendar as free-form text.
-
#notification_settings ⇒ CalendarListEntryNotificationSettings
The notifications the authenticated user receives for this calendar.
-
#primary ⇒ TrueClass | FalseClass
Whether the calendar is the primary calendar of the authenticated user.
-
#selected ⇒ TrueClass | FalseClass
Whether the calendar content shows up in the calendar UI.
-
#summary ⇒ String
Title of the calendar.
-
#summary_override ⇒ String
The summary that the authenticated user has set for this calendar.
-
#time_zone ⇒ String
The time zone of the calendar.
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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(kind: 'calendar#calendarListEntry', etag: SKIP, id: SKIP, summary: SKIP, description: SKIP, location: SKIP, time_zone: SKIP, summary_override: SKIP, color_id: SKIP, background_color: SKIP, foreground_color: SKIP, hidden: false, selected: false, access_role: SKIP, default_reminders: SKIP, notification_settings: SKIP, primary: SKIP, deleted: false, conference_properties: SKIP, additional_properties: nil) ⇒ CalendarListEntry
constructor
A new instance of CalendarListEntry.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(kind: 'calendar#calendarListEntry', etag: SKIP, id: SKIP, summary: SKIP, description: SKIP, location: SKIP, time_zone: SKIP, summary_override: SKIP, color_id: SKIP, background_color: SKIP, foreground_color: SKIP, hidden: false, selected: false, access_role: SKIP, default_reminders: SKIP, notification_settings: SKIP, primary: SKIP, deleted: false, conference_properties: SKIP, additional_properties: nil) ⇒ CalendarListEntry
Returns a new instance of CalendarListEntry.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 146 def initialize(kind: 'calendar#calendarListEntry', etag: SKIP, id: SKIP, summary: SKIP, description: SKIP, location: SKIP, time_zone: SKIP, summary_override: SKIP, color_id: SKIP, background_color: SKIP, foreground_color: SKIP, hidden: false, selected: false, access_role: SKIP, default_reminders: SKIP, notification_settings: SKIP, primary: SKIP, deleted: false, conference_properties: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @kind = kind unless kind == SKIP @etag = etag unless etag == SKIP @id = id unless id == SKIP @summary = summary unless summary == SKIP @description = description unless description == SKIP @location = location unless location == SKIP @time_zone = time_zone unless time_zone == SKIP @summary_override = summary_override unless summary_override == SKIP @color_id = color_id unless color_id == SKIP @background_color = background_color unless background_color == SKIP @foreground_color = foreground_color unless foreground_color == SKIP @hidden = hidden unless hidden == SKIP @selected = selected unless selected == SKIP @access_role = access_role unless access_role == SKIP @default_reminders = default_reminders unless default_reminders == SKIP @notification_settings = notification_settings unless notification_settings == SKIP @primary = primary unless primary == SKIP @deleted = deleted unless deleted == SKIP @conference_properties = conference_properties unless conference_properties == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#access_role ⇒ CalendarAccessRole
The user’s access role for a calendar.
69 70 71 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 69 def access_role @access_role end |
#background_color ⇒ String
The main color of the calendar in hexadecimal format (e.g. “#0088aa”).
52 53 54 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 52 def background_color @background_color end |
#color_id ⇒ String
The color of the calendar. References an entry in the calendar section of the colors definition.
48 49 50 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 48 def color_id @color_id end |
#conference_properties ⇒ CalendarListEntryConferenceProperties
Conference properties for this calendar.
89 90 91 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 89 def conference_properties @conference_properties end |
#default_reminders ⇒ Array[Reminder]
The default reminders that the authenticated user has for this calendar.
73 74 75 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 73 def default_reminders @default_reminders end |
#deleted ⇒ TrueClass | FalseClass
Whether the calendar list entry has been removed from the list.
85 86 87 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 85 def deleted @deleted end |
#description ⇒ String
Description of the calendar.
31 32 33 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 31 def description @description end |
#etag ⇒ String
ETag of the resource.
18 19 20 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 18 def etag @etag end |
#foreground_color ⇒ String
The foreground color of the calendar in hexadecimal format (e.g. “#ffffff”).
57 58 59 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 57 def foreground_color @foreground_color end |
#hidden ⇒ TrueClass | FalseClass
Whether the calendar has been hidden from the list.
61 62 63 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 61 def hidden @hidden end |
#id ⇒ String
Identifier of the calendar. Use this value as the calendarId path parameter in event operations.
23 24 25 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 23 def id @id end |
#kind ⇒ String
Type of the resource.
14 15 16 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 14 def kind @kind end |
#location ⇒ String
Geographic location of the calendar as free-form text.
35 36 37 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 35 def location @location end |
#notification_settings ⇒ CalendarListEntryNotificationSettings
The notifications the authenticated user receives for this calendar.
77 78 79 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 77 def notification_settings @notification_settings end |
#primary ⇒ TrueClass | FalseClass
Whether the calendar is the primary calendar of the authenticated user.
81 82 83 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 81 def primary @primary end |
#selected ⇒ TrueClass | FalseClass
Whether the calendar content shows up in the calendar UI.
65 66 67 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 65 def selected @selected end |
#summary ⇒ String
Title of the calendar.
27 28 29 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 27 def summary @summary end |
#summary_override ⇒ String
The summary that the authenticated user has set for this calendar.
43 44 45 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 43 def summary_override @summary_override end |
#time_zone ⇒ String
The time zone of the calendar.
39 40 41 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 39 def time_zone @time_zone end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 180 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. kind = hash['kind'] ||= 'calendar#calendarListEntry' etag = hash.key?('etag') ? hash['etag'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP summary = hash.key?('summary') ? hash['summary'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP location = hash.key?('location') ? hash['location'] : SKIP time_zone = hash.key?('timeZone') ? hash['timeZone'] : SKIP summary_override = hash.key?('summaryOverride') ? hash['summaryOverride'] : SKIP color_id = hash.key?('colorId') ? hash['colorId'] : SKIP background_color = hash.key?('backgroundColor') ? hash['backgroundColor'] : SKIP foreground_color = hash.key?('foregroundColor') ? hash['foregroundColor'] : SKIP hidden = hash['hidden'] ||= false selected = hash['selected'] ||= false access_role = hash.key?('accessRole') ? hash['accessRole'] : SKIP # Parameter is an array, so we need to iterate through it default_reminders = nil unless hash['defaultReminders'].nil? default_reminders = [] hash['defaultReminders'].each do |structure| default_reminders << (Reminder.from_hash(structure) if structure) end end default_reminders = SKIP unless hash.key?('defaultReminders') if hash['notificationSettings'] notification_settings = CalendarListEntryNotificationSettings.from_hash(hash['notificationSettings']) end primary = hash.key?('primary') ? hash['primary'] : SKIP deleted = hash['deleted'] ||= false if hash['conferenceProperties'] conference_properties = CalendarListEntryConferenceProperties.from_hash(hash['conferenceProperties']) end # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. CalendarListEntry.new(kind: kind, etag: etag, id: id, summary: summary, description: description, location: location, time_zone: time_zone, summary_override: summary_override, color_id: color_id, background_color: background_color, foreground_color: foreground_color, hidden: hidden, selected: selected, access_role: access_role, default_reminders: default_reminders, notification_settings: notification_settings, primary: primary, deleted: deleted, conference_properties: conference_properties, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 92 def self.names @_hash = {} if @_hash.nil? @_hash['kind'] = 'kind' @_hash['etag'] = 'etag' @_hash['id'] = 'id' @_hash['summary'] = 'summary' @_hash['description'] = 'description' @_hash['location'] = 'location' @_hash['time_zone'] = 'timeZone' @_hash['summary_override'] = 'summaryOverride' @_hash['color_id'] = 'colorId' @_hash['background_color'] = 'backgroundColor' @_hash['foreground_color'] = 'foregroundColor' @_hash['hidden'] = 'hidden' @_hash['selected'] = 'selected' @_hash['access_role'] = 'accessRole' @_hash['default_reminders'] = 'defaultReminders' @_hash['notification_settings'] = 'notificationSettings' @_hash['primary'] = 'primary' @_hash['deleted'] = 'deleted' @_hash['conference_properties'] = 'conferenceProperties' @_hash end |
.nullables ⇒ Object
An array for nullable fields
142 143 144 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 142 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 117 def self.optionals %w[ kind etag id summary description location time_zone summary_override color_id background_color foreground_color hidden selected access_role default_reminders notification_settings primary deleted conference_properties ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 264 def inspect class_name = self.class.name.split('::').last "<#{class_name} kind: #{@kind.inspect}, etag: #{@etag.inspect}, id: #{@id.inspect},"\ " summary: #{@summary.inspect}, description: #{@description.inspect}, location:"\ " #{@location.inspect}, time_zone: #{@time_zone.inspect}, summary_override:"\ " #{@summary_override.inspect}, color_id: #{@color_id.inspect}, background_color:"\ " #{@background_color.inspect}, foreground_color: #{@foreground_color.inspect}, hidden:"\ " #{@hidden.inspect}, selected: #{@selected.inspect}, access_role: #{@access_role.inspect},"\ " default_reminders: #{@default_reminders.inspect}, notification_settings:"\ " #{@notification_settings.inspect}, primary: #{@primary.inspect}, deleted:"\ " #{@deleted.inspect}, conference_properties: #{@conference_properties.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/calendar_api/models/calendar_list_entry.rb', line 251 def to_s class_name = self.class.name.split('::').last "<#{class_name} kind: #{@kind}, etag: #{@etag}, id: #{@id}, summary: #{@summary},"\ " description: #{@description}, location: #{@location}, time_zone: #{@time_zone},"\ " summary_override: #{@summary_override}, color_id: #{@color_id}, background_color:"\ " #{@background_color}, foreground_color: #{@foreground_color}, hidden: #{@hidden},"\ " selected: #{@selected}, access_role: #{@access_role}, default_reminders:"\ " #{@default_reminders}, notification_settings: #{@notification_settings}, primary:"\ " #{@primary}, deleted: #{@deleted}, conference_properties: #{@conference_properties},"\ " additional_properties: #{@additional_properties}>" end |