google-calendar-apimatic-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +168 -0
  4. data/bin/console +15 -0
  5. data/lib/calendar_api/api_helper.rb +10 -0
  6. data/lib/calendar_api/apis/base_api.rb +67 -0
  7. data/lib/calendar_api/apis/calendar_list_api.rb +63 -0
  8. data/lib/calendar_api/apis/channels_api.rb +42 -0
  9. data/lib/calendar_api/apis/events_api.rb +354 -0
  10. data/lib/calendar_api/apis/free_busy_api.rb +37 -0
  11. data/lib/calendar_api/apis/oauth_authorization_api.rb +87 -0
  12. data/lib/calendar_api/client.rb +103 -0
  13. data/lib/calendar_api/configuration.rb +177 -0
  14. data/lib/calendar_api/exceptions/api_exception.rb +21 -0
  15. data/lib/calendar_api/exceptions/error_response_error1_exception.rb +46 -0
  16. data/lib/calendar_api/exceptions/oauth_provider_exception.rb +64 -0
  17. data/lib/calendar_api/http/api_response.rb +19 -0
  18. data/lib/calendar_api/http/auth/oauth_2.rb +162 -0
  19. data/lib/calendar_api/http/http_call_back.rb +10 -0
  20. data/lib/calendar_api/http/http_method_enum.rb +10 -0
  21. data/lib/calendar_api/http/http_request.rb +10 -0
  22. data/lib/calendar_api/http/http_response.rb +10 -0
  23. data/lib/calendar_api/http/proxy_settings.rb +22 -0
  24. data/lib/calendar_api/logging/configuration/api_logging_configuration.rb +186 -0
  25. data/lib/calendar_api/logging/sdk_logger.rb +17 -0
  26. data/lib/calendar_api/models/attachment.rb +115 -0
  27. data/lib/calendar_api/models/attendee.rb +167 -0
  28. data/lib/calendar_api/models/auto_decline_mode.rb +40 -0
  29. data/lib/calendar_api/models/base_model.rb +110 -0
  30. data/lib/calendar_api/models/birthday_properties.rb +96 -0
  31. data/lib/calendar_api/models/birthday_type.rb +48 -0
  32. data/lib/calendar_api/models/calendar_access_role.rb +44 -0
  33. data/lib/calendar_api/models/calendar_list_entry.rb +278 -0
  34. data/lib/calendar_api/models/calendar_list_entry_conference_properties.rb +83 -0
  35. data/lib/calendar_api/models/calendar_list_entry_notification_settings.rb +85 -0
  36. data/lib/calendar_api/models/calendar_list_response.rb +129 -0
  37. data/lib/calendar_api/models/calendar_notification.rb +86 -0
  38. data/lib/calendar_api/models/calendar_notification_method.rb +27 -0
  39. data/lib/calendar_api/models/calendar_notification_type.rb +48 -0
  40. data/lib/calendar_api/models/channel.rb +129 -0
  41. data/lib/calendar_api/models/channel_params.rb +75 -0
  42. data/lib/calendar_api/models/channel_type.rb +36 -0
  43. data/lib/calendar_api/models/chat_status.rb +36 -0
  44. data/lib/calendar_api/models/conference_create_request.rb +99 -0
  45. data/lib/calendar_api/models/conference_create_request_status.rb +76 -0
  46. data/lib/calendar_api/models/conference_data.rb +137 -0
  47. data/lib/calendar_api/models/conference_data_version.rb +43 -0
  48. data/lib/calendar_api/models/conference_entry_point.rb +126 -0
  49. data/lib/calendar_api/models/conference_request_status_code.rb +40 -0
  50. data/lib/calendar_api/models/conference_solution.rb +95 -0
  51. data/lib/calendar_api/models/conference_solution_key.rb +74 -0
  52. data/lib/calendar_api/models/conference_solution_type.rb +40 -0
  53. data/lib/calendar_api/models/custom_location.rb +75 -0
  54. data/lib/calendar_api/models/entry_point_type.rb +44 -0
  55. data/lib/calendar_api/models/error_response.rb +75 -0
  56. data/lib/calendar_api/models/error_response_error.rb +104 -0
  57. data/lib/calendar_api/models/error_response_error_errors_items.rb +95 -0
  58. data/lib/calendar_api/models/event.rb +551 -0
  59. data/lib/calendar_api/models/event_date_time.rb +107 -0
  60. data/lib/calendar_api/models/event_list.rb +208 -0
  61. data/lib/calendar_api/models/event_order_by.rb +36 -0
  62. data/lib/calendar_api/models/event_reminders.rb +95 -0
  63. data/lib/calendar_api/models/event_source.rb +86 -0
  64. data/lib/calendar_api/models/event_status.rb +40 -0
  65. data/lib/calendar_api/models/event_transparency.rb +37 -0
  66. data/lib/calendar_api/models/event_type.rb +52 -0
  67. data/lib/calendar_api/models/event_visibility.rb +44 -0
  68. data/lib/calendar_api/models/extended_properties.rb +87 -0
  69. data/lib/calendar_api/models/focus_time_properties.rb +99 -0
  70. data/lib/calendar_api/models/free_busy_calendar.rb +103 -0
  71. data/lib/calendar_api/models/free_busy_error.rb +85 -0
  72. data/lib/calendar_api/models/free_busy_group.rb +94 -0
  73. data/lib/calendar_api/models/free_busy_request.rb +150 -0
  74. data/lib/calendar_api/models/free_busy_request_item.rb +72 -0
  75. data/lib/calendar_api/models/free_busy_response.rb +135 -0
  76. data/lib/calendar_api/models/oauth_provider_error.rb +62 -0
  77. data/lib/calendar_api/models/oauth_scope.rb +41 -0
  78. data/lib/calendar_api/models/oauth_token.rb +96 -0
  79. data/lib/calendar_api/models/office_location.rb +116 -0
  80. data/lib/calendar_api/models/out_of_office_properties.rb +88 -0
  81. data/lib/calendar_api/models/person.rb +106 -0
  82. data/lib/calendar_api/models/reminder.rb +83 -0
  83. data/lib/calendar_api/models/reminder_method.rb +36 -0
  84. data/lib/calendar_api/models/response_status.rb +44 -0
  85. data/lib/calendar_api/models/send_updates.rb +40 -0
  86. data/lib/calendar_api/models/stop_channel_request.rb +85 -0
  87. data/lib/calendar_api/models/time_period.rb +102 -0
  88. data/lib/calendar_api/models/watch_request.rb +113 -0
  89. data/lib/calendar_api/models/working_location_properties.rb +107 -0
  90. data/lib/calendar_api/models/working_location_type.rb +40 -0
  91. data/lib/calendar_api/utilities/date_time_helper.rb +11 -0
  92. data/lib/calendar_api/utilities/file_wrapper.rb +28 -0
  93. data/lib/calendar_api.rb +114 -0
  94. metadata +176 -0
@@ -0,0 +1,208 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module CalendarApi
8
+ # A paginated list of events on a calendar.
9
+ class EventList < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Type of the collection.
14
+ # @return [String]
15
+ attr_accessor :kind
16
+
17
+ # ETag of the collection.
18
+ # @return [String]
19
+ attr_accessor :etag
20
+
21
+ # Title of the calendar.
22
+ # @return [String]
23
+ attr_accessor :summary
24
+
25
+ # Description of the calendar.
26
+ # @return [String]
27
+ attr_accessor :description
28
+
29
+ # Last modification time of the calendar (RFC3339).
30
+ # @return [DateTime]
31
+ attr_accessor :updated
32
+
33
+ # The time zone of the calendar.
34
+ # @return [String]
35
+ attr_accessor :time_zone
36
+
37
+ # The user's access role for a calendar.
38
+ # @return [CalendarAccessRole]
39
+ attr_accessor :access_role
40
+
41
+ # Default reminders on the calendar for the authenticated user.
42
+ # @return [Array[Reminder]]
43
+ attr_accessor :default_reminders
44
+
45
+ # Token used to access the next page of this result. Omitted if no further
46
+ # results are available.
47
+ # @return [String]
48
+ attr_accessor :next_page_token
49
+
50
+ # Token used for incremental synchronization at a later point. Only provided
51
+ # on the last page of results.
52
+ # @return [String]
53
+ attr_accessor :next_sync_token
54
+
55
+ # List of events on the calendar.
56
+ # @return [Array[Event]]
57
+ attr_accessor :items
58
+
59
+ # A mapping from model property names to API property names.
60
+ def self.names
61
+ @_hash = {} if @_hash.nil?
62
+ @_hash['kind'] = 'kind'
63
+ @_hash['etag'] = 'etag'
64
+ @_hash['summary'] = 'summary'
65
+ @_hash['description'] = 'description'
66
+ @_hash['updated'] = 'updated'
67
+ @_hash['time_zone'] = 'timeZone'
68
+ @_hash['access_role'] = 'accessRole'
69
+ @_hash['default_reminders'] = 'defaultReminders'
70
+ @_hash['next_page_token'] = 'nextPageToken'
71
+ @_hash['next_sync_token'] = 'nextSyncToken'
72
+ @_hash['items'] = 'items'
73
+ @_hash
74
+ end
75
+
76
+ # An array for optional fields
77
+ def self.optionals
78
+ %w[
79
+ kind
80
+ etag
81
+ summary
82
+ description
83
+ updated
84
+ time_zone
85
+ access_role
86
+ default_reminders
87
+ next_page_token
88
+ next_sync_token
89
+ items
90
+ ]
91
+ end
92
+
93
+ # An array for nullable fields
94
+ def self.nullables
95
+ []
96
+ end
97
+
98
+ def initialize(kind: 'calendar#events', etag: SKIP, summary: SKIP,
99
+ description: SKIP, updated: SKIP, time_zone: SKIP,
100
+ access_role: SKIP, default_reminders: SKIP,
101
+ next_page_token: SKIP, next_sync_token: SKIP, items: SKIP,
102
+ additional_properties: nil)
103
+ # Add additional model properties to the instance
104
+ additional_properties = {} if additional_properties.nil?
105
+
106
+ @kind = kind unless kind == SKIP
107
+ @etag = etag unless etag == SKIP
108
+ @summary = summary unless summary == SKIP
109
+ @description = description unless description == SKIP
110
+ @updated = updated unless updated == SKIP
111
+ @time_zone = time_zone unless time_zone == SKIP
112
+ @access_role = access_role unless access_role == SKIP
113
+ @default_reminders = default_reminders unless default_reminders == SKIP
114
+ @next_page_token = next_page_token unless next_page_token == SKIP
115
+ @next_sync_token = next_sync_token unless next_sync_token == SKIP
116
+ @items = items unless items == SKIP
117
+ @additional_properties = additional_properties
118
+ end
119
+
120
+ # Creates an instance of the object from a hash.
121
+ def self.from_hash(hash)
122
+ return nil unless hash
123
+
124
+ # Extract variables from the hash.
125
+ kind = hash['kind'] ||= 'calendar#events'
126
+ etag = hash.key?('etag') ? hash['etag'] : SKIP
127
+ summary = hash.key?('summary') ? hash['summary'] : SKIP
128
+ description = hash.key?('description') ? hash['description'] : SKIP
129
+ updated = if hash.key?('updated')
130
+ (DateTimeHelper.from_rfc3339(hash['updated']) if hash['updated'])
131
+ else
132
+ SKIP
133
+ end
134
+ time_zone = hash.key?('timeZone') ? hash['timeZone'] : SKIP
135
+ access_role = hash.key?('accessRole') ? hash['accessRole'] : SKIP
136
+ # Parameter is an array, so we need to iterate through it
137
+ default_reminders = nil
138
+ unless hash['defaultReminders'].nil?
139
+ default_reminders = []
140
+ hash['defaultReminders'].each do |structure|
141
+ default_reminders << (Reminder.from_hash(structure) if structure)
142
+ end
143
+ end
144
+
145
+ default_reminders = SKIP unless hash.key?('defaultReminders')
146
+ next_page_token =
147
+ hash.key?('nextPageToken') ? hash['nextPageToken'] : SKIP
148
+ next_sync_token =
149
+ hash.key?('nextSyncToken') ? hash['nextSyncToken'] : SKIP
150
+ # Parameter is an array, so we need to iterate through it
151
+ items = nil
152
+ unless hash['items'].nil?
153
+ items = []
154
+ hash['items'].each do |structure|
155
+ items << (Event.from_hash(structure) if structure)
156
+ end
157
+ end
158
+
159
+ items = SKIP unless hash.key?('items')
160
+
161
+ # Create a new hash for additional properties, removing known properties.
162
+ new_hash = hash.reject { |k, _| names.value?(k) }
163
+
164
+ additional_properties = APIHelper.get_additional_properties(
165
+ new_hash, proc { |value| value }
166
+ )
167
+
168
+ # Create object from extracted values.
169
+ EventList.new(kind: kind,
170
+ etag: etag,
171
+ summary: summary,
172
+ description: description,
173
+ updated: updated,
174
+ time_zone: time_zone,
175
+ access_role: access_role,
176
+ default_reminders: default_reminders,
177
+ next_page_token: next_page_token,
178
+ next_sync_token: next_sync_token,
179
+ items: items,
180
+ additional_properties: additional_properties)
181
+ end
182
+
183
+ def to_custom_updated
184
+ DateTimeHelper.to_rfc3339(updated)
185
+ end
186
+
187
+ # Provides a human-readable string representation of the object.
188
+ def to_s
189
+ class_name = self.class.name.split('::').last
190
+ "<#{class_name} kind: #{@kind}, etag: #{@etag}, summary: #{@summary}, description:"\
191
+ " #{@description}, updated: #{@updated}, time_zone: #{@time_zone}, access_role:"\
192
+ " #{@access_role}, default_reminders: #{@default_reminders}, next_page_token:"\
193
+ " #{@next_page_token}, next_sync_token: #{@next_sync_token}, items: #{@items},"\
194
+ " additional_properties: #{@additional_properties}>"
195
+ end
196
+
197
+ # Provides a debugging-friendly string with detailed object information.
198
+ def inspect
199
+ class_name = self.class.name.split('::').last
200
+ "<#{class_name} kind: #{@kind.inspect}, etag: #{@etag.inspect}, summary:"\
201
+ " #{@summary.inspect}, description: #{@description.inspect}, updated: #{@updated.inspect},"\
202
+ " time_zone: #{@time_zone.inspect}, access_role: #{@access_role.inspect}, default_reminders:"\
203
+ " #{@default_reminders.inspect}, next_page_token: #{@next_page_token.inspect},"\
204
+ " next_sync_token: #{@next_sync_token.inspect}, items: #{@items.inspect},"\
205
+ " additional_properties: #{@additional_properties}>"
206
+ end
207
+ end
208
+ end
@@ -0,0 +1,36 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # The order of events returned in the result.
8
+ class EventOrderBy
9
+ EVENT_ORDER_BY = [
10
+ # TODO: Write general description for STARTTIME
11
+ STARTTIME = 'startTime'.freeze,
12
+
13
+ # TODO: Write general description for UPDATED
14
+ UPDATED = 'updated'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ EVENT_ORDER_BY.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = STARTTIME)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'starttime' then STARTTIME
30
+ when 'updated' then UPDATED
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,95 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # Information about the event's reminders.
8
+ class EventReminders < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Whether the default reminders of the calendar apply to the event.
13
+ # @return [TrueClass | FalseClass]
14
+ attr_accessor :use_default
15
+
16
+ # Overrides to apply instead of default reminders. Maximum 5 overrides.
17
+ # @return [Array[Reminder]]
18
+ attr_accessor :overrides
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['use_default'] = 'useDefault'
24
+ @_hash['overrides'] = 'overrides'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ use_default
32
+ overrides
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(use_default: SKIP, overrides: SKIP,
42
+ additional_properties: nil)
43
+ # Add additional model properties to the instance
44
+ additional_properties = {} if additional_properties.nil?
45
+
46
+ @use_default = use_default unless use_default == SKIP
47
+ @overrides = overrides unless overrides == SKIP
48
+ @additional_properties = additional_properties
49
+ end
50
+
51
+ # Creates an instance of the object from a hash.
52
+ def self.from_hash(hash)
53
+ return nil unless hash
54
+
55
+ # Extract variables from the hash.
56
+ use_default = hash.key?('useDefault') ? hash['useDefault'] : SKIP
57
+ # Parameter is an array, so we need to iterate through it
58
+ overrides = nil
59
+ unless hash['overrides'].nil?
60
+ overrides = []
61
+ hash['overrides'].each do |structure|
62
+ overrides << (Reminder.from_hash(structure) if structure)
63
+ end
64
+ end
65
+
66
+ overrides = SKIP unless hash.key?('overrides')
67
+
68
+ # Create a new hash for additional properties, removing known properties.
69
+ new_hash = hash.reject { |k, _| names.value?(k) }
70
+
71
+ additional_properties = APIHelper.get_additional_properties(
72
+ new_hash, proc { |value| value }
73
+ )
74
+
75
+ # Create object from extracted values.
76
+ EventReminders.new(use_default: use_default,
77
+ overrides: overrides,
78
+ additional_properties: additional_properties)
79
+ end
80
+
81
+ # Provides a human-readable string representation of the object.
82
+ def to_s
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} use_default: #{@use_default}, overrides: #{@overrides},"\
85
+ " additional_properties: #{@additional_properties}>"
86
+ end
87
+
88
+ # Provides a debugging-friendly string with detailed object information.
89
+ def inspect
90
+ class_name = self.class.name.split('::').last
91
+ "<#{class_name} use_default: #{@use_default.inspect}, overrides: #{@overrides.inspect},"\
92
+ " additional_properties: #{@additional_properties}>"
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,86 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # Source from which the event was created — for example, a web page or an
8
+ # email message.
9
+ class EventSource < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # URL of the source pointing to a resource.
14
+ # @return [String]
15
+ attr_accessor :url
16
+
17
+ # Title of the source (e.g. a web page or email subject).
18
+ # @return [String]
19
+ attr_accessor :title
20
+
21
+ # A mapping from model property names to API property names.
22
+ def self.names
23
+ @_hash = {} if @_hash.nil?
24
+ @_hash['url'] = 'url'
25
+ @_hash['title'] = 'title'
26
+ @_hash
27
+ end
28
+
29
+ # An array for optional fields
30
+ def self.optionals
31
+ %w[
32
+ url
33
+ title
34
+ ]
35
+ end
36
+
37
+ # An array for nullable fields
38
+ def self.nullables
39
+ []
40
+ end
41
+
42
+ def initialize(url: SKIP, title: SKIP, additional_properties: nil)
43
+ # Add additional model properties to the instance
44
+ additional_properties = {} if additional_properties.nil?
45
+
46
+ @url = url unless url == SKIP
47
+ @title = title unless title == SKIP
48
+ @additional_properties = additional_properties
49
+ end
50
+
51
+ # Creates an instance of the object from a hash.
52
+ def self.from_hash(hash)
53
+ return nil unless hash
54
+
55
+ # Extract variables from the hash.
56
+ url = hash.key?('url') ? hash['url'] : SKIP
57
+ title = hash.key?('title') ? hash['title'] : SKIP
58
+
59
+ # Create a new hash for additional properties, removing known properties.
60
+ new_hash = hash.reject { |k, _| names.value?(k) }
61
+
62
+ additional_properties = APIHelper.get_additional_properties(
63
+ new_hash, proc { |value| value }
64
+ )
65
+
66
+ # Create object from extracted values.
67
+ EventSource.new(url: url,
68
+ title: title,
69
+ additional_properties: additional_properties)
70
+ end
71
+
72
+ # Provides a human-readable string representation of the object.
73
+ def to_s
74
+ class_name = self.class.name.split('::').last
75
+ "<#{class_name} url: #{@url}, title: #{@title}, additional_properties:"\
76
+ " #{@additional_properties}>"
77
+ end
78
+
79
+ # Provides a debugging-friendly string with detailed object information.
80
+ def inspect
81
+ class_name = self.class.name.split('::').last
82
+ "<#{class_name} url: #{@url.inspect}, title: #{@title.inspect}, additional_properties:"\
83
+ " #{@additional_properties}>"
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,40 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # Status of the event.
8
+ class EventStatus
9
+ EVENT_STATUS = [
10
+ # TODO: Write general description for CONFIRMED
11
+ CONFIRMED = 'confirmed'.freeze,
12
+
13
+ # TODO: Write general description for TENTATIVE
14
+ TENTATIVE = 'tentative'.freeze,
15
+
16
+ # TODO: Write general description for CANCELLED
17
+ CANCELLED = 'cancelled'.freeze
18
+ ].freeze
19
+
20
+ def self.validate(value)
21
+ return false if value.nil?
22
+
23
+ EVENT_STATUS.include?(value)
24
+ end
25
+
26
+ def self.from_value(value, default_value = CONFIRMED)
27
+ return default_value if value.nil?
28
+
29
+ str = value.to_s.strip
30
+
31
+ case str.downcase
32
+ when 'confirmed' then CONFIRMED
33
+ when 'tentative' then TENTATIVE
34
+ when 'cancelled' then CANCELLED
35
+ else
36
+ default_value
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,37 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # Whether the event blocks time on the calendar. "opaque" means the event does
8
+ # block time; "transparent" means it does not.
9
+ class EventTransparency
10
+ EVENT_TRANSPARENCY = [
11
+ # TODO: Write general description for OPAQUE
12
+ OPAQUE = 'opaque'.freeze,
13
+
14
+ # TODO: Write general description for TRANSPARENT
15
+ TRANSPARENT = 'transparent'.freeze
16
+ ].freeze
17
+
18
+ def self.validate(value)
19
+ return false if value.nil?
20
+
21
+ EVENT_TRANSPARENCY.include?(value)
22
+ end
23
+
24
+ def self.from_value(value, default_value = OPAQUE)
25
+ return default_value if value.nil?
26
+
27
+ str = value.to_s.strip
28
+
29
+ case str.downcase
30
+ when 'opaque' then OPAQUE
31
+ when 'transparent' then TRANSPARENT
32
+ else
33
+ default_value
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,52 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # The specific type of event.
8
+ class EventType
9
+ EVENT_TYPE = [
10
+ # TODO: Write general description for BIRTHDAY
11
+ BIRTHDAY = 'birthday'.freeze,
12
+
13
+ # TODO: Write general description for DEFAULT
14
+ DEFAULT = 'default'.freeze,
15
+
16
+ # TODO: Write general description for FOCUSTIME
17
+ FOCUSTIME = 'focusTime'.freeze,
18
+
19
+ # TODO: Write general description for FROMGMAIL
20
+ FROMGMAIL = 'fromGmail'.freeze,
21
+
22
+ # TODO: Write general description for OUTOFOFFICE
23
+ OUTOFOFFICE = 'outOfOffice'.freeze,
24
+
25
+ # TODO: Write general description for WORKINGLOCATION
26
+ WORKINGLOCATION = 'workingLocation'.freeze
27
+ ].freeze
28
+
29
+ def self.validate(value)
30
+ return false if value.nil?
31
+
32
+ EVENT_TYPE.include?(value)
33
+ end
34
+
35
+ def self.from_value(value, default_value = BIRTHDAY)
36
+ return default_value if value.nil?
37
+
38
+ str = value.to_s.strip
39
+
40
+ case str.downcase
41
+ when 'birthday' then BIRTHDAY
42
+ when 'default' then DEFAULT
43
+ when 'focustime' then FOCUSTIME
44
+ when 'fromgmail' then FROMGMAIL
45
+ when 'outofoffice' then OUTOFOFFICE
46
+ when 'workinglocation' then WORKINGLOCATION
47
+ else
48
+ default_value
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,44 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # Visibility of the event.
8
+ class EventVisibility
9
+ EVENT_VISIBILITY = [
10
+ # TODO: Write general description for DEFAULT
11
+ DEFAULT = 'default'.freeze,
12
+
13
+ # TODO: Write general description for PUBLIC
14
+ PUBLIC = 'public'.freeze,
15
+
16
+ # TODO: Write general description for PRIVATE
17
+ PRIVATE = 'private'.freeze,
18
+
19
+ # TODO: Write general description for CONFIDENTIAL
20
+ CONFIDENTIAL = 'confidential'.freeze
21
+ ].freeze
22
+
23
+ def self.validate(value)
24
+ return false if value.nil?
25
+
26
+ EVENT_VISIBILITY.include?(value)
27
+ end
28
+
29
+ def self.from_value(value, default_value = DEFAULT)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'default' then DEFAULT
36
+ when 'public' then PUBLIC
37
+ when 'private' then PRIVATE
38
+ when 'confidential' then CONFIDENTIAL
39
+ else
40
+ default_value
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,87 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # Extended properties of the event.
8
+ class ExtendedProperties < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Properties that are private to the copy of the event that appears on this
13
+ # calendar.
14
+ # @return [Hash[String, String]]
15
+ attr_accessor :private
16
+
17
+ # Properties that are shared between copies of the event on other attendees'
18
+ # calendars.
19
+ # @return [Hash[String, String]]
20
+ attr_accessor :shared
21
+
22
+ # A mapping from model property names to API property names.
23
+ def self.names
24
+ @_hash = {} if @_hash.nil?
25
+ @_hash['private'] = 'private'
26
+ @_hash['shared'] = 'shared'
27
+ @_hash
28
+ end
29
+
30
+ # An array for optional fields
31
+ def self.optionals
32
+ %w[
33
+ private
34
+ shared
35
+ ]
36
+ end
37
+
38
+ # An array for nullable fields
39
+ def self.nullables
40
+ []
41
+ end
42
+
43
+ def initialize(private: SKIP, shared: SKIP, additional_properties: nil)
44
+ # Add additional model properties to the instance
45
+ additional_properties = {} if additional_properties.nil?
46
+
47
+ @private = private unless private == SKIP
48
+ @shared = shared unless shared == SKIP
49
+ @additional_properties = additional_properties
50
+ end
51
+
52
+ # Creates an instance of the object from a hash.
53
+ def self.from_hash(hash)
54
+ return nil unless hash
55
+
56
+ # Extract variables from the hash.
57
+ private = hash.key?('private') ? hash['private'] : SKIP
58
+ shared = hash.key?('shared') ? hash['shared'] : SKIP
59
+
60
+ # Create a new hash for additional properties, removing known properties.
61
+ new_hash = hash.reject { |k, _| names.value?(k) }
62
+
63
+ additional_properties = APIHelper.get_additional_properties(
64
+ new_hash, proc { |value| value }
65
+ )
66
+
67
+ # Create object from extracted values.
68
+ ExtendedProperties.new(private: private,
69
+ shared: shared,
70
+ additional_properties: additional_properties)
71
+ end
72
+
73
+ # Provides a human-readable string representation of the object.
74
+ def to_s
75
+ class_name = self.class.name.split('::').last
76
+ "<#{class_name} private: #{@private}, shared: #{@shared}, additional_properties:"\
77
+ " #{@additional_properties}>"
78
+ end
79
+
80
+ # Provides a debugging-friendly string with detailed object information.
81
+ def inspect
82
+ class_name = self.class.name.split('::').last
83
+ "<#{class_name} private: #{@private.inspect}, shared: #{@shared.inspect},"\
84
+ " additional_properties: #{@additional_properties}>"
85
+ end
86
+ end
87
+ end