qubrics-mailbox 3.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/CHANGELOG.md +108 -0
- data/LICENSE +21 -0
- data/README.md +183 -0
- data/lib/qubrics/mailbox/client.rb +63 -0
- data/lib/qubrics/mailbox/version.rb +7 -0
- data/lib/qubrics/mailbox.rb +12 -0
- data/lib/qubrics_mailbox_generated/api/mailbox_api_api.rb +4371 -0
- data/lib/qubrics_mailbox_generated/api_client.rb +447 -0
- data/lib/qubrics_mailbox_generated/api_error.rb +58 -0
- data/lib/qubrics_mailbox_generated/api_model_base.rb +95 -0
- data/lib/qubrics_mailbox_generated/configuration.rb +400 -0
- data/lib/qubrics_mailbox_generated/models/api_error_detail.rb +219 -0
- data/lib/qubrics_mailbox_generated/models/api_error_error.rb +275 -0
- data/lib/qubrics_mailbox_generated/models/api_error_meta.rb +164 -0
- data/lib/qubrics_mailbox_generated/models/api_error_response.rb +216 -0
- data/lib/qubrics_mailbox_generated/models/batch_delete_mailbox_messages_body.rb +205 -0
- data/lib/qubrics_mailbox_generated/models/batch_update_mailbox_messages_body.rb +227 -0
- data/lib/qubrics_mailbox_generated/models/connection.rb +273 -0
- data/lib/qubrics_mailbox_generated/models/connection_credential.rb +226 -0
- data/lib/qubrics_mailbox_generated/models/connection_mailboxes_inner.rb +190 -0
- data/lib/qubrics_mailbox_generated/models/connection_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/connection_team.rb +190 -0
- data/lib/qubrics_mailbox_generated/models/control_mailbox_draft_schedule.rb +232 -0
- data/lib/qubrics_mailbox_generated/models/create_mailbox_draft.rb +448 -0
- data/lib/qubrics_mailbox_generated/models/create_mailbox_draft_attachments_inner.rb +400 -0
- data/lib/qubrics_mailbox_generated/models/create_mailbox_draft_bcc_inner.rb +200 -0
- data/lib/qubrics_mailbox_generated/models/create_mailbox_draft_from.rb +201 -0
- data/lib/qubrics_mailbox_generated/models/create_mailbox_draft_source.rb +235 -0
- data/lib/qubrics_mailbox_generated/models/create_mailbox_folder_body.rb +183 -0
- data/lib/qubrics_mailbox_generated/models/cursor_pagination.rb +173 -0
- data/lib/qubrics_mailbox_generated/models/granted_mailbox.rb +192 -0
- data/lib/qubrics_mailbox_generated/models/granted_mailbox_list_response.rb +251 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_address.rb +176 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_attachment.rb +250 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_attachment_text.rb +337 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_attachment_text_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_intent_body.rb +228 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_intent_result.rb +323 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_intent_result_headers.rb +191 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_intent_result_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_result.rb +243 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_result_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_batch_delete_messages_result.rb +248 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_batch_delete_messages_result_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_batch_get_body.rb +373 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_batch_get_item.rb +188 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_batch_get_result.rb +220 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_batch_get_result_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_batch_get_result_states.rb +150 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_batch_message_failure.rb +216 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_batch_message_states.rb +162 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_batch_update_messages_result.rb +248 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_batch_update_messages_result_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_changes.rb +307 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_changes_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_content_headers.rb +214 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_content_headers_full_inner.rb +190 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_content_headers_selected.rb +234 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_draft.rb +670 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_draft_delete_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_draft_delete_response_all_of_data.rb +190 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_draft_list_response.rb +251 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_draft_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_folder.rb +307 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_folder_cursor_list_response.rb +251 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_folder_deleted_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_folder_query_changes.rb +270 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_folder_query_changes_added_inner.rb +190 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_folder_query_changes_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_folder_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_get_changes200_response.rb +103 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_identity.rb +352 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_identity_cursor_list_response.rb +251 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_identity_list_meta.rb +173 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_identity_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_me.rb +294 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_me_item_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message.rb +594 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_content.rb +348 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_content_body.rb +352 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_content_body_html_cleaning.rb +241 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_content_dates.rb +162 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_content_participants.rb +262 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_content_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_content_states.rb +176 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_count.rb +176 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_count_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_deleted_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_detail_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_flags.rb +242 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_query_changes.rb +270 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_query_changes_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_summary.rb +454 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_message_summary_cursor_list_response.rb +251 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_query_meta.rb +173 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_quota.rb +359 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_quota_cursor_list_response.rb +251 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_raw_body.rb +279 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_raw_body_body.rb +200 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_raw_body_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_realtime_event.rb +366 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_realtime_message.rb +492 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_realtime_message_body.rb +214 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_search_snippet.rb +190 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_search_snippets_result.rb +206 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_search_snippets_result_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_send_result_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_send_scope.rb +213 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_sender_choices.rb +217 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_sender_choices_from.rb +213 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_sender_choices_reply_to.rb +213 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_sender_choices_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session.rb +294 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities.rb +346 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_attachments.rb +294 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_folders.rb +320 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_identities.rb +268 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_messages.rb +516 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_quotas.rb +242 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_submissions.rb +242 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_sync.rb +222 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_threads.rb +268 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_endpoints.rb +334 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_gated.rb +451 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_limits.rb +448 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_mailbox.rb +203 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_session_states.rb +294 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_submission.rb +321 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_submission_cursor_list_response.rb +251 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_submission_delivery_status.rb +200 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_submission_envelope.rb +178 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_submission_envelope_address.rb +178 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_submission_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_sync_meta.rb +173 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_thread.rb +377 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_thread_content_meta.rb +244 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_thread_content_meta_states.rb +188 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_thread_content_response.rb +251 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_thread_detail_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_thread_message_summary_cursor_list_response.rb +251 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_thread_messages_meta.rb +199 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_thread_summary.rb +349 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_thread_summary_cursor_list_response.rb +251 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_thread_summary_states.rb +162 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_typed_changes.rb +164 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_typed_changes_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_typed_changes_types.rb +192 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_usage.rb +192 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_usage_resource.rb +408 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_usage_response.rb +223 -0
- data/lib/qubrics_mailbox_generated/models/mailbox_usage_states.rb +150 -0
- data/lib/qubrics_mailbox_generated/models/patch_mailbox_folder_body.rb +166 -0
- data/lib/qubrics_mailbox_generated/models/patch_mailbox_message_body.rb +168 -0
- data/lib/qubrics_mailbox_generated/models/response_meta.rb +164 -0
- data/lib/qubrics_mailbox_generated/models/send_mailbox_draft.rb +222 -0
- data/lib/qubrics_mailbox_generated/models/send_mailbox_message_body.rb +326 -0
- data/lib/qubrics_mailbox_generated/models/send_mailbox_message_body_attachments_inner.rb +103 -0
- data/lib/qubrics_mailbox_generated/models/send_mailbox_message_body_attachments_inner_any_of.rb +217 -0
- data/lib/qubrics_mailbox_generated/models/send_mailbox_message_body_attachments_inner_any_of1.rb +217 -0
- data/lib/qubrics_mailbox_generated/models/send_mailbox_message_result.rb +214 -0
- data/lib/qubrics_mailbox_generated/models/success_envelope.rb +192 -0
- data/lib/qubrics_mailbox_generated/models/update_mailbox_draft.rb +437 -0
- data/lib/qubrics_mailbox_generated/models/update_mailbox_identity_body.rb +216 -0
- data/lib/qubrics_mailbox_generated/version.rb +15 -0
- data/lib/qubrics_mailbox_generated.rb +210 -0
- metadata +290 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Qubrics API
|
|
3
|
+
|
|
4
|
+
#Programmatic access to your Qubrics email infrastructure.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Qubrics::Mailbox::Generated
|
|
17
|
+
class SendMailboxDraft < ApiModelBase
|
|
18
|
+
# Exact saved revision to send. A stale revision returns conflict.
|
|
19
|
+
attr_accessor :expected_revision
|
|
20
|
+
|
|
21
|
+
# Current schedule version. Required for scheduling and after cancelling a schedule.
|
|
22
|
+
attr_accessor :expected_schedule_version
|
|
23
|
+
|
|
24
|
+
# Send no earlier than this future time, within 30 days. Include a timezone and at most millisecond precision. Omit to send now.
|
|
25
|
+
attr_accessor :scheduled_for
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'expected_revision' => :'expected_revision',
|
|
31
|
+
:'expected_schedule_version' => :'expected_schedule_version',
|
|
32
|
+
:'scheduled_for' => :'scheduled_for'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'expected_revision' => :'Integer',
|
|
50
|
+
:'expected_schedule_version' => :'Integer',
|
|
51
|
+
:'scheduled_for' => :'Time'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
])
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Initializes the object
|
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
if (!attributes.is_a?(Hash))
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Qubrics::Mailbox::Generated::SendMailboxDraft` initialize method"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Qubrics::Mailbox::Generated::SendMailboxDraft`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
73
|
+
end
|
|
74
|
+
h[k.to_sym] = v
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'expected_revision')
|
|
78
|
+
self.expected_revision = attributes[:'expected_revision']
|
|
79
|
+
else
|
|
80
|
+
self.expected_revision = nil
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'expected_schedule_version')
|
|
84
|
+
self.expected_schedule_version = attributes[:'expected_schedule_version']
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'scheduled_for')
|
|
88
|
+
self.scheduled_for = attributes[:'scheduled_for']
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
93
|
+
# @return Array for valid properties with the reasons
|
|
94
|
+
def list_invalid_properties
|
|
95
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
96
|
+
invalid_properties = Array.new
|
|
97
|
+
if @expected_revision.nil?
|
|
98
|
+
invalid_properties.push('invalid value for "expected_revision", expected_revision cannot be nil.')
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if @expected_revision <= 0
|
|
102
|
+
invalid_properties.push('invalid value for "expected_revision", must be greater than 0.')
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if !@expected_schedule_version.nil? && @expected_schedule_version > 2147483647
|
|
106
|
+
invalid_properties.push('invalid value for "expected_schedule_version", must be smaller than or equal to 2147483647.')
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if !@expected_schedule_version.nil? && @expected_schedule_version < 0
|
|
110
|
+
invalid_properties.push('invalid value for "expected_schedule_version", must be greater than or equal to 0.')
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
invalid_properties
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Check to see if the all the properties in the model are valid
|
|
117
|
+
# @return true if the model is valid
|
|
118
|
+
def valid?
|
|
119
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
120
|
+
return false if @expected_revision.nil?
|
|
121
|
+
return false if @expected_revision <= 0
|
|
122
|
+
return false if !@expected_schedule_version.nil? && @expected_schedule_version > 2147483647
|
|
123
|
+
return false if !@expected_schedule_version.nil? && @expected_schedule_version < 0
|
|
124
|
+
true
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Custom attribute writer method with validation
|
|
128
|
+
# @param [Object] expected_revision Value to be assigned
|
|
129
|
+
def expected_revision=(expected_revision)
|
|
130
|
+
if expected_revision.nil?
|
|
131
|
+
fail ArgumentError, 'expected_revision cannot be nil'
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if expected_revision <= 0
|
|
135
|
+
fail ArgumentError, 'invalid value for "expected_revision", must be greater than 0.'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
@expected_revision = expected_revision
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Custom attribute writer method with validation
|
|
142
|
+
# @param [Object] expected_schedule_version Value to be assigned
|
|
143
|
+
def expected_schedule_version=(expected_schedule_version)
|
|
144
|
+
if expected_schedule_version.nil?
|
|
145
|
+
fail ArgumentError, 'expected_schedule_version cannot be nil'
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if expected_schedule_version > 2147483647
|
|
149
|
+
fail ArgumentError, 'invalid value for "expected_schedule_version", must be smaller than or equal to 2147483647.'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if expected_schedule_version < 0
|
|
153
|
+
fail ArgumentError, 'invalid value for "expected_schedule_version", must be greater than or equal to 0.'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@expected_schedule_version = expected_schedule_version
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Checks equality by comparing each attribute.
|
|
160
|
+
# @param [Object] Object to be compared
|
|
161
|
+
def ==(o)
|
|
162
|
+
return true if self.equal?(o)
|
|
163
|
+
self.class == o.class &&
|
|
164
|
+
expected_revision == o.expected_revision &&
|
|
165
|
+
expected_schedule_version == o.expected_schedule_version &&
|
|
166
|
+
scheduled_for == o.scheduled_for
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# @see the `==` method
|
|
170
|
+
# @param [Object] Object to be compared
|
|
171
|
+
def eql?(o)
|
|
172
|
+
self == o
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Calculates hash code according to all attributes.
|
|
176
|
+
# @return [Integer] Hash code
|
|
177
|
+
def hash
|
|
178
|
+
[expected_revision, expected_schedule_version, scheduled_for].hash
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Builds the object from hash
|
|
182
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
183
|
+
# @return [Object] Returns the model itself
|
|
184
|
+
def self.build_from_hash(attributes)
|
|
185
|
+
return nil unless attributes.is_a?(Hash)
|
|
186
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
187
|
+
transformed_hash = {}
|
|
188
|
+
openapi_types.each_pair do |key, type|
|
|
189
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
190
|
+
transformed_hash["#{key}"] = nil
|
|
191
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
192
|
+
# check to ensure the input is an array given that the attribute
|
|
193
|
+
# is documented as an array but the input is not
|
|
194
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
195
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
196
|
+
end
|
|
197
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
198
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
new(transformed_hash)
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Returns the object in the form of hash
|
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
|
206
|
+
def to_hash
|
|
207
|
+
hash = {}
|
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
209
|
+
value = self.send(attr)
|
|
210
|
+
if value.nil?
|
|
211
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
212
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
hash[param] = _to_hash(value)
|
|
216
|
+
end
|
|
217
|
+
hash
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Qubrics API
|
|
3
|
+
|
|
4
|
+
#Programmatic access to your Qubrics email infrastructure.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Qubrics::Mailbox::Generated
|
|
17
|
+
class SendMailboxMessageBody < ApiModelBase
|
|
18
|
+
# Attachments to send with the message.
|
|
19
|
+
attr_accessor :attachments
|
|
20
|
+
|
|
21
|
+
# Hidden copied recipients.
|
|
22
|
+
attr_accessor :bcc
|
|
23
|
+
|
|
24
|
+
# Visible copied recipients.
|
|
25
|
+
attr_accessor :cc
|
|
26
|
+
|
|
27
|
+
# Custom X-* headers to include. Mailbox writes reject X-SES-TENANT, X-SES-CONFIGURATION-SET and X-SES-MESSAGE-TAGS case-insensitively.
|
|
28
|
+
attr_accessor :custom_headers
|
|
29
|
+
|
|
30
|
+
# Sender address. Defaults to mailbox identity.
|
|
31
|
+
attr_accessor :from
|
|
32
|
+
|
|
33
|
+
# HTML body.
|
|
34
|
+
attr_accessor :html_body
|
|
35
|
+
|
|
36
|
+
# Reply-To recipients.
|
|
37
|
+
attr_accessor :reply_to
|
|
38
|
+
|
|
39
|
+
# Subject line; defaults to empty.
|
|
40
|
+
attr_accessor :subject
|
|
41
|
+
|
|
42
|
+
# Plain text body.
|
|
43
|
+
attr_accessor :text_body
|
|
44
|
+
|
|
45
|
+
# Primary recipients. Supply 1 to 50 recipients in total across To, Cc and Bcc.
|
|
46
|
+
attr_accessor :to
|
|
47
|
+
|
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
49
|
+
def self.attribute_map
|
|
50
|
+
{
|
|
51
|
+
:'attachments' => :'attachments',
|
|
52
|
+
:'bcc' => :'bcc',
|
|
53
|
+
:'cc' => :'cc',
|
|
54
|
+
:'custom_headers' => :'custom_headers',
|
|
55
|
+
:'from' => :'from',
|
|
56
|
+
:'html_body' => :'html_body',
|
|
57
|
+
:'reply_to' => :'reply_to',
|
|
58
|
+
:'subject' => :'subject',
|
|
59
|
+
:'text_body' => :'text_body',
|
|
60
|
+
:'to' => :'to'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns attribute mapping this model knows about
|
|
65
|
+
def self.acceptable_attribute_map
|
|
66
|
+
attribute_map
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Returns all the JSON keys this model knows about
|
|
70
|
+
def self.acceptable_attributes
|
|
71
|
+
acceptable_attribute_map.values
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Attribute type mapping.
|
|
75
|
+
def self.openapi_types
|
|
76
|
+
{
|
|
77
|
+
:'attachments' => :'Array<SendMailboxMessageBodyAttachmentsInner>',
|
|
78
|
+
:'bcc' => :'Array<MailboxAddress>',
|
|
79
|
+
:'cc' => :'Array<MailboxAddress>',
|
|
80
|
+
:'custom_headers' => :'Hash<String, String>',
|
|
81
|
+
:'from' => :'MailboxAddress',
|
|
82
|
+
:'html_body' => :'String',
|
|
83
|
+
:'reply_to' => :'Array<MailboxAddress>',
|
|
84
|
+
:'subject' => :'String',
|
|
85
|
+
:'text_body' => :'String',
|
|
86
|
+
:'to' => :'Array<MailboxAddress>'
|
|
87
|
+
}
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# List of attributes with nullable: true
|
|
91
|
+
def self.openapi_nullable
|
|
92
|
+
Set.new([
|
|
93
|
+
])
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Initializes the object
|
|
97
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
98
|
+
def initialize(attributes = {})
|
|
99
|
+
if (!attributes.is_a?(Hash))
|
|
100
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Qubrics::Mailbox::Generated::SendMailboxMessageBody` initialize method"
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
104
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
105
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
106
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
107
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Qubrics::Mailbox::Generated::SendMailboxMessageBody`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
108
|
+
end
|
|
109
|
+
h[k.to_sym] = v
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'attachments')
|
|
113
|
+
if (value = attributes[:'attachments']).is_a?(Array)
|
|
114
|
+
self.attachments = value
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'bcc')
|
|
119
|
+
if (value = attributes[:'bcc']).is_a?(Array)
|
|
120
|
+
self.bcc = value
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'cc')
|
|
125
|
+
if (value = attributes[:'cc']).is_a?(Array)
|
|
126
|
+
self.cc = value
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'custom_headers')
|
|
131
|
+
if (value = attributes[:'custom_headers']).is_a?(Hash)
|
|
132
|
+
self.custom_headers = value
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'from')
|
|
137
|
+
self.from = attributes[:'from']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'html_body')
|
|
141
|
+
self.html_body = attributes[:'html_body']
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'reply_to')
|
|
145
|
+
if (value = attributes[:'reply_to']).is_a?(Array)
|
|
146
|
+
self.reply_to = value
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'subject')
|
|
151
|
+
self.subject = attributes[:'subject']
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'text_body')
|
|
155
|
+
self.text_body = attributes[:'text_body']
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'to')
|
|
159
|
+
if (value = attributes[:'to']).is_a?(Array)
|
|
160
|
+
self.to = value
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
166
|
+
# @return Array for valid properties with the reasons
|
|
167
|
+
def list_invalid_properties
|
|
168
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
169
|
+
invalid_properties = Array.new
|
|
170
|
+
if !@bcc.nil? && @bcc.length > 50
|
|
171
|
+
invalid_properties.push('invalid value for "bcc", number of items must be less than or equal to 50.')
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if !@cc.nil? && @cc.length > 50
|
|
175
|
+
invalid_properties.push('invalid value for "cc", number of items must be less than or equal to 50.')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if !@subject.nil? && @subject.to_s.length > 998
|
|
179
|
+
invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 998.')
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if !@to.nil? && @to.length > 50
|
|
183
|
+
invalid_properties.push('invalid value for "to", number of items must be less than or equal to 50.')
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
invalid_properties
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Check to see if the all the properties in the model are valid
|
|
190
|
+
# @return true if the model is valid
|
|
191
|
+
def valid?
|
|
192
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
193
|
+
return false if !@bcc.nil? && @bcc.length > 50
|
|
194
|
+
return false if !@cc.nil? && @cc.length > 50
|
|
195
|
+
return false if !@subject.nil? && @subject.to_s.length > 998
|
|
196
|
+
return false if !@to.nil? && @to.length > 50
|
|
197
|
+
true
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Custom attribute writer method with validation
|
|
201
|
+
# @param [Object] bcc Value to be assigned
|
|
202
|
+
def bcc=(bcc)
|
|
203
|
+
if bcc.nil?
|
|
204
|
+
fail ArgumentError, 'bcc cannot be nil'
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if bcc.length > 50
|
|
208
|
+
fail ArgumentError, 'invalid value for "bcc", number of items must be less than or equal to 50.'
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
@bcc = bcc
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Custom attribute writer method with validation
|
|
215
|
+
# @param [Object] cc Value to be assigned
|
|
216
|
+
def cc=(cc)
|
|
217
|
+
if cc.nil?
|
|
218
|
+
fail ArgumentError, 'cc cannot be nil'
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if cc.length > 50
|
|
222
|
+
fail ArgumentError, 'invalid value for "cc", number of items must be less than or equal to 50.'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@cc = cc
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Custom attribute writer method with validation
|
|
229
|
+
# @param [Object] subject Value to be assigned
|
|
230
|
+
def subject=(subject)
|
|
231
|
+
if subject.nil?
|
|
232
|
+
fail ArgumentError, 'subject cannot be nil'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
if subject.to_s.length > 998
|
|
236
|
+
fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 998.'
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
@subject = subject
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Custom attribute writer method with validation
|
|
243
|
+
# @param [Object] to Value to be assigned
|
|
244
|
+
def to=(to)
|
|
245
|
+
if to.nil?
|
|
246
|
+
fail ArgumentError, 'to cannot be nil'
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
if to.length > 50
|
|
250
|
+
fail ArgumentError, 'invalid value for "to", number of items must be less than or equal to 50.'
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
@to = to
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Checks equality by comparing each attribute.
|
|
257
|
+
# @param [Object] Object to be compared
|
|
258
|
+
def ==(o)
|
|
259
|
+
return true if self.equal?(o)
|
|
260
|
+
self.class == o.class &&
|
|
261
|
+
attachments == o.attachments &&
|
|
262
|
+
bcc == o.bcc &&
|
|
263
|
+
cc == o.cc &&
|
|
264
|
+
custom_headers == o.custom_headers &&
|
|
265
|
+
from == o.from &&
|
|
266
|
+
html_body == o.html_body &&
|
|
267
|
+
reply_to == o.reply_to &&
|
|
268
|
+
subject == o.subject &&
|
|
269
|
+
text_body == o.text_body &&
|
|
270
|
+
to == o.to
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# @see the `==` method
|
|
274
|
+
# @param [Object] Object to be compared
|
|
275
|
+
def eql?(o)
|
|
276
|
+
self == o
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Calculates hash code according to all attributes.
|
|
280
|
+
# @return [Integer] Hash code
|
|
281
|
+
def hash
|
|
282
|
+
[attachments, bcc, cc, custom_headers, from, html_body, reply_to, subject, text_body, to].hash
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Builds the object from hash
|
|
286
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
287
|
+
# @return [Object] Returns the model itself
|
|
288
|
+
def self.build_from_hash(attributes)
|
|
289
|
+
return nil unless attributes.is_a?(Hash)
|
|
290
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
291
|
+
transformed_hash = {}
|
|
292
|
+
openapi_types.each_pair do |key, type|
|
|
293
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
294
|
+
transformed_hash["#{key}"] = nil
|
|
295
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
296
|
+
# check to ensure the input is an array given that the attribute
|
|
297
|
+
# is documented as an array but the input is not
|
|
298
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
299
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
300
|
+
end
|
|
301
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
302
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
new(transformed_hash)
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
# Returns the object in the form of hash
|
|
309
|
+
# @return [Hash] Returns the object in the form of hash
|
|
310
|
+
def to_hash
|
|
311
|
+
hash = {}
|
|
312
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
313
|
+
value = self.send(attr)
|
|
314
|
+
if value.nil?
|
|
315
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
316
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
hash[param] = _to_hash(value)
|
|
320
|
+
end
|
|
321
|
+
hash
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Qubrics API
|
|
3
|
+
|
|
4
|
+
#Programmatic access to your Qubrics email infrastructure.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Qubrics::Mailbox::Generated
|
|
17
|
+
module SendMailboxMessageBodyAttachmentsInner
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in anyOf (OpenAPI v3)
|
|
20
|
+
def openapi_any_of
|
|
21
|
+
[
|
|
22
|
+
:'SendMailboxMessageBodyAttachmentsInnerAnyOf',
|
|
23
|
+
:'SendMailboxMessageBodyAttachmentsInnerAnyOf1'
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object
|
|
28
|
+
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
29
|
+
# @return [Object] Returns the model or the data itself
|
|
30
|
+
def build(data)
|
|
31
|
+
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
32
|
+
# Note:
|
|
33
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
34
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
35
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
36
|
+
# - TODO: logging when debugging is set.
|
|
37
|
+
openapi_any_of.each do |klass|
|
|
38
|
+
begin
|
|
39
|
+
next if klass == :AnyType # "nullable: true"
|
|
40
|
+
return find_and_cast_into_type(klass, data)
|
|
41
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
openapi_any_of.include?(:AnyType) ? data : nil
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
51
|
+
|
|
52
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
53
|
+
def find_and_cast_into_type(klass, data)
|
|
54
|
+
return if data.nil?
|
|
55
|
+
|
|
56
|
+
case klass.to_s
|
|
57
|
+
when 'Boolean'
|
|
58
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
59
|
+
when 'Float'
|
|
60
|
+
return data if data.instance_of?(Float)
|
|
61
|
+
when 'Integer'
|
|
62
|
+
return data if data.instance_of?(Integer)
|
|
63
|
+
when 'Time'
|
|
64
|
+
return Time.parse(data)
|
|
65
|
+
when 'Date'
|
|
66
|
+
return Date.iso8601(data)
|
|
67
|
+
when 'String'
|
|
68
|
+
return data if data.instance_of?(String)
|
|
69
|
+
when 'Object' # "type: object"
|
|
70
|
+
return data if data.instance_of?(Hash)
|
|
71
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
72
|
+
if data.instance_of?(Array)
|
|
73
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
74
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
75
|
+
end
|
|
76
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
77
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
78
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
79
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
80
|
+
end
|
|
81
|
+
else # model
|
|
82
|
+
const = Qubrics::Mailbox::Generated.const_get(klass)
|
|
83
|
+
if const
|
|
84
|
+
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
85
|
+
model = const.build(data)
|
|
86
|
+
return model if model
|
|
87
|
+
else
|
|
88
|
+
# raise if data contains keys that are not known to the model
|
|
89
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
90
|
+
model = const.build_from_hash(data)
|
|
91
|
+
return model if model
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
raise # if no match by now, raise
|
|
97
|
+
rescue
|
|
98
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
end
|