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.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +168 -0
- data/bin/console +15 -0
- data/lib/calendar_api/api_helper.rb +10 -0
- data/lib/calendar_api/apis/base_api.rb +67 -0
- data/lib/calendar_api/apis/calendar_list_api.rb +63 -0
- data/lib/calendar_api/apis/channels_api.rb +42 -0
- data/lib/calendar_api/apis/events_api.rb +354 -0
- data/lib/calendar_api/apis/free_busy_api.rb +37 -0
- data/lib/calendar_api/apis/oauth_authorization_api.rb +87 -0
- data/lib/calendar_api/client.rb +103 -0
- data/lib/calendar_api/configuration.rb +177 -0
- data/lib/calendar_api/exceptions/api_exception.rb +21 -0
- data/lib/calendar_api/exceptions/error_response_error1_exception.rb +46 -0
- data/lib/calendar_api/exceptions/oauth_provider_exception.rb +64 -0
- data/lib/calendar_api/http/api_response.rb +19 -0
- data/lib/calendar_api/http/auth/oauth_2.rb +162 -0
- data/lib/calendar_api/http/http_call_back.rb +10 -0
- data/lib/calendar_api/http/http_method_enum.rb +10 -0
- data/lib/calendar_api/http/http_request.rb +10 -0
- data/lib/calendar_api/http/http_response.rb +10 -0
- data/lib/calendar_api/http/proxy_settings.rb +22 -0
- data/lib/calendar_api/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/calendar_api/logging/sdk_logger.rb +17 -0
- data/lib/calendar_api/models/attachment.rb +115 -0
- data/lib/calendar_api/models/attendee.rb +167 -0
- data/lib/calendar_api/models/auto_decline_mode.rb +40 -0
- data/lib/calendar_api/models/base_model.rb +110 -0
- data/lib/calendar_api/models/birthday_properties.rb +96 -0
- data/lib/calendar_api/models/birthday_type.rb +48 -0
- data/lib/calendar_api/models/calendar_access_role.rb +44 -0
- data/lib/calendar_api/models/calendar_list_entry.rb +278 -0
- data/lib/calendar_api/models/calendar_list_entry_conference_properties.rb +83 -0
- data/lib/calendar_api/models/calendar_list_entry_notification_settings.rb +85 -0
- data/lib/calendar_api/models/calendar_list_response.rb +129 -0
- data/lib/calendar_api/models/calendar_notification.rb +86 -0
- data/lib/calendar_api/models/calendar_notification_method.rb +27 -0
- data/lib/calendar_api/models/calendar_notification_type.rb +48 -0
- data/lib/calendar_api/models/channel.rb +129 -0
- data/lib/calendar_api/models/channel_params.rb +75 -0
- data/lib/calendar_api/models/channel_type.rb +36 -0
- data/lib/calendar_api/models/chat_status.rb +36 -0
- data/lib/calendar_api/models/conference_create_request.rb +99 -0
- data/lib/calendar_api/models/conference_create_request_status.rb +76 -0
- data/lib/calendar_api/models/conference_data.rb +137 -0
- data/lib/calendar_api/models/conference_data_version.rb +43 -0
- data/lib/calendar_api/models/conference_entry_point.rb +126 -0
- data/lib/calendar_api/models/conference_request_status_code.rb +40 -0
- data/lib/calendar_api/models/conference_solution.rb +95 -0
- data/lib/calendar_api/models/conference_solution_key.rb +74 -0
- data/lib/calendar_api/models/conference_solution_type.rb +40 -0
- data/lib/calendar_api/models/custom_location.rb +75 -0
- data/lib/calendar_api/models/entry_point_type.rb +44 -0
- data/lib/calendar_api/models/error_response.rb +75 -0
- data/lib/calendar_api/models/error_response_error.rb +104 -0
- data/lib/calendar_api/models/error_response_error_errors_items.rb +95 -0
- data/lib/calendar_api/models/event.rb +551 -0
- data/lib/calendar_api/models/event_date_time.rb +107 -0
- data/lib/calendar_api/models/event_list.rb +208 -0
- data/lib/calendar_api/models/event_order_by.rb +36 -0
- data/lib/calendar_api/models/event_reminders.rb +95 -0
- data/lib/calendar_api/models/event_source.rb +86 -0
- data/lib/calendar_api/models/event_status.rb +40 -0
- data/lib/calendar_api/models/event_transparency.rb +37 -0
- data/lib/calendar_api/models/event_type.rb +52 -0
- data/lib/calendar_api/models/event_visibility.rb +44 -0
- data/lib/calendar_api/models/extended_properties.rb +87 -0
- data/lib/calendar_api/models/focus_time_properties.rb +99 -0
- data/lib/calendar_api/models/free_busy_calendar.rb +103 -0
- data/lib/calendar_api/models/free_busy_error.rb +85 -0
- data/lib/calendar_api/models/free_busy_group.rb +94 -0
- data/lib/calendar_api/models/free_busy_request.rb +150 -0
- data/lib/calendar_api/models/free_busy_request_item.rb +72 -0
- data/lib/calendar_api/models/free_busy_response.rb +135 -0
- data/lib/calendar_api/models/oauth_provider_error.rb +62 -0
- data/lib/calendar_api/models/oauth_scope.rb +41 -0
- data/lib/calendar_api/models/oauth_token.rb +96 -0
- data/lib/calendar_api/models/office_location.rb +116 -0
- data/lib/calendar_api/models/out_of_office_properties.rb +88 -0
- data/lib/calendar_api/models/person.rb +106 -0
- data/lib/calendar_api/models/reminder.rb +83 -0
- data/lib/calendar_api/models/reminder_method.rb +36 -0
- data/lib/calendar_api/models/response_status.rb +44 -0
- data/lib/calendar_api/models/send_updates.rb +40 -0
- data/lib/calendar_api/models/stop_channel_request.rb +85 -0
- data/lib/calendar_api/models/time_period.rb +102 -0
- data/lib/calendar_api/models/watch_request.rb +113 -0
- data/lib/calendar_api/models/working_location_properties.rb +107 -0
- data/lib/calendar_api/models/working_location_type.rb +40 -0
- data/lib/calendar_api/utilities/date_time_helper.rb +11 -0
- data/lib/calendar_api/utilities/file_wrapper.rb +28 -0
- data/lib/calendar_api.rb +114 -0
- metadata +176 -0
|
@@ -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
|
+
# Focus time event data. Used if eventType is focusTime.
|
|
8
|
+
class FocusTimeProperties < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Whether to auto-decline conflicting meeting invitations.
|
|
13
|
+
# @return [AutoDeclineMode]
|
|
14
|
+
attr_accessor :auto_decline_mode
|
|
15
|
+
|
|
16
|
+
# Response message to set when auto-declining invitations.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :decline_message
|
|
19
|
+
|
|
20
|
+
# Chat status during focus time.
|
|
21
|
+
# @return [ChatStatus]
|
|
22
|
+
attr_accessor :chat_status
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['auto_decline_mode'] = 'autoDeclineMode'
|
|
28
|
+
@_hash['decline_message'] = 'declineMessage'
|
|
29
|
+
@_hash['chat_status'] = 'chatStatus'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
auto_decline_mode
|
|
37
|
+
decline_message
|
|
38
|
+
chat_status
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(auto_decline_mode: SKIP, decline_message: SKIP,
|
|
48
|
+
chat_status: SKIP, additional_properties: nil)
|
|
49
|
+
# Add additional model properties to the instance
|
|
50
|
+
additional_properties = {} if additional_properties.nil?
|
|
51
|
+
|
|
52
|
+
@auto_decline_mode = auto_decline_mode unless auto_decline_mode == SKIP
|
|
53
|
+
@decline_message = decline_message unless decline_message == SKIP
|
|
54
|
+
@chat_status = chat_status unless chat_status == SKIP
|
|
55
|
+
@additional_properties = additional_properties
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Creates an instance of the object from a hash.
|
|
59
|
+
def self.from_hash(hash)
|
|
60
|
+
return nil unless hash
|
|
61
|
+
|
|
62
|
+
# Extract variables from the hash.
|
|
63
|
+
auto_decline_mode =
|
|
64
|
+
hash.key?('autoDeclineMode') ? hash['autoDeclineMode'] : SKIP
|
|
65
|
+
decline_message =
|
|
66
|
+
hash.key?('declineMessage') ? hash['declineMessage'] : SKIP
|
|
67
|
+
chat_status = hash.key?('chatStatus') ? hash['chatStatus'] : SKIP
|
|
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
|
+
FocusTimeProperties.new(auto_decline_mode: auto_decline_mode,
|
|
78
|
+
decline_message: decline_message,
|
|
79
|
+
chat_status: chat_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} auto_decline_mode: #{@auto_decline_mode}, decline_message:"\
|
|
87
|
+
" #{@decline_message}, chat_status: #{@chat_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} auto_decline_mode: #{@auto_decline_mode.inspect}, decline_message:"\
|
|
95
|
+
" #{@decline_message.inspect}, chat_status: #{@chat_status.inspect}, additional_properties:"\
|
|
96
|
+
" #{@additional_properties}>"
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# calendar_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CalendarApi
|
|
7
|
+
# Free/busy data for a single calendar.
|
|
8
|
+
class FreeBusyCalendar < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# List of time ranges during which this calendar is busy.
|
|
13
|
+
# @return [Array[TimePeriod]]
|
|
14
|
+
attr_accessor :busy
|
|
15
|
+
|
|
16
|
+
# Optional errors for this calendar.
|
|
17
|
+
# @return [Array[FreeBusyError]]
|
|
18
|
+
attr_accessor :errors
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['busy'] = 'busy'
|
|
24
|
+
@_hash['errors'] = 'errors'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
busy
|
|
32
|
+
errors
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(busy: SKIP, errors: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@busy = busy unless busy == SKIP
|
|
46
|
+
@errors = errors unless errors == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
# Parameter is an array, so we need to iterate through it
|
|
56
|
+
busy = nil
|
|
57
|
+
unless hash['busy'].nil?
|
|
58
|
+
busy = []
|
|
59
|
+
hash['busy'].each do |structure|
|
|
60
|
+
busy << (TimePeriod.from_hash(structure) if structure)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
busy = SKIP unless hash.key?('busy')
|
|
65
|
+
# Parameter is an array, so we need to iterate through it
|
|
66
|
+
errors = nil
|
|
67
|
+
unless hash['errors'].nil?
|
|
68
|
+
errors = []
|
|
69
|
+
hash['errors'].each do |structure|
|
|
70
|
+
errors << (FreeBusyError.from_hash(structure) if structure)
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
errors = SKIP unless hash.key?('errors')
|
|
75
|
+
|
|
76
|
+
# Create a new hash for additional properties, removing known properties.
|
|
77
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
78
|
+
|
|
79
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
80
|
+
new_hash, proc { |value| value }
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# Create object from extracted values.
|
|
84
|
+
FreeBusyCalendar.new(busy: busy,
|
|
85
|
+
errors: errors,
|
|
86
|
+
additional_properties: additional_properties)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Provides a human-readable string representation of the object.
|
|
90
|
+
def to_s
|
|
91
|
+
class_name = self.class.name.split('::').last
|
|
92
|
+
"<#{class_name} busy: #{@busy}, errors: #{@errors}, additional_properties:"\
|
|
93
|
+
" #{@additional_properties}>"
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
97
|
+
def inspect
|
|
98
|
+
class_name = self.class.name.split('::').last
|
|
99
|
+
"<#{class_name} busy: #{@busy.inspect}, errors: #{@errors.inspect}, additional_properties:"\
|
|
100
|
+
" #{@additional_properties}>"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# calendar_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CalendarApi
|
|
7
|
+
# An error associated with a free/busy calendar or group query.
|
|
8
|
+
class FreeBusyError < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The error domain.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :domain
|
|
15
|
+
|
|
16
|
+
# The error reason code.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :reason
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['domain'] = 'domain'
|
|
24
|
+
@_hash['reason'] = 'reason'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
domain
|
|
32
|
+
reason
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(domain: SKIP, reason: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@domain = domain unless domain == SKIP
|
|
46
|
+
@reason = reason unless reason == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
domain = hash.key?('domain') ? hash['domain'] : SKIP
|
|
56
|
+
reason = hash.key?('reason') ? hash['reason'] : SKIP
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
FreeBusyError.new(domain: domain,
|
|
67
|
+
reason: reason,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} domain: #{@domain}, reason: #{@reason}, additional_properties:"\
|
|
75
|
+
" #{@additional_properties}>"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
79
|
+
def inspect
|
|
80
|
+
class_name = self.class.name.split('::').last
|
|
81
|
+
"<#{class_name} domain: #{@domain.inspect}, reason: #{@reason.inspect},"\
|
|
82
|
+
" additional_properties: #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# calendar_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CalendarApi
|
|
7
|
+
# Expansion result for a single group.
|
|
8
|
+
class FreeBusyGroup < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# List of calendars that are members of this group.
|
|
13
|
+
# @return [Array[String]]
|
|
14
|
+
attr_accessor :calendars
|
|
15
|
+
|
|
16
|
+
# Optional errors for this group.
|
|
17
|
+
# @return [Array[FreeBusyError]]
|
|
18
|
+
attr_accessor :errors
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['calendars'] = 'calendars'
|
|
24
|
+
@_hash['errors'] = 'errors'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
calendars
|
|
32
|
+
errors
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(calendars: SKIP, errors: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@calendars = calendars unless calendars == SKIP
|
|
46
|
+
@errors = errors unless errors == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
calendars = hash.key?('calendars') ? hash['calendars'] : SKIP
|
|
56
|
+
# Parameter is an array, so we need to iterate through it
|
|
57
|
+
errors = nil
|
|
58
|
+
unless hash['errors'].nil?
|
|
59
|
+
errors = []
|
|
60
|
+
hash['errors'].each do |structure|
|
|
61
|
+
errors << (FreeBusyError.from_hash(structure) if structure)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
errors = SKIP unless hash.key?('errors')
|
|
66
|
+
|
|
67
|
+
# Create a new hash for additional properties, removing known properties.
|
|
68
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
69
|
+
|
|
70
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
71
|
+
new_hash, proc { |value| value }
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
# Create object from extracted values.
|
|
75
|
+
FreeBusyGroup.new(calendars: calendars,
|
|
76
|
+
errors: errors,
|
|
77
|
+
additional_properties: additional_properties)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Provides a human-readable string representation of the object.
|
|
81
|
+
def to_s
|
|
82
|
+
class_name = self.class.name.split('::').last
|
|
83
|
+
"<#{class_name} calendars: #{@calendars}, errors: #{@errors}, additional_properties:"\
|
|
84
|
+
" #{@additional_properties}>"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
88
|
+
def inspect
|
|
89
|
+
class_name = self.class.name.split('::').last
|
|
90
|
+
"<#{class_name} calendars: #{@calendars.inspect}, errors: #{@errors.inspect},"\
|
|
91
|
+
" additional_properties: #{@additional_properties}>"
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -0,0 +1,150 @@
|
|
|
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
|
+
# Request body for querying free/busy information.
|
|
9
|
+
class FreeBusyRequest < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# The start of the interval for the query (RFC3339).
|
|
14
|
+
# @return [DateTime]
|
|
15
|
+
attr_accessor :time_min
|
|
16
|
+
|
|
17
|
+
# The end of the interval for the query (RFC3339).
|
|
18
|
+
# @return [DateTime]
|
|
19
|
+
attr_accessor :time_max
|
|
20
|
+
|
|
21
|
+
# Time zone used in the response. Optional. Defaults to UTC.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :time_zone
|
|
24
|
+
|
|
25
|
+
# Maximal number of calendar identifiers to be provided for a single group.
|
|
26
|
+
# Maximum value is 100.
|
|
27
|
+
# @return [Integer]
|
|
28
|
+
attr_accessor :group_expansion_max
|
|
29
|
+
|
|
30
|
+
# Maximal number of calendars whose free/busy information is to be returned.
|
|
31
|
+
# Maximum value is 50.
|
|
32
|
+
# @return [Integer]
|
|
33
|
+
attr_accessor :calendar_expansion_max
|
|
34
|
+
|
|
35
|
+
# List of calendars and/or groups to query.
|
|
36
|
+
# @return [Array[FreeBusyRequestItem]]
|
|
37
|
+
attr_accessor :items
|
|
38
|
+
|
|
39
|
+
# A mapping from model property names to API property names.
|
|
40
|
+
def self.names
|
|
41
|
+
@_hash = {} if @_hash.nil?
|
|
42
|
+
@_hash['time_min'] = 'timeMin'
|
|
43
|
+
@_hash['time_max'] = 'timeMax'
|
|
44
|
+
@_hash['time_zone'] = 'timeZone'
|
|
45
|
+
@_hash['group_expansion_max'] = 'groupExpansionMax'
|
|
46
|
+
@_hash['calendar_expansion_max'] = 'calendarExpansionMax'
|
|
47
|
+
@_hash['items'] = 'items'
|
|
48
|
+
@_hash
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# An array for optional fields
|
|
52
|
+
def self.optionals
|
|
53
|
+
%w[
|
|
54
|
+
time_zone
|
|
55
|
+
group_expansion_max
|
|
56
|
+
calendar_expansion_max
|
|
57
|
+
]
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# An array for nullable fields
|
|
61
|
+
def self.nullables
|
|
62
|
+
[]
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def initialize(time_min:, time_max:, items:, time_zone: SKIP,
|
|
66
|
+
group_expansion_max: SKIP, calendar_expansion_max: SKIP,
|
|
67
|
+
additional_properties: nil)
|
|
68
|
+
# Add additional model properties to the instance
|
|
69
|
+
additional_properties = {} if additional_properties.nil?
|
|
70
|
+
|
|
71
|
+
@time_min = time_min
|
|
72
|
+
@time_max = time_max
|
|
73
|
+
@time_zone = time_zone unless time_zone == SKIP
|
|
74
|
+
@group_expansion_max = group_expansion_max unless group_expansion_max == SKIP
|
|
75
|
+
@calendar_expansion_max = calendar_expansion_max unless calendar_expansion_max == SKIP
|
|
76
|
+
@items = items
|
|
77
|
+
@additional_properties = additional_properties
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Creates an instance of the object from a hash.
|
|
81
|
+
def self.from_hash(hash)
|
|
82
|
+
return nil unless hash
|
|
83
|
+
|
|
84
|
+
# Extract variables from the hash.
|
|
85
|
+
time_min = if hash.key?('timeMin')
|
|
86
|
+
(DateTimeHelper.from_rfc3339(hash['timeMin']) if hash['timeMin'])
|
|
87
|
+
end
|
|
88
|
+
time_max = if hash.key?('timeMax')
|
|
89
|
+
(DateTimeHelper.from_rfc3339(hash['timeMax']) if hash['timeMax'])
|
|
90
|
+
end
|
|
91
|
+
# Parameter is an array, so we need to iterate through it
|
|
92
|
+
items = nil
|
|
93
|
+
unless hash['items'].nil?
|
|
94
|
+
items = []
|
|
95
|
+
hash['items'].each do |structure|
|
|
96
|
+
items << (FreeBusyRequestItem.from_hash(structure) if structure)
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
items = nil unless hash.key?('items')
|
|
101
|
+
time_zone = hash.key?('timeZone') ? hash['timeZone'] : SKIP
|
|
102
|
+
group_expansion_max =
|
|
103
|
+
hash.key?('groupExpansionMax') ? hash['groupExpansionMax'] : SKIP
|
|
104
|
+
calendar_expansion_max =
|
|
105
|
+
hash.key?('calendarExpansionMax') ? hash['calendarExpansionMax'] : SKIP
|
|
106
|
+
|
|
107
|
+
# Create a new hash for additional properties, removing known properties.
|
|
108
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
109
|
+
|
|
110
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
111
|
+
new_hash, proc { |value| value }
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
# Create object from extracted values.
|
|
115
|
+
FreeBusyRequest.new(time_min: time_min,
|
|
116
|
+
time_max: time_max,
|
|
117
|
+
items: items,
|
|
118
|
+
time_zone: time_zone,
|
|
119
|
+
group_expansion_max: group_expansion_max,
|
|
120
|
+
calendar_expansion_max: calendar_expansion_max,
|
|
121
|
+
additional_properties: additional_properties)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def to_custom_time_min
|
|
125
|
+
DateTimeHelper.to_rfc3339(time_min)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def to_custom_time_max
|
|
129
|
+
DateTimeHelper.to_rfc3339(time_max)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Provides a human-readable string representation of the object.
|
|
133
|
+
def to_s
|
|
134
|
+
class_name = self.class.name.split('::').last
|
|
135
|
+
"<#{class_name} time_min: #{@time_min}, time_max: #{@time_max}, time_zone: #{@time_zone},"\
|
|
136
|
+
" group_expansion_max: #{@group_expansion_max}, calendar_expansion_max:"\
|
|
137
|
+
" #{@calendar_expansion_max}, items: #{@items}, additional_properties:"\
|
|
138
|
+
" #{@additional_properties}>"
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
142
|
+
def inspect
|
|
143
|
+
class_name = self.class.name.split('::').last
|
|
144
|
+
"<#{class_name} time_min: #{@time_min.inspect}, time_max: #{@time_max.inspect}, time_zone:"\
|
|
145
|
+
" #{@time_zone.inspect}, group_expansion_max: #{@group_expansion_max.inspect},"\
|
|
146
|
+
" calendar_expansion_max: #{@calendar_expansion_max.inspect}, items: #{@items.inspect},"\
|
|
147
|
+
" additional_properties: #{@additional_properties}>"
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# calendar_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CalendarApi
|
|
7
|
+
# Identifies a calendar or group to include in a free/busy query.
|
|
8
|
+
class FreeBusyRequestItem < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The identifier of a calendar or a group.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :id
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['id'] = 'id'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
[]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for nullable fields
|
|
29
|
+
def self.nullables
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def initialize(id:, additional_properties: nil)
|
|
34
|
+
# Add additional model properties to the instance
|
|
35
|
+
additional_properties = {} if additional_properties.nil?
|
|
36
|
+
|
|
37
|
+
@id = id
|
|
38
|
+
@additional_properties = additional_properties
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Creates an instance of the object from a hash.
|
|
42
|
+
def self.from_hash(hash)
|
|
43
|
+
return nil unless hash
|
|
44
|
+
|
|
45
|
+
# Extract variables from the hash.
|
|
46
|
+
id = hash.key?('id') ? hash['id'] : nil
|
|
47
|
+
|
|
48
|
+
# Create a new hash for additional properties, removing known properties.
|
|
49
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
50
|
+
|
|
51
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
52
|
+
new_hash, proc { |value| value }
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Create object from extracted values.
|
|
56
|
+
FreeBusyRequestItem.new(id: id,
|
|
57
|
+
additional_properties: additional_properties)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Provides a human-readable string representation of the object.
|
|
61
|
+
def to_s
|
|
62
|
+
class_name = self.class.name.split('::').last
|
|
63
|
+
"<#{class_name} id: #{@id}, additional_properties: #{@additional_properties}>"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
67
|
+
def inspect
|
|
68
|
+
class_name = self.class.name.split('::').last
|
|
69
|
+
"<#{class_name} id: #{@id.inspect}, additional_properties: #{@additional_properties}>"
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|