lockally 0.2.0 → 0.3.1

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 (253) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +148 -119
  3. data/docs/AdminApi.md +33 -33
  4. data/docs/{V1AdminLoginPost200Response.md → AdminLogin200Response.md} +2 -2
  5. data/docs/{V1AdminLoginPostRequest.md → AdminLoginRequest.md} +2 -2
  6. data/docs/AdminsApi.md +76 -76
  7. data/docs/AgentSendResult.md +22 -0
  8. data/docs/AgentsApi.md +247 -247
  9. data/docs/AiApi.md +69 -69
  10. data/docs/AiConfig.md +26 -0
  11. data/docs/AiConfigUpdate.md +20 -0
  12. data/docs/AliasesApi.md +59 -59
  13. data/docs/Annotations.md +22 -0
  14. data/docs/ApiKeysApi.md +59 -59
  15. data/docs/Attachment.md +26 -0
  16. data/docs/Classification.md +24 -0
  17. data/docs/ContactLookup.md +26 -0
  18. data/docs/ContactLookupContact.md +28 -0
  19. data/docs/ContactLookupHistory.md +22 -0
  20. data/docs/CreateAiUnitsCheckout200Response.md +22 -0
  21. data/docs/{V1AliasesPostRequest.md → CreateAliasRequest.md} +2 -2
  22. data/docs/{V1ApiKeysPost201Response.md → CreateApiKey201Response.md} +2 -2
  23. data/docs/{V1ApiKeysPostRequest.md → CreateApiKeyRequest.md} +2 -2
  24. data/docs/{V1DomainsPostRequest.md → CreateDomainRequest.md} +2 -2
  25. data/docs/{V1MailboxesPostRequest.md → CreateMailboxRequest.md} +2 -2
  26. data/docs/{V1SuppressionsPostRequest.md → CreateSuppressionRequest.md} +2 -2
  27. data/docs/{V1WebhooksPostRequest.md → CreateWebhookRequest.md} +2 -2
  28. data/docs/DomainsApi.md +141 -141
  29. data/docs/Draft.md +44 -0
  30. data/docs/DraftList.md +18 -0
  31. data/docs/DraftResult.md +26 -0
  32. data/docs/DraftsApi.md +115 -115
  33. data/docs/{V1MailboxesEmailExportPost201Response.md → ExportMailbox201Response.md} +2 -2
  34. data/docs/{V1AdminMeGet200Response.md → GetCurrentAdmin200Response.md} +2 -2
  35. data/docs/{V1UsageGet200Response.md → GetUsage200Response.md} +2 -2
  36. data/docs/HealthApi.md +11 -11
  37. data/docs/{HealthzGet200Response.md → HealthCheck200Response.md} +2 -2
  38. data/docs/Inbox.md +24 -0
  39. data/docs/InboxList.md +18 -0
  40. data/docs/InjectionRisk.md +20 -0
  41. data/docs/{V1AdminsPostRequest.md → InviteAdminRequest.md} +2 -2
  42. data/docs/{V1AdminsGet200Response.md → ListAdmins200Response.md} +2 -2
  43. data/docs/{V1AliasesGet200Response.md → ListAliases200Response.md} +2 -2
  44. data/docs/{V1ApiKeysGet200Response.md → ListApiKeys200Response.md} +2 -2
  45. data/docs/{V1DomainsGet200Response.md → ListDomains200Response.md} +2 -2
  46. data/docs/{V1MailboxesGet200Response.md → ListMailboxes200Response.md} +2 -2
  47. data/docs/{V1MessagesGet200Response.md → ListMessages200Response.md} +2 -2
  48. data/docs/{V1SuppressionsGet200Response.md → ListSuppressions200Response.md} +2 -2
  49. data/docs/{V1TemplatesGet200Response.md → ListTemplates200Response.md} +2 -2
  50. data/docs/{V1VacationGet200Response.md → ListVacationResponders200Response.md} +2 -2
  51. data/docs/{V1WebhooksGet200Response.md → ListWebhooks200Response.md} +2 -2
  52. data/docs/MailboxGrant.md +20 -0
  53. data/docs/MailboxGrantList.md +18 -0
  54. data/docs/MailboxesApi.md +203 -203
  55. data/docs/MarkReadResult.md +18 -0
  56. data/docs/PolicyFlags.md +28 -0
  57. data/docs/SendApi.md +121 -121
  58. data/docs/{V1SendPost200Response.md → SendEmail200Response.md} +2 -2
  59. data/docs/{V1SendPost202Response.md → SendEmail202Response.md} +2 -2
  60. data/docs/{V1SendBatchPost200Response.md → SendEmailBatch200Response.md} +2 -2
  61. data/docs/{V1SendBatchPostRequest.md → SendEmailBatchRequest.md} +2 -2
  62. data/docs/{V1SendPostRequest.md → SendEmailRequest.md} +3 -3
  63. data/docs/{V1SendPostRequestAttachmentsInner.md → SendEmailRequestAttachmentsInner.md} +2 -2
  64. data/docs/SendMessage.md +1 -1
  65. data/docs/{V1MailboxesEmailVacationPutRequest.md → SetVacationResponderRequest.md} +2 -2
  66. data/docs/SignupApi.md +4 -4
  67. data/docs/SimulatedInbound.md +22 -0
  68. data/docs/{V1InboxesMailboxMessagesPostRequest.md → StartConversationRequest.md} +2 -2
  69. data/docs/SuppressionsApi.md +75 -75
  70. data/docs/TemplatesApi.md +67 -67
  71. data/docs/TenantApi.md +20 -20
  72. data/docs/TestApi.md +11 -11
  73. data/docs/Thread.md +22 -0
  74. data/docs/ThreadClassification.md +22 -0
  75. data/docs/ThreadList.md +20 -0
  76. data/docs/ThreadMessage.md +40 -0
  77. data/docs/ThreadMessageBody.md +42 -0
  78. data/docs/ThreadMessageBodyAllOfBody.md +22 -0
  79. data/docs/ThreadSummary.md +28 -0
  80. data/docs/{V1AdminsIdPatchRequest.md → UpdateAdminRequest.md} +2 -2
  81. data/docs/{V1MailboxesEmailPatchRequest.md → UpdateMailboxRequest.md} +2 -2
  82. data/docs/{V1WebhooksIdPatchRequest.md → UpdateWebhookRequest.md} +2 -2
  83. data/docs/WebhooksApi.md +63 -63
  84. data/docs/Whoami.md +24 -0
  85. data/lib/lockally/api/admin_api.rb +30 -30
  86. data/lib/lockally/api/admins_api.rb +89 -89
  87. data/lib/lockally/api/agents_api.rb +309 -309
  88. data/lib/lockally/api/ai_api.rb +69 -69
  89. data/lib/lockally/api/aliases_api.rb +64 -64
  90. data/lib/lockally/api/api_keys_api.rb +66 -66
  91. data/lib/lockally/api/domains_api.rb +147 -147
  92. data/lib/lockally/api/drafts_api.rb +140 -140
  93. data/lib/lockally/api/health_api.rb +9 -9
  94. data/lib/lockally/api/mailboxes_api.rb +233 -233
  95. data/lib/lockally/api/send_api.rb +146 -146
  96. data/lib/lockally/api/signup_api.rb +3 -3
  97. data/lib/lockally/api/suppressions_api.rb +87 -87
  98. data/lib/lockally/api/templates_api.rb +69 -69
  99. data/lib/lockally/api/tenant_api.rb +15 -15
  100. data/lib/lockally/api/test_api.rb +9 -9
  101. data/lib/lockally/api/webhooks_api.rb +73 -73
  102. data/lib/lockally/models/{v1_admin_login_post200_response.rb → admin_login200_response.rb} +3 -3
  103. data/lib/lockally/models/{v1_admin_login_post_request.rb → admin_login_request.rb} +3 -3
  104. data/lib/lockally/models/agent_send_result.rb +184 -0
  105. data/lib/lockally/models/ai_config.rb +242 -0
  106. data/lib/lockally/models/ai_config_update.rb +214 -0
  107. data/lib/lockally/models/annotations.rb +168 -0
  108. data/lib/lockally/models/attachment.rb +185 -0
  109. data/lib/lockally/models/classification.rb +211 -0
  110. data/lib/lockally/models/contact_lookup.rb +235 -0
  111. data/lib/lockally/models/contact_lookup_contact.rb +192 -0
  112. data/lib/lockally/models/contact_lookup_history.rb +166 -0
  113. data/lib/lockally/models/create_ai_units_checkout200_response.rb +199 -0
  114. data/lib/lockally/models/{v1_aliases_post_request.rb → create_alias_request.rb} +3 -3
  115. data/lib/lockally/models/{v1_api_keys_post201_response.rb → create_api_key201_response.rb} +3 -3
  116. data/lib/lockally/models/{v1_api_keys_post_request.rb → create_api_key_request.rb} +3 -3
  117. data/lib/lockally/models/{v1_domains_post_request.rb → create_domain_request.rb} +3 -3
  118. data/lib/lockally/models/{v1_mailboxes_post_request.rb → create_mailbox_request.rb} +3 -3
  119. data/lib/lockally/models/{v1_suppressions_post_request.rb → create_suppression_request.rb} +3 -3
  120. data/lib/lockally/models/{v1_webhooks_post_request.rb → create_webhook_request.rb} +3 -3
  121. data/lib/lockally/models/draft.rb +411 -0
  122. data/lib/lockally/models/draft_list.rb +166 -0
  123. data/lib/lockally/models/draft_result.rb +258 -0
  124. data/lib/lockally/models/{v1_mailboxes_email_export_post201_response.rb → export_mailbox201_response.rb} +3 -3
  125. data/lib/lockally/models/{v1_admin_me_get200_response.rb → get_current_admin200_response.rb} +3 -3
  126. data/lib/lockally/models/{v1_usage_get200_response.rb → get_usage200_response.rb} +3 -3
  127. data/lib/lockally/models/{healthz_get200_response.rb → health_check200_response.rb} +3 -3
  128. data/lib/lockally/models/inbox.rb +225 -0
  129. data/lib/lockally/models/inbox_list.rb +166 -0
  130. data/lib/lockally/models/injection_risk.rb +159 -0
  131. data/lib/lockally/models/{v1_admins_post_request.rb → invite_admin_request.rb} +3 -3
  132. data/lib/lockally/models/list_admins200_response.rb +166 -0
  133. data/lib/lockally/models/{v1_aliases_get200_response.rb → list_aliases200_response.rb} +3 -3
  134. data/lib/lockally/models/{v1_admins_get200_response.rb → list_api_keys200_response.rb} +4 -4
  135. data/lib/lockally/models/{v1_domains_get200_response.rb → list_domains200_response.rb} +3 -3
  136. data/lib/lockally/models/{v1_mailboxes_get200_response.rb → list_mailboxes200_response.rb} +3 -3
  137. data/lib/lockally/models/{v1_messages_get200_response.rb → list_messages200_response.rb} +3 -3
  138. data/lib/lockally/models/{v1_suppressions_get200_response.rb → list_suppressions200_response.rb} +3 -3
  139. data/lib/lockally/models/{v1_send_batch_post200_response.rb → list_templates200_response.rb} +4 -4
  140. data/lib/lockally/models/{v1_vacation_get200_response.rb → list_vacation_responders200_response.rb} +3 -3
  141. data/lib/lockally/models/{v1_api_keys_get200_response.rb → list_webhooks200_response.rb} +4 -4
  142. data/lib/lockally/models/mailbox_grant.rb +156 -0
  143. data/lib/lockally/models/mailbox_grant_list.rb +166 -0
  144. data/lib/lockally/models/mark_read_result.rb +147 -0
  145. data/lib/lockally/models/policy_flags.rb +197 -0
  146. data/lib/lockally/models/{v1_send_post200_response.rb → send_email200_response.rb} +3 -3
  147. data/lib/lockally/models/{v1_send_post202_response.rb → send_email202_response.rb} +3 -3
  148. data/lib/lockally/models/{v1_templates_get200_response.rb → send_email_batch200_response.rb} +4 -4
  149. data/lib/lockally/models/{v1_send_batch_post_request.rb → send_email_batch_request.rb} +3 -3
  150. data/lib/lockally/models/{v1_send_post_request.rb → send_email_request.rb} +4 -4
  151. data/lib/lockally/models/{v1_send_post_request_attachments_inner.rb → send_email_request_attachments_inner.rb} +3 -3
  152. data/lib/lockally/models/send_message.rb +1 -1
  153. data/lib/lockally/models/{v1_mailboxes_email_vacation_put_request.rb → set_vacation_responder_request.rb} +3 -3
  154. data/lib/lockally/models/simulated_inbound.rb +165 -0
  155. data/lib/lockally/models/{v1_inboxes_mailbox_messages_post_request.rb → start_conversation_request.rb} +3 -3
  156. data/lib/lockally/models/thread.rb +219 -0
  157. data/lib/lockally/models/thread_classification.rb +183 -0
  158. data/lib/lockally/models/thread_list.rb +192 -0
  159. data/lib/lockally/models/thread_message.rb +394 -0
  160. data/lib/lockally/models/thread_message_body.rb +410 -0
  161. data/lib/lockally/models/thread_message_body_all_of_body.rb +165 -0
  162. data/lib/lockally/models/thread_summary.rb +280 -0
  163. data/lib/lockally/models/{v1_admins_id_patch_request.rb → update_admin_request.rb} +3 -3
  164. data/lib/lockally/models/{v1_mailboxes_email_patch_request.rb → update_mailbox_request.rb} +3 -3
  165. data/lib/lockally/models/{v1_webhooks_id_patch_request.rb → update_webhook_request.rb} +3 -3
  166. data/lib/lockally/models/whoami.rb +177 -0
  167. data/lib/lockally/version.rb +1 -1
  168. data/lib/lockally.rb +64 -35
  169. data/spec/api/admin_api_spec.rb +9 -9
  170. data/spec/api/admins_api_spec.rb +22 -22
  171. data/spec/api/agents_api_spec.rb +78 -78
  172. data/spec/api/ai_api_spec.rb +22 -22
  173. data/spec/api/aliases_api_spec.rb +16 -16
  174. data/spec/api/api_keys_api_spec.rb +17 -17
  175. data/spec/api/domains_api_spec.rb +42 -42
  176. data/spec/api/drafts_api_spec.rb +38 -38
  177. data/spec/api/health_api_spec.rb +3 -3
  178. data/spec/api/mailboxes_api_spec.rb +61 -61
  179. data/spec/api/send_api_spec.rb +35 -35
  180. data/spec/api/signup_api_spec.rb +1 -1
  181. data/spec/api/suppressions_api_spec.rb +18 -18
  182. data/spec/api/templates_api_spec.rb +17 -17
  183. data/spec/api/tenant_api_spec.rb +5 -5
  184. data/spec/api/test_api_spec.rb +3 -3
  185. data/spec/api/webhooks_api_spec.rb +19 -19
  186. data/spec/models/{v1_admin_login_post200_response_spec.rb → admin_login200_response_spec.rb} +6 -6
  187. data/spec/models/{v1_admin_login_post_request_spec.rb → admin_login_request_spec.rb} +6 -6
  188. data/spec/models/agent_send_result_spec.rb +48 -0
  189. data/spec/models/ai_config_spec.rb +64 -0
  190. data/spec/models/ai_config_update_spec.rb +46 -0
  191. data/spec/models/annotations_spec.rb +48 -0
  192. data/spec/models/attachment_spec.rb +60 -0
  193. data/spec/models/classification_spec.rb +58 -0
  194. data/spec/models/contact_lookup_contact_spec.rb +66 -0
  195. data/spec/models/contact_lookup_history_spec.rb +48 -0
  196. data/spec/models/contact_lookup_spec.rb +60 -0
  197. data/spec/models/create_ai_units_checkout200_response_spec.rb +48 -0
  198. data/spec/models/{v1_aliases_post_request_spec.rb → create_alias_request_spec.rb} +6 -6
  199. data/spec/models/{v1_api_keys_post201_response_spec.rb → create_api_key201_response_spec.rb} +6 -6
  200. data/spec/models/{v1_api_keys_post_request_spec.rb → create_api_key_request_spec.rb} +6 -6
  201. data/spec/models/{v1_domains_post_request_spec.rb → create_domain_request_spec.rb} +6 -6
  202. data/spec/models/{v1_mailboxes_post_request_spec.rb → create_mailbox_request_spec.rb} +6 -6
  203. data/spec/models/{v1_suppressions_post_request_spec.rb → create_suppression_request_spec.rb} +6 -6
  204. data/spec/models/{v1_webhooks_post_request_spec.rb → create_webhook_request_spec.rb} +6 -6
  205. data/spec/models/draft_list_spec.rb +36 -0
  206. data/spec/models/draft_result_spec.rb +64 -0
  207. data/spec/models/draft_spec.rb +118 -0
  208. data/spec/models/{v1_mailboxes_email_export_post201_response_spec.rb → export_mailbox201_response_spec.rb} +6 -6
  209. data/spec/models/{v1_admin_me_get200_response_spec.rb → get_current_admin200_response_spec.rb} +6 -6
  210. data/spec/models/{v1_usage_get200_response_spec.rb → get_usage200_response_spec.rb} +6 -6
  211. data/spec/models/{healthz_get200_response_spec.rb → health_check200_response_spec.rb} +6 -6
  212. data/spec/models/inbox_list_spec.rb +36 -0
  213. data/spec/models/inbox_spec.rb +54 -0
  214. data/spec/models/injection_risk_spec.rb +42 -0
  215. data/spec/models/{v1_admins_post_request_spec.rb → invite_admin_request_spec.rb} +6 -6
  216. data/spec/models/{v1_aliases_get200_response_spec.rb → list_admins200_response_spec.rb} +6 -6
  217. data/spec/models/{v1_admins_get200_response_spec.rb → list_aliases200_response_spec.rb} +6 -6
  218. data/spec/models/{v1_api_keys_get200_response_spec.rb → list_api_keys200_response_spec.rb} +6 -6
  219. data/spec/models/list_domains200_response_spec.rb +36 -0
  220. data/spec/models/{v1_mailboxes_get200_response_spec.rb → list_mailboxes200_response_spec.rb} +6 -6
  221. data/spec/models/{v1_messages_get200_response_spec.rb → list_messages200_response_spec.rb} +6 -6
  222. data/spec/models/{v1_suppressions_get200_response_spec.rb → list_suppressions200_response_spec.rb} +6 -6
  223. data/spec/models/{v1_vacation_get200_response_spec.rb → list_templates200_response_spec.rb} +6 -6
  224. data/spec/models/list_vacation_responders200_response_spec.rb +36 -0
  225. data/spec/models/{v1_domains_get200_response_spec.rb → list_webhooks200_response_spec.rb} +6 -6
  226. data/spec/models/mailbox_grant_list_spec.rb +36 -0
  227. data/spec/models/mailbox_grant_spec.rb +42 -0
  228. data/spec/models/mark_read_result_spec.rb +36 -0
  229. data/spec/models/policy_flags_spec.rb +66 -0
  230. data/spec/models/{v1_send_post200_response_spec.rb → send_email200_response_spec.rb} +6 -6
  231. data/spec/models/{v1_send_post202_response_spec.rb → send_email202_response_spec.rb} +6 -6
  232. data/spec/models/{v1_templates_get200_response_spec.rb → send_email_batch200_response_spec.rb} +6 -6
  233. data/spec/models/{v1_send_batch_post_request_spec.rb → send_email_batch_request_spec.rb} +6 -6
  234. data/spec/models/{v1_send_post_request_attachments_inner_spec.rb → send_email_request_attachments_inner_spec.rb} +6 -6
  235. data/spec/models/{v1_send_post_request_spec.rb → send_email_request_spec.rb} +6 -6
  236. data/spec/models/{v1_mailboxes_email_vacation_put_request_spec.rb → set_vacation_responder_request_spec.rb} +6 -6
  237. data/spec/models/simulated_inbound_spec.rb +48 -0
  238. data/spec/models/{v1_inboxes_mailbox_messages_post_request_spec.rb → start_conversation_request_spec.rb} +6 -6
  239. data/spec/models/thread_classification_spec.rb +48 -0
  240. data/spec/models/thread_list_spec.rb +42 -0
  241. data/spec/models/thread_message_body_all_of_body_spec.rb +48 -0
  242. data/spec/models/thread_message_body_spec.rb +112 -0
  243. data/spec/models/thread_message_spec.rb +106 -0
  244. data/spec/models/thread_spec.rb +48 -0
  245. data/spec/models/thread_summary_spec.rb +70 -0
  246. data/spec/models/{v1_admins_id_patch_request_spec.rb → update_admin_request_spec.rb} +6 -6
  247. data/spec/models/{v1_mailboxes_email_patch_request_spec.rb → update_mailbox_request_spec.rb} +6 -6
  248. data/spec/models/{v1_webhooks_id_patch_request_spec.rb → update_webhook_request_spec.rb} +6 -6
  249. data/spec/models/whoami_spec.rb +54 -0
  250. metadata +258 -142
  251. data/lib/lockally/models/v1_webhooks_get200_response.rb +0 -166
  252. data/spec/models/v1_send_batch_post200_response_spec.rb +0 -36
  253. data/spec/models/v1_webhooks_get200_response_spec.rb +0 -36
@@ -0,0 +1,394 @@
1
+ =begin
2
+ #lockally control plane
3
+
4
+ #The lockally control plane lets integrators and direct customers manage everything except actual mail data flow (which uses standard JMAP / IMAP / SMTP-submission against the data plane endpoints). **Authentication.** All `/v1/*` endpoints require a Bearer API key in the `Authorization` header. Keys are formatted `lk_live_<8-char-prefix>_<32-char-secret>`, or `lk_test_<...>` for a test key. Create keys in the dashboard, or with `POST /v1/api-keys` using a key that holds `tenant:admin`. The key's plan is checked on every request, so a key stops working if the account moves to a plan without API access, and works again if it moves back. **Errors.** Failures return [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) `application/problem+json` documents. **Scopes.** Each endpoint requires a specific scope on the presented key. Insufficient scope returns `403` with the required scope name in `detail`.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+ Contact: support@lockally.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Lockally
17
+ class ThreadMessage < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :direction
21
+
22
+ # The Internet Message-ID
23
+ attr_accessor :rfc_message_id
24
+
25
+ attr_accessor :in_reply_to
26
+
27
+ attr_accessor :subject
28
+
29
+ attr_accessor :from
30
+
31
+ attr_accessor :to
32
+
33
+ attr_accessor :snippet
34
+
35
+ attr_accessor :has_attachments
36
+
37
+ attr_accessor :attachments
38
+
39
+ attr_accessor :annotations
40
+
41
+ attr_accessor :received_at
42
+
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
59
+
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'id' => :'id',
69
+ :'direction' => :'direction',
70
+ :'rfc_message_id' => :'rfc_message_id',
71
+ :'in_reply_to' => :'in_reply_to',
72
+ :'subject' => :'subject',
73
+ :'from' => :'from',
74
+ :'to' => :'to',
75
+ :'snippet' => :'snippet',
76
+ :'has_attachments' => :'has_attachments',
77
+ :'attachments' => :'attachments',
78
+ :'annotations' => :'annotations',
79
+ :'received_at' => :'received_at'
80
+ }
81
+ end
82
+
83
+ # Returns attribute mapping this model knows about
84
+ def self.acceptable_attribute_map
85
+ attribute_map
86
+ end
87
+
88
+ # Returns all the JSON keys this model knows about
89
+ def self.acceptable_attributes
90
+ acceptable_attribute_map.values
91
+ end
92
+
93
+ # Attribute type mapping.
94
+ def self.openapi_types
95
+ {
96
+ :'id' => :'String',
97
+ :'direction' => :'String',
98
+ :'rfc_message_id' => :'String',
99
+ :'in_reply_to' => :'String',
100
+ :'subject' => :'String',
101
+ :'from' => :'String',
102
+ :'to' => :'Array<String>',
103
+ :'snippet' => :'String',
104
+ :'has_attachments' => :'Boolean',
105
+ :'attachments' => :'Array<Attachment>',
106
+ :'annotations' => :'Annotations',
107
+ :'received_at' => :'Time'
108
+ }
109
+ end
110
+
111
+ # List of attributes with nullable: true
112
+ def self.openapi_nullable
113
+ Set.new([
114
+ ])
115
+ end
116
+
117
+ # Initializes the object
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ def initialize(attributes = {})
120
+ if (!attributes.is_a?(Hash))
121
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::ThreadMessage` initialize method"
122
+ end
123
+
124
+ # check to see if the attribute exists and convert string to symbol for hash key
125
+ acceptable_attribute_map = self.class.acceptable_attribute_map
126
+ attributes = attributes.each_with_object({}) { |(k, v), h|
127
+ if (!acceptable_attribute_map.key?(k.to_sym))
128
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::ThreadMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
129
+ end
130
+ h[k.to_sym] = v
131
+ }
132
+
133
+ if attributes.key?(:'id')
134
+ self.id = attributes[:'id']
135
+ else
136
+ self.id = nil
137
+ end
138
+
139
+ if attributes.key?(:'direction')
140
+ self.direction = attributes[:'direction']
141
+ else
142
+ self.direction = nil
143
+ end
144
+
145
+ if attributes.key?(:'rfc_message_id')
146
+ self.rfc_message_id = attributes[:'rfc_message_id']
147
+ else
148
+ self.rfc_message_id = nil
149
+ end
150
+
151
+ if attributes.key?(:'in_reply_to')
152
+ self.in_reply_to = attributes[:'in_reply_to']
153
+ end
154
+
155
+ if attributes.key?(:'subject')
156
+ self.subject = attributes[:'subject']
157
+ end
158
+
159
+ if attributes.key?(:'from')
160
+ self.from = attributes[:'from']
161
+ else
162
+ self.from = nil
163
+ end
164
+
165
+ if attributes.key?(:'to')
166
+ if (value = attributes[:'to']).is_a?(Array)
167
+ self.to = value
168
+ end
169
+ else
170
+ self.to = nil
171
+ end
172
+
173
+ if attributes.key?(:'snippet')
174
+ self.snippet = attributes[:'snippet']
175
+ end
176
+
177
+ if attributes.key?(:'has_attachments')
178
+ self.has_attachments = attributes[:'has_attachments']
179
+ else
180
+ self.has_attachments = nil
181
+ end
182
+
183
+ if attributes.key?(:'attachments')
184
+ if (value = attributes[:'attachments']).is_a?(Array)
185
+ self.attachments = value
186
+ end
187
+ end
188
+
189
+ if attributes.key?(:'annotations')
190
+ self.annotations = attributes[:'annotations']
191
+ end
192
+
193
+ if attributes.key?(:'received_at')
194
+ self.received_at = attributes[:'received_at']
195
+ else
196
+ self.received_at = nil
197
+ end
198
+ end
199
+
200
+ # Show invalid properties with the reasons. Usually used together with valid?
201
+ # @return Array for valid properties with the reasons
202
+ def list_invalid_properties
203
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
204
+ invalid_properties = Array.new
205
+ if @id.nil?
206
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
207
+ end
208
+
209
+ if @direction.nil?
210
+ invalid_properties.push('invalid value for "direction", direction cannot be nil.')
211
+ end
212
+
213
+ if @rfc_message_id.nil?
214
+ invalid_properties.push('invalid value for "rfc_message_id", rfc_message_id cannot be nil.')
215
+ end
216
+
217
+ if @from.nil?
218
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
219
+ end
220
+
221
+ if @to.nil?
222
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
223
+ end
224
+
225
+ if @has_attachments.nil?
226
+ invalid_properties.push('invalid value for "has_attachments", has_attachments cannot be nil.')
227
+ end
228
+
229
+ if @received_at.nil?
230
+ invalid_properties.push('invalid value for "received_at", received_at cannot be nil.')
231
+ end
232
+
233
+ invalid_properties
234
+ end
235
+
236
+ # Check to see if the all the properties in the model are valid
237
+ # @return true if the model is valid
238
+ def valid?
239
+ warn '[DEPRECATED] the `valid?` method is obsolete'
240
+ return false if @id.nil?
241
+ return false if @direction.nil?
242
+ direction_validator = EnumAttributeValidator.new('String', ["inbound", "outbound"])
243
+ return false unless direction_validator.valid?(@direction)
244
+ return false if @rfc_message_id.nil?
245
+ return false if @from.nil?
246
+ return false if @to.nil?
247
+ return false if @has_attachments.nil?
248
+ return false if @received_at.nil?
249
+ true
250
+ end
251
+
252
+ # Custom attribute writer method with validation
253
+ # @param [Object] id Value to be assigned
254
+ def id=(id)
255
+ if id.nil?
256
+ fail ArgumentError, 'id cannot be nil'
257
+ end
258
+
259
+ @id = id
260
+ end
261
+
262
+ # Custom attribute writer method checking allowed values (enum).
263
+ # @param [Object] direction Object to be assigned
264
+ def direction=(direction)
265
+ validator = EnumAttributeValidator.new('String', ["inbound", "outbound"])
266
+ unless validator.valid?(direction)
267
+ fail ArgumentError, "invalid value for \"direction\", must be one of #{validator.allowable_values}."
268
+ end
269
+ @direction = direction
270
+ end
271
+
272
+ # Custom attribute writer method with validation
273
+ # @param [Object] rfc_message_id Value to be assigned
274
+ def rfc_message_id=(rfc_message_id)
275
+ if rfc_message_id.nil?
276
+ fail ArgumentError, 'rfc_message_id cannot be nil'
277
+ end
278
+
279
+ @rfc_message_id = rfc_message_id
280
+ end
281
+
282
+ # Custom attribute writer method with validation
283
+ # @param [Object] from Value to be assigned
284
+ def from=(from)
285
+ if from.nil?
286
+ fail ArgumentError, 'from cannot be nil'
287
+ end
288
+
289
+ @from = from
290
+ end
291
+
292
+ # Custom attribute writer method with validation
293
+ # @param [Object] to Value to be assigned
294
+ def to=(to)
295
+ if to.nil?
296
+ fail ArgumentError, 'to cannot be nil'
297
+ end
298
+
299
+ @to = to
300
+ end
301
+
302
+ # Custom attribute writer method with validation
303
+ # @param [Object] has_attachments Value to be assigned
304
+ def has_attachments=(has_attachments)
305
+ if has_attachments.nil?
306
+ fail ArgumentError, 'has_attachments cannot be nil'
307
+ end
308
+
309
+ @has_attachments = has_attachments
310
+ end
311
+
312
+ # Custom attribute writer method with validation
313
+ # @param [Object] received_at Value to be assigned
314
+ def received_at=(received_at)
315
+ if received_at.nil?
316
+ fail ArgumentError, 'received_at cannot be nil'
317
+ end
318
+
319
+ @received_at = received_at
320
+ end
321
+
322
+ # Checks equality by comparing each attribute.
323
+ # @param [Object] Object to be compared
324
+ def ==(o)
325
+ return true if self.equal?(o)
326
+ self.class == o.class &&
327
+ id == o.id &&
328
+ direction == o.direction &&
329
+ rfc_message_id == o.rfc_message_id &&
330
+ in_reply_to == o.in_reply_to &&
331
+ subject == o.subject &&
332
+ from == o.from &&
333
+ to == o.to &&
334
+ snippet == o.snippet &&
335
+ has_attachments == o.has_attachments &&
336
+ attachments == o.attachments &&
337
+ annotations == o.annotations &&
338
+ received_at == o.received_at
339
+ end
340
+
341
+ # @see the `==` method
342
+ # @param [Object] Object to be compared
343
+ def eql?(o)
344
+ self == o
345
+ end
346
+
347
+ # Calculates hash code according to all attributes.
348
+ # @return [Integer] Hash code
349
+ def hash
350
+ [id, direction, rfc_message_id, in_reply_to, subject, from, to, snippet, has_attachments, attachments, annotations, received_at].hash
351
+ end
352
+
353
+ # Builds the object from hash
354
+ # @param [Hash] attributes Model attributes in the form of hash
355
+ # @return [Object] Returns the model itself
356
+ def self.build_from_hash(attributes)
357
+ return nil unless attributes.is_a?(Hash)
358
+ attributes = attributes.transform_keys(&:to_sym)
359
+ transformed_hash = {}
360
+ openapi_types.each_pair do |key, type|
361
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
362
+ transformed_hash["#{key}"] = nil
363
+ elsif type =~ /\AArray<(.*)>/i
364
+ # check to ensure the input is an array given that the attribute
365
+ # is documented as an array but the input is not
366
+ if attributes[attribute_map[key]].is_a?(Array)
367
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
368
+ end
369
+ elsif !attributes[attribute_map[key]].nil?
370
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
371
+ end
372
+ end
373
+ new(transformed_hash)
374
+ end
375
+
376
+ # Returns the object in the form of hash
377
+ # @return [Hash] Returns the object in the form of hash
378
+ def to_hash
379
+ hash = {}
380
+ self.class.attribute_map.each_pair do |attr, param|
381
+ value = self.send(attr)
382
+ if value.nil?
383
+ is_nullable = self.class.openapi_nullable.include?(attr)
384
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
385
+ end
386
+
387
+ hash[param] = _to_hash(value)
388
+ end
389
+ hash
390
+ end
391
+
392
+ end
393
+
394
+ end