Class: CalendarApi::Attendee
- Defined in:
- lib/calendar_api/models/attendee.rb
Overview
An attendee of an event.
Instance Attribute Summary collapse
-
#additional_guests ⇒ Integer
Number of additional guests the attendee is bringing.
-
#comment ⇒ String
The attendee’s response comment.
-
#display_name ⇒ String
The attendee’s name.
-
#email ⇒ String
The attendee’s email address.
-
#id ⇒ String
The attendee’s Profile ID.
-
#mself ⇒ TrueClass | FalseClass
Whether this entry represents the calendar on which this copy of the event appears.
-
#optional ⇒ TrueClass | FalseClass
Whether this is an optional attendee.
-
#organizer ⇒ TrueClass | FalseClass
Whether the attendee is the organizer of the event.
-
#resource ⇒ TrueClass | FalseClass
Whether the attendee is a resource (e.g. a room).
-
#response_status ⇒ ResponseStatus
The attendee’s response status.
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(id: SKIP, email: SKIP, display_name: SKIP, organizer: SKIP, mself: SKIP, resource: SKIP, optional: false, response_status: SKIP, comment: SKIP, additional_guests: 0, additional_properties: nil) ⇒ Attendee
constructor
A new instance of Attendee.
-
#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(id: SKIP, email: SKIP, display_name: SKIP, organizer: SKIP, mself: SKIP, resource: SKIP, optional: false, response_status: SKIP, comment: SKIP, additional_guests: 0, additional_properties: nil) ⇒ Attendee
Returns a new instance of Attendee.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/calendar_api/models/attendee.rb', line 90 def initialize(id: SKIP, email: SKIP, display_name: SKIP, organizer: SKIP, mself: SKIP, resource: SKIP, optional: false, response_status: SKIP, comment: SKIP, additional_guests: 0, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id unless id == SKIP @email = email unless email == SKIP @display_name = display_name unless display_name == SKIP @organizer = organizer unless organizer == SKIP @mself = mself unless mself == SKIP @resource = resource unless resource == SKIP @optional = optional unless optional == SKIP @response_status = response_status unless response_status == SKIP @comment = comment unless comment == SKIP @additional_guests = additional_guests unless additional_guests == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#additional_guests ⇒ Integer
Number of additional guests the attendee is bringing.
51 52 53 |
# File 'lib/calendar_api/models/attendee.rb', line 51 def additional_guests @additional_guests end |
#comment ⇒ String
The attendee’s response comment.
47 48 49 |
# File 'lib/calendar_api/models/attendee.rb', line 47 def comment @comment end |
#display_name ⇒ String
The attendee’s name.
22 23 24 |
# File 'lib/calendar_api/models/attendee.rb', line 22 def display_name @display_name end |
#email ⇒ String
The attendee’s email address. Required when adding an attendee.
18 19 20 |
# File 'lib/calendar_api/models/attendee.rb', line 18 def email @email end |
#id ⇒ String
The attendee’s Profile ID.
14 15 16 |
# File 'lib/calendar_api/models/attendee.rb', line 14 def id @id end |
#mself ⇒ TrueClass | FalseClass
Whether this entry represents the calendar on which this copy of the event appears.
31 32 33 |
# File 'lib/calendar_api/models/attendee.rb', line 31 def mself @mself end |
#optional ⇒ TrueClass | FalseClass
Whether this is an optional attendee.
39 40 41 |
# File 'lib/calendar_api/models/attendee.rb', line 39 def optional @optional end |
#organizer ⇒ TrueClass | FalseClass
Whether the attendee is the organizer of the event.
26 27 28 |
# File 'lib/calendar_api/models/attendee.rb', line 26 def organizer @organizer end |
#resource ⇒ TrueClass | FalseClass
Whether the attendee is a resource (e.g. a room).
35 36 37 |
# File 'lib/calendar_api/models/attendee.rb', line 35 def resource @resource end |
#response_status ⇒ ResponseStatus
The attendee’s response status.
43 44 45 |
# File 'lib/calendar_api/models/attendee.rb', line 43 def response_status @response_status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/calendar_api/models/attendee.rb', line 111 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP email = hash.key?('email') ? hash['email'] : SKIP display_name = hash.key?('displayName') ? hash['displayName'] : SKIP organizer = hash.key?('organizer') ? hash['organizer'] : SKIP mself = hash.key?('self') ? hash['self'] : SKIP resource = hash.key?('resource') ? hash['resource'] : SKIP optional = hash['optional'] ||= false response_status = hash.key?('responseStatus') ? hash['responseStatus'] : SKIP comment = hash.key?('comment') ? hash['comment'] : SKIP additional_guests = hash['additionalGuests'] ||= 0 # 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. Attendee.new(id: id, email: email, display_name: display_name, organizer: organizer, mself: mself, resource: resource, optional: optional, response_status: response_status, comment: comment, additional_guests: additional_guests, additional_properties: additional_properties) 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 |
# File 'lib/calendar_api/models/attendee.rb', line 54 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['email'] = 'email' @_hash['display_name'] = 'displayName' @_hash['organizer'] = 'organizer' @_hash['mself'] = 'self' @_hash['resource'] = 'resource' @_hash['optional'] = 'optional' @_hash['response_status'] = 'responseStatus' @_hash['comment'] = 'comment' @_hash['additional_guests'] = 'additionalGuests' @_hash end |
.nullables ⇒ Object
An array for nullable fields
86 87 88 |
# File 'lib/calendar_api/models/attendee.rb', line 86 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/calendar_api/models/attendee.rb', line 70 def self.optionals %w[ id email display_name organizer mself resource optional response_status comment additional_guests ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
158 159 160 161 162 163 164 165 |
# File 'lib/calendar_api/models/attendee.rb', line 158 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, email: #{@email.inspect}, display_name:"\ " #{@display_name.inspect}, organizer: #{@organizer.inspect}, mself: #{@mself.inspect},"\ " resource: #{@resource.inspect}, optional: #{@optional.inspect}, response_status:"\ " #{@response_status.inspect}, comment: #{@comment.inspect}, additional_guests:"\ " #{@additional_guests.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
149 150 151 152 153 154 155 |
# File 'lib/calendar_api/models/attendee.rb', line 149 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, email: #{@email}, display_name: #{@display_name}, organizer:"\ " #{@organizer}, mself: #{@mself}, resource: #{@resource}, optional: #{@optional},"\ " response_status: #{@response_status}, comment: #{@comment}, additional_guests:"\ " #{@additional_guests}, additional_properties: #{@additional_properties}>" end |