lockally 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +143 -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/ApiKeysApi.md +59 -59
  14. data/docs/ContactLookup.md +26 -0
  15. data/docs/ContactLookupContact.md +28 -0
  16. data/docs/ContactLookupHistory.md +22 -0
  17. data/docs/CreateAiUnitsCheckout200Response.md +22 -0
  18. data/docs/{V1AliasesPostRequest.md → CreateAliasRequest.md} +2 -2
  19. data/docs/{V1ApiKeysPost201Response.md → CreateApiKey201Response.md} +2 -2
  20. data/docs/{V1ApiKeysPostRequest.md → CreateApiKeyRequest.md} +2 -2
  21. data/docs/{V1DomainsPostRequest.md → CreateDomainRequest.md} +2 -2
  22. data/docs/{V1MailboxesPostRequest.md → CreateMailboxRequest.md} +2 -2
  23. data/docs/{V1SuppressionsPostRequest.md → CreateSuppressionRequest.md} +2 -2
  24. data/docs/{V1WebhooksPostRequest.md → CreateWebhookRequest.md} +2 -2
  25. data/docs/DomainsApi.md +141 -141
  26. data/docs/Draft.md +44 -0
  27. data/docs/DraftList.md +18 -0
  28. data/docs/DraftResult.md +26 -0
  29. data/docs/DraftsApi.md +115 -115
  30. data/docs/{V1MailboxesEmailExportPost201Response.md → ExportMailbox201Response.md} +2 -2
  31. data/docs/{V1AdminMeGet200Response.md → GetCurrentAdmin200Response.md} +2 -2
  32. data/docs/{V1UsageGet200Response.md → GetUsage200Response.md} +2 -2
  33. data/docs/HealthApi.md +11 -11
  34. data/docs/{HealthzGet200Response.md → HealthCheck200Response.md} +2 -2
  35. data/docs/Inbox.md +24 -0
  36. data/docs/InboxList.md +18 -0
  37. data/docs/{V1AdminsPostRequest.md → InviteAdminRequest.md} +2 -2
  38. data/docs/{V1AdminsGet200Response.md → ListAdmins200Response.md} +2 -2
  39. data/docs/{V1AliasesGet200Response.md → ListAliases200Response.md} +2 -2
  40. data/docs/{V1ApiKeysGet200Response.md → ListApiKeys200Response.md} +2 -2
  41. data/docs/{V1DomainsGet200Response.md → ListDomains200Response.md} +2 -2
  42. data/docs/{V1MailboxesGet200Response.md → ListMailboxes200Response.md} +2 -2
  43. data/docs/{V1MessagesGet200Response.md → ListMessages200Response.md} +2 -2
  44. data/docs/{V1SuppressionsGet200Response.md → ListSuppressions200Response.md} +2 -2
  45. data/docs/{V1TemplatesGet200Response.md → ListTemplates200Response.md} +2 -2
  46. data/docs/{V1VacationGet200Response.md → ListVacationResponders200Response.md} +2 -2
  47. data/docs/{V1WebhooksGet200Response.md → ListWebhooks200Response.md} +2 -2
  48. data/docs/MailboxGrant.md +20 -0
  49. data/docs/MailboxGrantList.md +18 -0
  50. data/docs/MailboxesApi.md +203 -203
  51. data/docs/MarkReadResult.md +18 -0
  52. data/docs/SendApi.md +121 -121
  53. data/docs/{V1SendPost200Response.md → SendEmail200Response.md} +2 -2
  54. data/docs/{V1SendPost202Response.md → SendEmail202Response.md} +2 -2
  55. data/docs/{V1SendBatchPost200Response.md → SendEmailBatch200Response.md} +2 -2
  56. data/docs/{V1SendBatchPostRequest.md → SendEmailBatchRequest.md} +2 -2
  57. data/docs/{V1SendPostRequest.md → SendEmailRequest.md} +3 -3
  58. data/docs/{V1SendPostRequestAttachmentsInner.md → SendEmailRequestAttachmentsInner.md} +2 -2
  59. data/docs/SendMessage.md +1 -1
  60. data/docs/{V1MailboxesEmailVacationPutRequest.md → SetVacationResponderRequest.md} +2 -2
  61. data/docs/SignupApi.md +4 -4
  62. data/docs/SimulatedInbound.md +22 -0
  63. data/docs/{V1InboxesMailboxMessagesPostRequest.md → StartConversationRequest.md} +2 -2
  64. data/docs/SuppressionsApi.md +75 -75
  65. data/docs/TemplatesApi.md +67 -67
  66. data/docs/TenantApi.md +20 -20
  67. data/docs/TestApi.md +11 -11
  68. data/docs/Thread.md +22 -0
  69. data/docs/ThreadClassification.md +22 -0
  70. data/docs/ThreadList.md +20 -0
  71. data/docs/ThreadMessage.md +40 -0
  72. data/docs/ThreadMessageBody.md +42 -0
  73. data/docs/ThreadMessageBodyAllOfBody.md +22 -0
  74. data/docs/ThreadSummary.md +28 -0
  75. data/docs/{V1AdminsIdPatchRequest.md → UpdateAdminRequest.md} +2 -2
  76. data/docs/{V1MailboxesEmailPatchRequest.md → UpdateMailboxRequest.md} +2 -2
  77. data/docs/{V1WebhooksIdPatchRequest.md → UpdateWebhookRequest.md} +2 -2
  78. data/docs/WebhooksApi.md +63 -63
  79. data/docs/Whoami.md +24 -0
  80. data/lib/lockally/api/admin_api.rb +30 -30
  81. data/lib/lockally/api/admins_api.rb +89 -89
  82. data/lib/lockally/api/agents_api.rb +309 -309
  83. data/lib/lockally/api/ai_api.rb +69 -69
  84. data/lib/lockally/api/aliases_api.rb +64 -64
  85. data/lib/lockally/api/api_keys_api.rb +66 -66
  86. data/lib/lockally/api/domains_api.rb +147 -147
  87. data/lib/lockally/api/drafts_api.rb +140 -140
  88. data/lib/lockally/api/health_api.rb +9 -9
  89. data/lib/lockally/api/mailboxes_api.rb +233 -233
  90. data/lib/lockally/api/send_api.rb +146 -146
  91. data/lib/lockally/api/signup_api.rb +3 -3
  92. data/lib/lockally/api/suppressions_api.rb +87 -87
  93. data/lib/lockally/api/templates_api.rb +69 -69
  94. data/lib/lockally/api/tenant_api.rb +15 -15
  95. data/lib/lockally/api/test_api.rb +9 -9
  96. data/lib/lockally/api/webhooks_api.rb +73 -73
  97. data/lib/lockally/models/{v1_admin_login_post200_response.rb → admin_login200_response.rb} +3 -3
  98. data/lib/lockally/models/{v1_admin_login_post_request.rb → admin_login_request.rb} +3 -3
  99. data/lib/lockally/models/agent_send_result.rb +184 -0
  100. data/lib/lockally/models/ai_config.rb +242 -0
  101. data/lib/lockally/models/ai_config_update.rb +214 -0
  102. data/lib/lockally/models/contact_lookup.rb +235 -0
  103. data/lib/lockally/models/contact_lookup_contact.rb +192 -0
  104. data/lib/lockally/models/contact_lookup_history.rb +166 -0
  105. data/lib/lockally/models/create_ai_units_checkout200_response.rb +199 -0
  106. data/lib/lockally/models/{v1_aliases_post_request.rb → create_alias_request.rb} +3 -3
  107. data/lib/lockally/models/{v1_api_keys_post201_response.rb → create_api_key201_response.rb} +3 -3
  108. data/lib/lockally/models/{v1_api_keys_post_request.rb → create_api_key_request.rb} +3 -3
  109. data/lib/lockally/models/{v1_domains_post_request.rb → create_domain_request.rb} +3 -3
  110. data/lib/lockally/models/{v1_mailboxes_post_request.rb → create_mailbox_request.rb} +3 -3
  111. data/lib/lockally/models/{v1_suppressions_post_request.rb → create_suppression_request.rb} +3 -3
  112. data/lib/lockally/models/{v1_webhooks_post_request.rb → create_webhook_request.rb} +3 -3
  113. data/lib/lockally/models/draft.rb +413 -0
  114. data/lib/lockally/models/draft_list.rb +166 -0
  115. data/lib/lockally/models/draft_result.rb +260 -0
  116. data/lib/lockally/models/{v1_mailboxes_email_export_post201_response.rb → export_mailbox201_response.rb} +3 -3
  117. data/lib/lockally/models/{v1_admin_me_get200_response.rb → get_current_admin200_response.rb} +3 -3
  118. data/lib/lockally/models/{v1_usage_get200_response.rb → get_usage200_response.rb} +3 -3
  119. data/lib/lockally/models/{healthz_get200_response.rb → health_check200_response.rb} +3 -3
  120. data/lib/lockally/models/inbox.rb +225 -0
  121. data/lib/lockally/models/inbox_list.rb +166 -0
  122. data/lib/lockally/models/{v1_admins_post_request.rb → invite_admin_request.rb} +3 -3
  123. data/lib/lockally/models/list_admins200_response.rb +166 -0
  124. data/lib/lockally/models/{v1_aliases_get200_response.rb → list_aliases200_response.rb} +3 -3
  125. data/lib/lockally/models/{v1_admins_get200_response.rb → list_api_keys200_response.rb} +4 -4
  126. data/lib/lockally/models/{v1_domains_get200_response.rb → list_domains200_response.rb} +3 -3
  127. data/lib/lockally/models/{v1_mailboxes_get200_response.rb → list_mailboxes200_response.rb} +3 -3
  128. data/lib/lockally/models/{v1_messages_get200_response.rb → list_messages200_response.rb} +3 -3
  129. data/lib/lockally/models/{v1_suppressions_get200_response.rb → list_suppressions200_response.rb} +3 -3
  130. data/lib/lockally/models/{v1_send_batch_post200_response.rb → list_templates200_response.rb} +4 -4
  131. data/lib/lockally/models/{v1_vacation_get200_response.rb → list_vacation_responders200_response.rb} +3 -3
  132. data/lib/lockally/models/{v1_api_keys_get200_response.rb → list_webhooks200_response.rb} +4 -4
  133. data/lib/lockally/models/mailbox_grant.rb +156 -0
  134. data/lib/lockally/models/mailbox_grant_list.rb +166 -0
  135. data/lib/lockally/models/mark_read_result.rb +147 -0
  136. data/lib/lockally/models/{v1_send_post200_response.rb → send_email200_response.rb} +3 -3
  137. data/lib/lockally/models/{v1_send_post202_response.rb → send_email202_response.rb} +3 -3
  138. data/lib/lockally/models/{v1_templates_get200_response.rb → send_email_batch200_response.rb} +4 -4
  139. data/lib/lockally/models/{v1_send_batch_post_request.rb → send_email_batch_request.rb} +3 -3
  140. data/lib/lockally/models/{v1_send_post_request.rb → send_email_request.rb} +4 -4
  141. data/lib/lockally/models/{v1_send_post_request_attachments_inner.rb → send_email_request_attachments_inner.rb} +3 -3
  142. data/lib/lockally/models/send_message.rb +1 -1
  143. data/lib/lockally/models/{v1_mailboxes_email_vacation_put_request.rb → set_vacation_responder_request.rb} +3 -3
  144. data/lib/lockally/models/simulated_inbound.rb +167 -0
  145. data/lib/lockally/models/{v1_inboxes_mailbox_messages_post_request.rb → start_conversation_request.rb} +3 -3
  146. data/lib/lockally/models/thread.rb +219 -0
  147. data/lib/lockally/models/thread_classification.rb +186 -0
  148. data/lib/lockally/models/thread_list.rb +192 -0
  149. data/lib/lockally/models/thread_message.rb +397 -0
  150. data/lib/lockally/models/thread_message_body.rb +413 -0
  151. data/lib/lockally/models/thread_message_body_all_of_body.rb +165 -0
  152. data/lib/lockally/models/thread_summary.rb +280 -0
  153. data/lib/lockally/models/{v1_admins_id_patch_request.rb → update_admin_request.rb} +3 -3
  154. data/lib/lockally/models/{v1_mailboxes_email_patch_request.rb → update_mailbox_request.rb} +3 -3
  155. data/lib/lockally/models/{v1_webhooks_id_patch_request.rb → update_webhook_request.rb} +3 -3
  156. data/lib/lockally/models/whoami.rb +177 -0
  157. data/lib/lockally/version.rb +1 -1
  158. data/lib/lockally.rb +59 -35
  159. data/spec/api/admin_api_spec.rb +9 -9
  160. data/spec/api/admins_api_spec.rb +22 -22
  161. data/spec/api/agents_api_spec.rb +78 -78
  162. data/spec/api/ai_api_spec.rb +22 -22
  163. data/spec/api/aliases_api_spec.rb +16 -16
  164. data/spec/api/api_keys_api_spec.rb +17 -17
  165. data/spec/api/domains_api_spec.rb +42 -42
  166. data/spec/api/drafts_api_spec.rb +38 -38
  167. data/spec/api/health_api_spec.rb +3 -3
  168. data/spec/api/mailboxes_api_spec.rb +61 -61
  169. data/spec/api/send_api_spec.rb +35 -35
  170. data/spec/api/signup_api_spec.rb +1 -1
  171. data/spec/api/suppressions_api_spec.rb +18 -18
  172. data/spec/api/templates_api_spec.rb +17 -17
  173. data/spec/api/tenant_api_spec.rb +5 -5
  174. data/spec/api/test_api_spec.rb +3 -3
  175. data/spec/api/webhooks_api_spec.rb +19 -19
  176. data/spec/models/{v1_admin_login_post200_response_spec.rb → admin_login200_response_spec.rb} +6 -6
  177. data/spec/models/{v1_admin_login_post_request_spec.rb → admin_login_request_spec.rb} +6 -6
  178. data/spec/models/agent_send_result_spec.rb +48 -0
  179. data/spec/models/ai_config_spec.rb +64 -0
  180. data/spec/models/ai_config_update_spec.rb +46 -0
  181. data/spec/models/contact_lookup_contact_spec.rb +66 -0
  182. data/spec/models/contact_lookup_history_spec.rb +48 -0
  183. data/spec/models/contact_lookup_spec.rb +60 -0
  184. data/spec/models/create_ai_units_checkout200_response_spec.rb +48 -0
  185. data/spec/models/{v1_aliases_post_request_spec.rb → create_alias_request_spec.rb} +6 -6
  186. data/spec/models/{v1_api_keys_post201_response_spec.rb → create_api_key201_response_spec.rb} +6 -6
  187. data/spec/models/{v1_api_keys_post_request_spec.rb → create_api_key_request_spec.rb} +6 -6
  188. data/spec/models/{v1_domains_post_request_spec.rb → create_domain_request_spec.rb} +6 -6
  189. data/spec/models/{v1_mailboxes_post_request_spec.rb → create_mailbox_request_spec.rb} +6 -6
  190. data/spec/models/{v1_suppressions_post_request_spec.rb → create_suppression_request_spec.rb} +6 -6
  191. data/spec/models/{v1_webhooks_post_request_spec.rb → create_webhook_request_spec.rb} +6 -6
  192. data/spec/models/draft_list_spec.rb +36 -0
  193. data/spec/models/draft_result_spec.rb +64 -0
  194. data/spec/models/draft_spec.rb +118 -0
  195. data/spec/models/{v1_mailboxes_email_export_post201_response_spec.rb → export_mailbox201_response_spec.rb} +6 -6
  196. data/spec/models/{v1_admin_me_get200_response_spec.rb → get_current_admin200_response_spec.rb} +6 -6
  197. data/spec/models/{v1_usage_get200_response_spec.rb → get_usage200_response_spec.rb} +6 -6
  198. data/spec/models/{healthz_get200_response_spec.rb → health_check200_response_spec.rb} +6 -6
  199. data/spec/models/inbox_list_spec.rb +36 -0
  200. data/spec/models/inbox_spec.rb +54 -0
  201. data/spec/models/{v1_admins_post_request_spec.rb → invite_admin_request_spec.rb} +6 -6
  202. data/spec/models/{v1_aliases_get200_response_spec.rb → list_admins200_response_spec.rb} +6 -6
  203. data/spec/models/{v1_admins_get200_response_spec.rb → list_aliases200_response_spec.rb} +6 -6
  204. data/spec/models/{v1_api_keys_get200_response_spec.rb → list_api_keys200_response_spec.rb} +6 -6
  205. data/spec/models/list_domains200_response_spec.rb +36 -0
  206. data/spec/models/{v1_mailboxes_get200_response_spec.rb → list_mailboxes200_response_spec.rb} +6 -6
  207. data/spec/models/{v1_messages_get200_response_spec.rb → list_messages200_response_spec.rb} +6 -6
  208. data/spec/models/{v1_suppressions_get200_response_spec.rb → list_suppressions200_response_spec.rb} +6 -6
  209. data/spec/models/{v1_vacation_get200_response_spec.rb → list_templates200_response_spec.rb} +6 -6
  210. data/spec/models/list_vacation_responders200_response_spec.rb +36 -0
  211. data/spec/models/{v1_domains_get200_response_spec.rb → list_webhooks200_response_spec.rb} +6 -6
  212. data/spec/models/mailbox_grant_list_spec.rb +36 -0
  213. data/spec/models/mailbox_grant_spec.rb +42 -0
  214. data/spec/models/mark_read_result_spec.rb +36 -0
  215. data/spec/models/{v1_send_post200_response_spec.rb → send_email200_response_spec.rb} +6 -6
  216. data/spec/models/{v1_send_post202_response_spec.rb → send_email202_response_spec.rb} +6 -6
  217. data/spec/models/{v1_templates_get200_response_spec.rb → send_email_batch200_response_spec.rb} +6 -6
  218. data/spec/models/{v1_send_batch_post_request_spec.rb → send_email_batch_request_spec.rb} +6 -6
  219. data/spec/models/{v1_send_post_request_attachments_inner_spec.rb → send_email_request_attachments_inner_spec.rb} +6 -6
  220. data/spec/models/{v1_send_post_request_spec.rb → send_email_request_spec.rb} +6 -6
  221. data/spec/models/{v1_mailboxes_email_vacation_put_request_spec.rb → set_vacation_responder_request_spec.rb} +6 -6
  222. data/spec/models/simulated_inbound_spec.rb +48 -0
  223. data/spec/models/{v1_inboxes_mailbox_messages_post_request_spec.rb → start_conversation_request_spec.rb} +6 -6
  224. data/spec/models/thread_classification_spec.rb +48 -0
  225. data/spec/models/thread_list_spec.rb +42 -0
  226. data/spec/models/thread_message_body_all_of_body_spec.rb +48 -0
  227. data/spec/models/thread_message_body_spec.rb +112 -0
  228. data/spec/models/thread_message_spec.rb +106 -0
  229. data/spec/models/thread_spec.rb +48 -0
  230. data/spec/models/thread_summary_spec.rb +70 -0
  231. data/spec/models/{v1_admins_id_patch_request_spec.rb → update_admin_request_spec.rb} +6 -6
  232. data/spec/models/{v1_mailboxes_email_patch_request_spec.rb → update_mailbox_request_spec.rb} +6 -6
  233. data/spec/models/{v1_webhooks_id_patch_request_spec.rb → update_webhook_request_spec.rb} +6 -6
  234. data/spec/models/whoami_spec.rb +54 -0
  235. metadata +238 -142
  236. data/lib/lockally/models/v1_webhooks_get200_response.rb +0 -166
  237. data/spec/models/v1_send_batch_post200_response_spec.rb +0 -36
  238. data/spec/models/v1_webhooks_get200_response_spec.rb +0 -36
@@ -0,0 +1,260 @@
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 DraftResult < ApiModelBase
18
+ attr_accessor :draft_id
19
+
20
+ attr_accessor :status
21
+
22
+ attr_accessor :policy_flags
23
+
24
+ attr_accessor :thread_id
25
+
26
+ attr_accessor :sent
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'draft_id' => :'draft_id',
54
+ :'status' => :'status',
55
+ :'policy_flags' => :'policy_flags',
56
+ :'thread_id' => :'thread_id',
57
+ :'sent' => :'sent'
58
+ }
59
+ end
60
+
61
+ # Returns attribute mapping this model knows about
62
+ def self.acceptable_attribute_map
63
+ attribute_map
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ acceptable_attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'draft_id' => :'String',
75
+ :'status' => :'String',
76
+ :'policy_flags' => :'Hash<String, Object>',
77
+ :'thread_id' => :'String',
78
+ :'sent' => :'AgentSendResult'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::DraftResult` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::DraftResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'draft_id')
105
+ self.draft_id = attributes[:'draft_id']
106
+ else
107
+ self.draft_id = nil
108
+ end
109
+
110
+ if attributes.key?(:'status')
111
+ self.status = attributes[:'status']
112
+ else
113
+ self.status = nil
114
+ end
115
+
116
+ if attributes.key?(:'policy_flags')
117
+ if (value = attributes[:'policy_flags']).is_a?(Hash)
118
+ self.policy_flags = value
119
+ end
120
+ else
121
+ self.policy_flags = nil
122
+ end
123
+
124
+ if attributes.key?(:'thread_id')
125
+ self.thread_id = attributes[:'thread_id']
126
+ end
127
+
128
+ if attributes.key?(:'sent')
129
+ self.sent = attributes[:'sent']
130
+ end
131
+ end
132
+
133
+ # Show invalid properties with the reasons. Usually used together with valid?
134
+ # @return Array for valid properties with the reasons
135
+ def list_invalid_properties
136
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
137
+ invalid_properties = Array.new
138
+ if @draft_id.nil?
139
+ invalid_properties.push('invalid value for "draft_id", draft_id cannot be nil.')
140
+ end
141
+
142
+ if @status.nil?
143
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
144
+ end
145
+
146
+ if @policy_flags.nil?
147
+ invalid_properties.push('invalid value for "policy_flags", policy_flags cannot be nil.')
148
+ end
149
+
150
+ invalid_properties
151
+ end
152
+
153
+ # Check to see if the all the properties in the model are valid
154
+ # @return true if the model is valid
155
+ def valid?
156
+ warn '[DEPRECATED] the `valid?` method is obsolete'
157
+ return false if @draft_id.nil?
158
+ return false if @status.nil?
159
+ status_validator = EnumAttributeValidator.new('String', ["pending_approval", "sent"])
160
+ return false unless status_validator.valid?(@status)
161
+ return false if @policy_flags.nil?
162
+ true
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] draft_id Value to be assigned
167
+ def draft_id=(draft_id)
168
+ if draft_id.nil?
169
+ fail ArgumentError, 'draft_id cannot be nil'
170
+ end
171
+
172
+ @draft_id = draft_id
173
+ end
174
+
175
+ # Custom attribute writer method checking allowed values (enum).
176
+ # @param [Object] status Object to be assigned
177
+ def status=(status)
178
+ validator = EnumAttributeValidator.new('String', ["pending_approval", "sent"])
179
+ unless validator.valid?(status)
180
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
181
+ end
182
+ @status = status
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] policy_flags Value to be assigned
187
+ def policy_flags=(policy_flags)
188
+ if policy_flags.nil?
189
+ fail ArgumentError, 'policy_flags cannot be nil'
190
+ end
191
+
192
+ @policy_flags = policy_flags
193
+ end
194
+
195
+ # Checks equality by comparing each attribute.
196
+ # @param [Object] Object to be compared
197
+ def ==(o)
198
+ return true if self.equal?(o)
199
+ self.class == o.class &&
200
+ draft_id == o.draft_id &&
201
+ status == o.status &&
202
+ policy_flags == o.policy_flags &&
203
+ thread_id == o.thread_id &&
204
+ sent == o.sent
205
+ end
206
+
207
+ # @see the `==` method
208
+ # @param [Object] Object to be compared
209
+ def eql?(o)
210
+ self == o
211
+ end
212
+
213
+ # Calculates hash code according to all attributes.
214
+ # @return [Integer] Hash code
215
+ def hash
216
+ [draft_id, status, policy_flags, thread_id, sent].hash
217
+ end
218
+
219
+ # Builds the object from hash
220
+ # @param [Hash] attributes Model attributes in the form of hash
221
+ # @return [Object] Returns the model itself
222
+ def self.build_from_hash(attributes)
223
+ return nil unless attributes.is_a?(Hash)
224
+ attributes = attributes.transform_keys(&:to_sym)
225
+ transformed_hash = {}
226
+ openapi_types.each_pair do |key, type|
227
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
228
+ transformed_hash["#{key}"] = nil
229
+ elsif type =~ /\AArray<(.*)>/i
230
+ # check to ensure the input is an array given that the attribute
231
+ # is documented as an array but the input is not
232
+ if attributes[attribute_map[key]].is_a?(Array)
233
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
234
+ end
235
+ elsif !attributes[attribute_map[key]].nil?
236
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
237
+ end
238
+ end
239
+ new(transformed_hash)
240
+ end
241
+
242
+ # Returns the object in the form of hash
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_hash
245
+ hash = {}
246
+ self.class.attribute_map.each_pair do |attr, param|
247
+ value = self.send(attr)
248
+ if value.nil?
249
+ is_nullable = self.class.openapi_nullable.include?(attr)
250
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
251
+ end
252
+
253
+ hash[param] = _to_hash(value)
254
+ end
255
+ hash
256
+ end
257
+
258
+ end
259
+
260
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Lockally
17
- class V1MailboxesEmailExportPost201Response < ApiModelBase
17
+ class ExportMailbox201Response < ApiModelBase
18
18
  # Relative download URL. Caller appends to the API host.
19
19
  attr_accessor :url
20
20
 
@@ -82,14 +82,14 @@ module Lockally
82
82
  # @param [Hash] attributes Model attributes in the form of hash
83
83
  def initialize(attributes = {})
84
84
  if (!attributes.is_a?(Hash))
85
- fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::V1MailboxesEmailExportPost201Response` initialize method"
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::ExportMailbox201Response` initialize method"
86
86
  end
87
87
 
88
88
  # check to see if the attribute exists and convert string to symbol for hash key
89
89
  acceptable_attribute_map = self.class.acceptable_attribute_map
90
90
  attributes = attributes.each_with_object({}) { |(k, v), h|
91
91
  if (!acceptable_attribute_map.key?(k.to_sym))
92
- fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::V1MailboxesEmailExportPost201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::ExportMailbox201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
93
93
  end
94
94
  h[k.to_sym] = v
95
95
  }
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Lockally
17
- class V1AdminMeGet200Response < ApiModelBase
17
+ class GetCurrentAdmin200Response < ApiModelBase
18
18
  attr_accessor :admin
19
19
 
20
20
  attr_accessor :tenant
@@ -55,14 +55,14 @@ module Lockally
55
55
  # @param [Hash] attributes Model attributes in the form of hash
56
56
  def initialize(attributes = {})
57
57
  if (!attributes.is_a?(Hash))
58
- fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::V1AdminMeGet200Response` initialize method"
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::GetCurrentAdmin200Response` initialize method"
59
59
  end
60
60
 
61
61
  # check to see if the attribute exists and convert string to symbol for hash key
62
62
  acceptable_attribute_map = self.class.acceptable_attribute_map
63
63
  attributes = attributes.each_with_object({}) { |(k, v), h|
64
64
  if (!acceptable_attribute_map.key?(k.to_sym))
65
- fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::V1AdminMeGet200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::GetCurrentAdmin200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
66
  end
67
67
  h[k.to_sym] = v
68
68
  }
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Lockally
17
- class V1UsageGet200Response < ApiModelBase
17
+ class GetUsage200Response < ApiModelBase
18
18
  # Mailboxes that are neither disabled nor soft-deleted.
19
19
  attr_accessor :mailboxes_active
20
20
 
@@ -110,14 +110,14 @@ module Lockally
110
110
  # @param [Hash] attributes Model attributes in the form of hash
111
111
  def initialize(attributes = {})
112
112
  if (!attributes.is_a?(Hash))
113
- fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::V1UsageGet200Response` initialize method"
113
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::GetUsage200Response` initialize method"
114
114
  end
115
115
 
116
116
  # check to see if the attribute exists and convert string to symbol for hash key
117
117
  acceptable_attribute_map = self.class.acceptable_attribute_map
118
118
  attributes = attributes.each_with_object({}) { |(k, v), h|
119
119
  if (!acceptable_attribute_map.key?(k.to_sym))
120
- fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::V1UsageGet200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
120
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::GetUsage200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
121
121
  end
122
122
  h[k.to_sym] = v
123
123
  }
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Lockally
17
- class HealthzGet200Response < ApiModelBase
17
+ class HealthCheck200Response < ApiModelBase
18
18
  attr_accessor :status
19
19
 
20
20
  attr_accessor :time
@@ -77,14 +77,14 @@ module Lockally
77
77
  # @param [Hash] attributes Model attributes in the form of hash
78
78
  def initialize(attributes = {})
79
79
  if (!attributes.is_a?(Hash))
80
- fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::HealthzGet200Response` initialize method"
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::HealthCheck200Response` initialize method"
81
81
  end
82
82
 
83
83
  # check to see if the attribute exists and convert string to symbol for hash key
84
84
  acceptable_attribute_map = self.class.acceptable_attribute_map
85
85
  attributes = attributes.each_with_object({}) { |(k, v), h|
86
86
  if (!acceptable_attribute_map.key?(k.to_sym))
87
- fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::HealthzGet200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::HealthCheck200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
88
  end
89
89
  h[k.to_sym] = v
90
90
  }
@@ -0,0 +1,225 @@
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 Inbox < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :email
21
+
22
+ attr_accessor :last_message_at
23
+
24
+ attr_accessor :thread_count
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'id' => :'id',
30
+ :'email' => :'email',
31
+ :'last_message_at' => :'last_message_at',
32
+ :'thread_count' => :'thread_count'
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
+ :'id' => :'String',
50
+ :'email' => :'String',
51
+ :'last_message_at' => :'Time',
52
+ :'thread_count' => :'Integer'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::Inbox` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::Inbox`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'id')
79
+ self.id = attributes[:'id']
80
+ else
81
+ self.id = nil
82
+ end
83
+
84
+ if attributes.key?(:'email')
85
+ self.email = attributes[:'email']
86
+ else
87
+ self.email = nil
88
+ end
89
+
90
+ if attributes.key?(:'last_message_at')
91
+ self.last_message_at = attributes[:'last_message_at']
92
+ end
93
+
94
+ if attributes.key?(:'thread_count')
95
+ self.thread_count = attributes[:'thread_count']
96
+ else
97
+ self.thread_count = nil
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
105
+ invalid_properties = Array.new
106
+ if @id.nil?
107
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
108
+ end
109
+
110
+ if @email.nil?
111
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
112
+ end
113
+
114
+ if @thread_count.nil?
115
+ invalid_properties.push('invalid value for "thread_count", thread_count cannot be nil.')
116
+ end
117
+
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
125
+ return false if @id.nil?
126
+ return false if @email.nil?
127
+ return false if @thread_count.nil?
128
+ true
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] id Value to be assigned
133
+ def id=(id)
134
+ if id.nil?
135
+ fail ArgumentError, 'id cannot be nil'
136
+ end
137
+
138
+ @id = id
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] email Value to be assigned
143
+ def email=(email)
144
+ if email.nil?
145
+ fail ArgumentError, 'email cannot be nil'
146
+ end
147
+
148
+ @email = email
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] thread_count Value to be assigned
153
+ def thread_count=(thread_count)
154
+ if thread_count.nil?
155
+ fail ArgumentError, 'thread_count cannot be nil'
156
+ end
157
+
158
+ @thread_count = thread_count
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ id == o.id &&
167
+ email == o.email &&
168
+ last_message_at == o.last_message_at &&
169
+ thread_count == o.thread_count
170
+ end
171
+
172
+ # @see the `==` method
173
+ # @param [Object] Object to be compared
174
+ def eql?(o)
175
+ self == o
176
+ end
177
+
178
+ # Calculates hash code according to all attributes.
179
+ # @return [Integer] Hash code
180
+ def hash
181
+ [id, email, last_message_at, thread_count].hash
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def self.build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ attributes = attributes.transform_keys(&:to_sym)
190
+ transformed_hash = {}
191
+ openapi_types.each_pair do |key, type|
192
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = nil
194
+ elsif type =~ /\AArray<(.*)>/i
195
+ # check to ensure the input is an array given that the attribute
196
+ # is documented as an array but the input is not
197
+ if attributes[attribute_map[key]].is_a?(Array)
198
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
199
+ end
200
+ elsif !attributes[attribute_map[key]].nil?
201
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
202
+ end
203
+ end
204
+ new(transformed_hash)
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ end
224
+
225
+ end