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,129 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # A paginated list of the user's calendar list entries.
8
+ class CalendarListResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Type of the collection.
13
+ # @return [String]
14
+ attr_accessor :kind
15
+
16
+ # ETag of the collection.
17
+ # @return [String]
18
+ attr_accessor :etag
19
+
20
+ # Token used to access the next page of this result. Omitted if no further
21
+ # results are available.
22
+ # @return [String]
23
+ attr_accessor :next_page_token
24
+
25
+ # Token used for incremental synchronization at a later point. Only provided
26
+ # on the last page of results.
27
+ # @return [String]
28
+ attr_accessor :next_sync_token
29
+
30
+ # Calendars on the user's calendar list.
31
+ # @return [Array[CalendarListEntry]]
32
+ attr_accessor :items
33
+
34
+ # A mapping from model property names to API property names.
35
+ def self.names
36
+ @_hash = {} if @_hash.nil?
37
+ @_hash['kind'] = 'kind'
38
+ @_hash['etag'] = 'etag'
39
+ @_hash['next_page_token'] = 'nextPageToken'
40
+ @_hash['next_sync_token'] = 'nextSyncToken'
41
+ @_hash['items'] = 'items'
42
+ @_hash
43
+ end
44
+
45
+ # An array for optional fields
46
+ def self.optionals
47
+ %w[
48
+ kind
49
+ etag
50
+ next_page_token
51
+ next_sync_token
52
+ items
53
+ ]
54
+ end
55
+
56
+ # An array for nullable fields
57
+ def self.nullables
58
+ []
59
+ end
60
+
61
+ def initialize(kind: 'calendar#calendarList', etag: SKIP,
62
+ next_page_token: SKIP, next_sync_token: SKIP, items: SKIP,
63
+ additional_properties: nil)
64
+ # Add additional model properties to the instance
65
+ additional_properties = {} if additional_properties.nil?
66
+
67
+ @kind = kind unless kind == SKIP
68
+ @etag = etag unless etag == SKIP
69
+ @next_page_token = next_page_token unless next_page_token == SKIP
70
+ @next_sync_token = next_sync_token unless next_sync_token == SKIP
71
+ @items = items unless items == SKIP
72
+ @additional_properties = additional_properties
73
+ end
74
+
75
+ # Creates an instance of the object from a hash.
76
+ def self.from_hash(hash)
77
+ return nil unless hash
78
+
79
+ # Extract variables from the hash.
80
+ kind = hash['kind'] ||= 'calendar#calendarList'
81
+ etag = hash.key?('etag') ? hash['etag'] : SKIP
82
+ next_page_token =
83
+ hash.key?('nextPageToken') ? hash['nextPageToken'] : SKIP
84
+ next_sync_token =
85
+ hash.key?('nextSyncToken') ? hash['nextSyncToken'] : SKIP
86
+ # Parameter is an array, so we need to iterate through it
87
+ items = nil
88
+ unless hash['items'].nil?
89
+ items = []
90
+ hash['items'].each do |structure|
91
+ items << (CalendarListEntry.from_hash(structure) if structure)
92
+ end
93
+ end
94
+
95
+ items = SKIP unless hash.key?('items')
96
+
97
+ # Create a new hash for additional properties, removing known properties.
98
+ new_hash = hash.reject { |k, _| names.value?(k) }
99
+
100
+ additional_properties = APIHelper.get_additional_properties(
101
+ new_hash, proc { |value| value }
102
+ )
103
+
104
+ # Create object from extracted values.
105
+ CalendarListResponse.new(kind: kind,
106
+ etag: etag,
107
+ next_page_token: next_page_token,
108
+ next_sync_token: next_sync_token,
109
+ items: items,
110
+ additional_properties: additional_properties)
111
+ end
112
+
113
+ # Provides a human-readable string representation of the object.
114
+ def to_s
115
+ class_name = self.class.name.split('::').last
116
+ "<#{class_name} kind: #{@kind}, etag: #{@etag}, next_page_token: #{@next_page_token},"\
117
+ " next_sync_token: #{@next_sync_token}, items: #{@items}, additional_properties:"\
118
+ " #{@additional_properties}>"
119
+ end
120
+
121
+ # Provides a debugging-friendly string with detailed object information.
122
+ def inspect
123
+ class_name = self.class.name.split('::').last
124
+ "<#{class_name} kind: #{@kind.inspect}, etag: #{@etag.inspect}, next_page_token:"\
125
+ " #{@next_page_token.inspect}, next_sync_token: #{@next_sync_token.inspect}, items:"\
126
+ " #{@items.inspect}, additional_properties: #{@additional_properties}>"
127
+ end
128
+ end
129
+ 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
+ # A notification setting for a calendar.
8
+ class CalendarNotification < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The type of notification.
13
+ # @return [CalendarNotificationType]
14
+ attr_accessor :type
15
+
16
+ # The method used to deliver the notification. Currently only "email" is
17
+ # supported.
18
+ # @return [CalendarNotificationMethod]
19
+ attr_accessor :method
20
+
21
+ # A mapping from model property names to API property names.
22
+ def self.names
23
+ @_hash = {} if @_hash.nil?
24
+ @_hash['type'] = 'type'
25
+ @_hash['method'] = 'method'
26
+ @_hash
27
+ end
28
+
29
+ # An array for optional fields
30
+ def self.optionals
31
+ %w[
32
+ type
33
+ method
34
+ ]
35
+ end
36
+
37
+ # An array for nullable fields
38
+ def self.nullables
39
+ []
40
+ end
41
+
42
+ def initialize(type: SKIP, method: SKIP, additional_properties: nil)
43
+ # Add additional model properties to the instance
44
+ additional_properties = {} if additional_properties.nil?
45
+
46
+ @type = type unless type == SKIP
47
+ @method = method unless method == 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
+ type = hash.key?('type') ? hash['type'] : SKIP
57
+ method = hash.key?('method') ? hash['method'] : 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
+ CalendarNotification.new(type: type,
68
+ method: method,
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} type: #{@type}, method: #{@method}, 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} type: #{@type.inspect}, method: #{@method.inspect}, additional_properties:"\
83
+ " #{@additional_properties}>"
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,27 @@
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 method used to deliver the notification. Currently only "email" is
8
+ # supported.
9
+ class CalendarNotificationMethod
10
+ CALENDAR_NOTIFICATION_METHOD = [
11
+ # TODO: Write general description for EMAIL
12
+ EMAIL = 'email'.freeze
13
+ ].freeze
14
+
15
+ def self.validate(value)
16
+ return false if value.nil?
17
+
18
+ CALENDAR_NOTIFICATION_METHOD.include?(value)
19
+ end
20
+
21
+ def self.from_value(value, default_value = EMAIL)
22
+ return default_value if value.nil?
23
+
24
+ default_value
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,48 @@
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 type of notification.
8
+ class CalendarNotificationType
9
+ CALENDAR_NOTIFICATION_TYPE = [
10
+ # TODO: Write general description for EVENTCREATION
11
+ EVENTCREATION = 'eventCreation'.freeze,
12
+
13
+ # TODO: Write general description for EVENTCHANGE
14
+ EVENTCHANGE = 'eventChange'.freeze,
15
+
16
+ # TODO: Write general description for EVENTCANCELLATION
17
+ EVENTCANCELLATION = 'eventCancellation'.freeze,
18
+
19
+ # TODO: Write general description for EVENTRESPONSE
20
+ EVENTRESPONSE = 'eventResponse'.freeze,
21
+
22
+ # TODO: Write general description for AGENDA
23
+ AGENDA = 'agenda'.freeze
24
+ ].freeze
25
+
26
+ def self.validate(value)
27
+ return false if value.nil?
28
+
29
+ CALENDAR_NOTIFICATION_TYPE.include?(value)
30
+ end
31
+
32
+ def self.from_value(value, default_value = EVENTCREATION)
33
+ return default_value if value.nil?
34
+
35
+ str = value.to_s.strip
36
+
37
+ case str.downcase
38
+ when 'eventcreation' then EVENTCREATION
39
+ when 'eventchange' then EVENTCHANGE
40
+ when 'eventcancellation' then EVENTCANCELLATION
41
+ when 'eventresponse' then EVENTRESPONSE
42
+ when 'agenda' then AGENDA
43
+ else
44
+ default_value
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,129 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # A notification channel used to watch for resource changes.
8
+ class Channel < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Identifies this as a notification channel used to watch for changes to a
13
+ # resource.
14
+ # @return [String]
15
+ attr_accessor :kind
16
+
17
+ # A UUID or similar unique string that identifies this channel.
18
+ # @return [String]
19
+ attr_accessor :id
20
+
21
+ # An opaque value that identifies the resource being watched on this
22
+ # channel.
23
+ # @return [String]
24
+ attr_accessor :resource_id
25
+
26
+ # A version-specific identifier for the watched resource.
27
+ # @return [String]
28
+ attr_accessor :resource_uri
29
+
30
+ # An arbitrary string delivered to the target address with each
31
+ # notification.
32
+ # @return [String]
33
+ attr_accessor :token
34
+
35
+ # Date and time of notification channel expiration, expressed as a Unix
36
+ # timestamp, in milliseconds.
37
+ # @return [Integer]
38
+ attr_accessor :expiration
39
+
40
+ # A mapping from model property names to API property names.
41
+ def self.names
42
+ @_hash = {} if @_hash.nil?
43
+ @_hash['kind'] = 'kind'
44
+ @_hash['id'] = 'id'
45
+ @_hash['resource_id'] = 'resourceId'
46
+ @_hash['resource_uri'] = 'resourceUri'
47
+ @_hash['token'] = 'token'
48
+ @_hash['expiration'] = 'expiration'
49
+ @_hash
50
+ end
51
+
52
+ # An array for optional fields
53
+ def self.optionals
54
+ %w[
55
+ kind
56
+ id
57
+ resource_id
58
+ resource_uri
59
+ token
60
+ expiration
61
+ ]
62
+ end
63
+
64
+ # An array for nullable fields
65
+ def self.nullables
66
+ []
67
+ end
68
+
69
+ def initialize(kind: 'api#channel', id: SKIP, resource_id: SKIP,
70
+ resource_uri: SKIP, token: SKIP, expiration: SKIP,
71
+ additional_properties: nil)
72
+ # Add additional model properties to the instance
73
+ additional_properties = {} if additional_properties.nil?
74
+
75
+ @kind = kind unless kind == SKIP
76
+ @id = id unless id == SKIP
77
+ @resource_id = resource_id unless resource_id == SKIP
78
+ @resource_uri = resource_uri unless resource_uri == SKIP
79
+ @token = token unless token == SKIP
80
+ @expiration = expiration unless expiration == SKIP
81
+ @additional_properties = additional_properties
82
+ end
83
+
84
+ # Creates an instance of the object from a hash.
85
+ def self.from_hash(hash)
86
+ return nil unless hash
87
+
88
+ # Extract variables from the hash.
89
+ kind = hash['kind'] ||= 'api#channel'
90
+ id = hash.key?('id') ? hash['id'] : SKIP
91
+ resource_id = hash.key?('resourceId') ? hash['resourceId'] : SKIP
92
+ resource_uri = hash.key?('resourceUri') ? hash['resourceUri'] : SKIP
93
+ token = hash.key?('token') ? hash['token'] : SKIP
94
+ expiration = hash.key?('expiration') ? hash['expiration'] : SKIP
95
+
96
+ # Create a new hash for additional properties, removing known properties.
97
+ new_hash = hash.reject { |k, _| names.value?(k) }
98
+
99
+ additional_properties = APIHelper.get_additional_properties(
100
+ new_hash, proc { |value| value }
101
+ )
102
+
103
+ # Create object from extracted values.
104
+ Channel.new(kind: kind,
105
+ id: id,
106
+ resource_id: resource_id,
107
+ resource_uri: resource_uri,
108
+ token: token,
109
+ expiration: expiration,
110
+ additional_properties: additional_properties)
111
+ end
112
+
113
+ # Provides a human-readable string representation of the object.
114
+ def to_s
115
+ class_name = self.class.name.split('::').last
116
+ "<#{class_name} kind: #{@kind}, id: #{@id}, resource_id: #{@resource_id}, resource_uri:"\
117
+ " #{@resource_uri}, token: #{@token}, expiration: #{@expiration}, additional_properties:"\
118
+ " #{@additional_properties}>"
119
+ end
120
+
121
+ # Provides a debugging-friendly string with detailed object information.
122
+ def inspect
123
+ class_name = self.class.name.split('::').last
124
+ "<#{class_name} kind: #{@kind.inspect}, id: #{@id.inspect}, resource_id:"\
125
+ " #{@resource_id.inspect}, resource_uri: #{@resource_uri.inspect}, token: #{@token.inspect},"\
126
+ " expiration: #{@expiration.inspect}, additional_properties: #{@additional_properties}>"
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,75 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # Additional parameters controlling delivery channel behavior.
8
+ class ChannelParams < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The time-to-live in seconds for the notification channel. Default is
13
+ # 604800 (1 week).
14
+ # @return [String]
15
+ attr_accessor :ttl
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['ttl'] = 'ttl'
21
+ @_hash
22
+ end
23
+
24
+ # An array for optional fields
25
+ def self.optionals
26
+ %w[
27
+ ttl
28
+ ]
29
+ end
30
+
31
+ # An array for nullable fields
32
+ def self.nullables
33
+ []
34
+ end
35
+
36
+ def initialize(ttl: SKIP, additional_properties: nil)
37
+ # Add additional model properties to the instance
38
+ additional_properties = {} if additional_properties.nil?
39
+
40
+ @ttl = ttl unless ttl == SKIP
41
+ @additional_properties = additional_properties
42
+ end
43
+
44
+ # Creates an instance of the object from a hash.
45
+ def self.from_hash(hash)
46
+ return nil unless hash
47
+
48
+ # Extract variables from the hash.
49
+ ttl = hash.key?('ttl') ? hash['ttl'] : SKIP
50
+
51
+ # Create a new hash for additional properties, removing known properties.
52
+ new_hash = hash.reject { |k, _| names.value?(k) }
53
+
54
+ additional_properties = APIHelper.get_additional_properties(
55
+ new_hash, proc { |value| value }
56
+ )
57
+
58
+ # Create object from extracted values.
59
+ ChannelParams.new(ttl: ttl,
60
+ additional_properties: additional_properties)
61
+ end
62
+
63
+ # Provides a human-readable string representation of the object.
64
+ def to_s
65
+ class_name = self.class.name.split('::').last
66
+ "<#{class_name} ttl: #{@ttl}, additional_properties: #{@additional_properties}>"
67
+ end
68
+
69
+ # Provides a debugging-friendly string with detailed object information.
70
+ def inspect
71
+ class_name = self.class.name.split('::').last
72
+ "<#{class_name} ttl: #{@ttl.inspect}, additional_properties: #{@additional_properties}>"
73
+ end
74
+ end
75
+ 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 type of delivery mechanism used for the notification channel.
8
+ class ChannelType
9
+ CHANNEL_TYPE = [
10
+ # TODO: Write general description for WEB_HOOK
11
+ WEB_HOOK = 'web_hook'.freeze,
12
+
13
+ # TODO: Write general description for WEBHOOK1
14
+ WEBHOOK1 = 'webhook'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ CHANNEL_TYPE.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = WEB_HOOK)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'web_hook' then WEB_HOOK
30
+ when 'webhook1' then WEBHOOK1
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ 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
+ # Chat status during focus time.
8
+ class ChatStatus
9
+ CHAT_STATUS = [
10
+ # TODO: Write general description for AVAILABLE
11
+ AVAILABLE = 'available'.freeze,
12
+
13
+ # TODO: Write general description for DONOTDISTURB
14
+ DONOTDISTURB = 'doNotDisturb'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ CHAT_STATUS.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = AVAILABLE)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'available' then AVAILABLE
30
+ when 'donotdisturb' then DONOTDISTURB
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,99 @@
1
+ # calendar_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CalendarApi
7
+ # A request to generate a new conference and attach it to the event.
8
+ class ConferenceCreateRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Unique client-generated ID for this request. Clients should regenerate
13
+ # this ID for every new request.
14
+ # @return [String]
15
+ attr_accessor :request_id
16
+
17
+ # Identifies a conference solution type.
18
+ # @return [ConferenceSolutionKey]
19
+ attr_accessor :conference_solution_key
20
+
21
+ # Status of the conference create request.
22
+ # @return [ConferenceCreateRequestStatus]
23
+ attr_accessor :status
24
+
25
+ # A mapping from model property names to API property names.
26
+ def self.names
27
+ @_hash = {} if @_hash.nil?
28
+ @_hash['request_id'] = 'requestId'
29
+ @_hash['conference_solution_key'] = 'conferenceSolutionKey'
30
+ @_hash['status'] = 'status'
31
+ @_hash
32
+ end
33
+
34
+ # An array for optional fields
35
+ def self.optionals
36
+ %w[
37
+ request_id
38
+ conference_solution_key
39
+ status
40
+ ]
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(request_id: SKIP, conference_solution_key: SKIP,
49
+ status: SKIP, additional_properties: nil)
50
+ # Add additional model properties to the instance
51
+ additional_properties = {} if additional_properties.nil?
52
+
53
+ @request_id = request_id unless request_id == SKIP
54
+ @conference_solution_key = conference_solution_key unless conference_solution_key == SKIP
55
+ @status = status unless status == SKIP
56
+ @additional_properties = additional_properties
57
+ end
58
+
59
+ # Creates an instance of the object from a hash.
60
+ def self.from_hash(hash)
61
+ return nil unless hash
62
+
63
+ # Extract variables from the hash.
64
+ request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
65
+ conference_solution_key = ConferenceSolutionKey.from_hash(hash['conferenceSolutionKey']) if
66
+ hash['conferenceSolutionKey']
67
+ status = ConferenceCreateRequestStatus.from_hash(hash['status']) if hash['status']
68
+
69
+ # Create a new hash for additional properties, removing known properties.
70
+ new_hash = hash.reject { |k, _| names.value?(k) }
71
+
72
+ additional_properties = APIHelper.get_additional_properties(
73
+ new_hash, proc { |value| value }
74
+ )
75
+
76
+ # Create object from extracted values.
77
+ ConferenceCreateRequest.new(request_id: request_id,
78
+ conference_solution_key: conference_solution_key,
79
+ status: status,
80
+ additional_properties: additional_properties)
81
+ end
82
+
83
+ # Provides a human-readable string representation of the object.
84
+ def to_s
85
+ class_name = self.class.name.split('::').last
86
+ "<#{class_name} request_id: #{@request_id}, conference_solution_key:"\
87
+ " #{@conference_solution_key}, status: #{@status}, additional_properties:"\
88
+ " #{@additional_properties}>"
89
+ end
90
+
91
+ # Provides a debugging-friendly string with detailed object information.
92
+ def inspect
93
+ class_name = self.class.name.split('::').last
94
+ "<#{class_name} request_id: #{@request_id.inspect}, conference_solution_key:"\
95
+ " #{@conference_solution_key.inspect}, status: #{@status.inspect}, additional_properties:"\
96
+ " #{@additional_properties}>"
97
+ end
98
+ end
99
+ end