Class: CalendarApi::CalendarListResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CalendarApi::CalendarListResponse
- Defined in:
- lib/calendar_api/models/calendar_list_response.rb
Overview
A paginated list of the user’s calendar list entries.
Instance Attribute Summary collapse
-
#etag ⇒ String
ETag of the collection.
-
#items ⇒ Array[CalendarListEntry]
Calendars on the user’s calendar list.
-
#kind ⇒ String
Type of the collection.
-
#next_page_token ⇒ String
Token used to access the next page of this result.
-
#next_sync_token ⇒ String
Token used for incremental synchronization at a later point.
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#calendarList', etag: SKIP, next_page_token: SKIP, next_sync_token: SKIP, items: SKIP, additional_properties: nil) ⇒ CalendarListResponse
constructor
A new instance of CalendarListResponse.
-
#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#calendarList', etag: SKIP, next_page_token: SKIP, next_sync_token: SKIP, items: SKIP, additional_properties: nil) ⇒ CalendarListResponse
Returns a new instance of CalendarListResponse.
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 61 def initialize(kind: 'calendar#calendarList', etag: SKIP, next_page_token: SKIP, next_sync_token: SKIP, items: 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 @next_page_token = next_page_token unless next_page_token == SKIP @next_sync_token = next_sync_token unless next_sync_token == SKIP @items = items unless items == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#etag ⇒ String
ETag of the collection.
18 19 20 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 18 def etag @etag end |
#items ⇒ Array[CalendarListEntry]
Calendars on the user’s calendar list.
32 33 34 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 32 def items @items end |
#kind ⇒ String
Type of the collection.
14 15 16 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 14 def kind @kind end |
#next_page_token ⇒ String
Token used to access the next page of this result. Omitted if no further results are available.
23 24 25 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 23 def next_page_token @next_page_token end |
#next_sync_token ⇒ String
Token used for incremental synchronization at a later point. Only provided on the last page of results.
28 29 30 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 28 def next_sync_token @next_sync_token end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 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 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. kind = hash['kind'] ||= 'calendar#calendarList' etag = hash.key?('etag') ? hash['etag'] : SKIP next_page_token = hash.key?('nextPageToken') ? hash['nextPageToken'] : SKIP next_sync_token = hash.key?('nextSyncToken') ? hash['nextSyncToken'] : SKIP # Parameter is an array, so we need to iterate through it items = nil unless hash['items'].nil? items = [] hash['items'].each do |structure| items << (CalendarListEntry.from_hash(structure) if structure) end end items = SKIP unless hash.key?('items') # 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. CalendarListResponse.new(kind: kind, etag: etag, next_page_token: next_page_token, next_sync_token: next_sync_token, items: items, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
35 36 37 38 39 40 41 42 43 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 35 def self.names @_hash = {} if @_hash.nil? @_hash['kind'] = 'kind' @_hash['etag'] = 'etag' @_hash['next_page_token'] = 'nextPageToken' @_hash['next_sync_token'] = 'nextSyncToken' @_hash['items'] = 'items' @_hash end |
.nullables ⇒ Object
An array for nullable fields
57 58 59 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 57 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 52 53 54 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 46 def self.optionals %w[ kind etag next_page_token next_sync_token items ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
122 123 124 125 126 127 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 122 def inspect class_name = self.class.name.split('::').last "<#{class_name} kind: #{@kind.inspect}, etag: #{@etag.inspect}, next_page_token:"\ " #{@next_page_token.inspect}, next_sync_token: #{@next_sync_token.inspect}, items:"\ " #{@items.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
114 115 116 117 118 119 |
# File 'lib/calendar_api/models/calendar_list_response.rb', line 114 def to_s class_name = self.class.name.split('::').last "<#{class_name} kind: #{@kind}, etag: #{@etag}, next_page_token: #{@next_page_token},"\ " next_sync_token: #{@next_sync_token}, items: #{@items}, additional_properties:"\ " #{@additional_properties}>" end |