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
@@ -19,31 +19,31 @@ module Lockally
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Delete a domain
23
- # Removes the domain registration. Refuses with 409 if any mailbox is still attached — delete the mailboxes first.
24
- # @param domain [String]
22
+ # Register a domain
23
+ # Registers a new domain for the calling tenant. Generates a DKIM keypair and verification token. Returns DNS instructions the tenant must publish under their own DNS (verification TXT, SPF include, DKIM TXT, MX records to `mx1`/`mx2.lockally.com`, DMARC seed). **Idempotent** — re-posting the same domain returns the existing record with the same DKIM keys and token (regenerating would break the tenant's published DNS). Returns 200 on idempotent hit, 201 on first create. Returns 409 if the domain is already claimed by a different tenant.
24
+ # @param create_domain_request [CreateDomainRequest]
25
25
  # @param [Hash] opts the optional parameters
26
- # @return [nil]
27
- def v1_domains_domain_delete(domain, opts = {})
28
- v1_domains_domain_delete_with_http_info(domain, opts)
29
- nil
26
+ # @return [Domain]
27
+ def create_domain(create_domain_request, opts = {})
28
+ data, _status_code, _headers = create_domain_with_http_info(create_domain_request, opts)
29
+ data
30
30
  end
31
31
 
32
- # Delete a domain
33
- # Removes the domain registration. Refuses with 409 if any mailbox is still attached — delete the mailboxes first.
34
- # @param domain [String]
32
+ # Register a domain
33
+ # Registers a new domain for the calling tenant. Generates a DKIM keypair and verification token. Returns DNS instructions the tenant must publish under their own DNS (verification TXT, SPF include, DKIM TXT, MX records to `mx1`/`mx2.lockally.com`, DMARC seed). **Idempotent** — re-posting the same domain returns the existing record with the same DKIM keys and token (regenerating would break the tenant's published DNS). Returns 200 on idempotent hit, 201 on first create. Returns 409 if the domain is already claimed by a different tenant.
34
+ # @param create_domain_request [CreateDomainRequest]
35
35
  # @param [Hash] opts the optional parameters
36
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
37
- def v1_domains_domain_delete_with_http_info(domain, opts = {})
36
+ # @return [Array<(Domain, Integer, Hash)>] Domain data, response status code and response headers
37
+ def create_domain_with_http_info(create_domain_request, opts = {})
38
38
  if @api_client.config.debugging
39
- @api_client.config.logger.debug 'Calling API: DomainsApi.v1_domains_domain_delete ...'
39
+ @api_client.config.logger.debug 'Calling API: DomainsApi.create_domain ...'
40
40
  end
41
- # verify the required parameter 'domain' is set
42
- if @api_client.config.client_side_validation && domain.nil?
43
- fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.v1_domains_domain_delete"
41
+ # verify the required parameter 'create_domain_request' is set
42
+ if @api_client.config.client_side_validation && create_domain_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'create_domain_request' when calling DomainsApi.create_domain"
44
44
  end
45
45
  # resource path
46
- local_var_path = '/v1/domains/{domain}'.sub('{domain}', CGI.escape(domain.to_s))
46
+ local_var_path = '/v1/domains'
47
47
 
48
48
  # query parameters
49
49
  query_params = opts[:query_params] || {}
@@ -51,22 +51,27 @@ module Lockally
51
51
  # header parameters
52
52
  header_params = opts[:header_params] || {}
53
53
  # HTTP header 'Accept' (if needed)
54
- header_params['Accept'] = @api_client.select_header_accept(['application/problem+json']) unless header_params['Accept']
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
55
60
 
56
61
  # form parameters
57
62
  form_params = opts[:form_params] || {}
58
63
 
59
64
  # http body (model)
60
- post_body = opts[:debug_body]
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_domain_request)
61
66
 
62
67
  # return_type
63
- return_type = opts[:debug_return_type]
68
+ return_type = opts[:debug_return_type] || 'Domain'
64
69
 
65
70
  # auth_names
66
71
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
67
72
 
68
73
  new_options = opts.merge(
69
- :operation => :"DomainsApi.v1_domains_domain_delete",
74
+ :operation => :"DomainsApi.create_domain",
70
75
  :header_params => header_params,
71
76
  :query_params => query_params,
72
77
  :form_params => form_params,
@@ -75,33 +80,35 @@ module Lockally
75
80
  :return_type => return_type
76
81
  )
77
82
 
78
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
79
84
  if @api_client.config.debugging
80
- @api_client.config.logger.debug "API called: DomainsApi#v1_domains_domain_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ @api_client.config.logger.debug "API called: DomainsApi#create_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
86
  end
82
87
  return data, status_code, headers
83
88
  end
84
89
 
85
- # Get a domain
90
+ # Delete a domain
91
+ # Removes the domain registration. Refuses with 409 if any mailbox is still attached — delete the mailboxes first.
86
92
  # @param domain [String]
87
93
  # @param [Hash] opts the optional parameters
88
- # @return [Domain]
89
- def v1_domains_domain_get(domain, opts = {})
90
- data, _status_code, _headers = v1_domains_domain_get_with_http_info(domain, opts)
91
- data
94
+ # @return [nil]
95
+ def delete_domain(domain, opts = {})
96
+ delete_domain_with_http_info(domain, opts)
97
+ nil
92
98
  end
93
99
 
94
- # Get a domain
100
+ # Delete a domain
101
+ # Removes the domain registration. Refuses with 409 if any mailbox is still attached — delete the mailboxes first.
95
102
  # @param domain [String]
96
103
  # @param [Hash] opts the optional parameters
97
- # @return [Array<(Domain, Integer, Hash)>] Domain data, response status code and response headers
98
- def v1_domains_domain_get_with_http_info(domain, opts = {})
104
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
105
+ def delete_domain_with_http_info(domain, opts = {})
99
106
  if @api_client.config.debugging
100
- @api_client.config.logger.debug 'Calling API: DomainsApi.v1_domains_domain_get ...'
107
+ @api_client.config.logger.debug 'Calling API: DomainsApi.delete_domain ...'
101
108
  end
102
109
  # verify the required parameter 'domain' is set
103
110
  if @api_client.config.client_side_validation && domain.nil?
104
- fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.v1_domains_domain_get"
111
+ fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.delete_domain"
105
112
  end
106
113
  # resource path
107
114
  local_var_path = '/v1/domains/{domain}'.sub('{domain}', CGI.escape(domain.to_s))
@@ -112,7 +119,7 @@ module Lockally
112
119
  # header parameters
113
120
  header_params = opts[:header_params] || {}
114
121
  # HTTP header 'Accept' (if needed)
115
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
122
+ header_params['Accept'] = @api_client.select_header_accept(['application/problem+json']) unless header_params['Accept']
116
123
 
117
124
  # form parameters
118
125
  form_params = opts[:form_params] || {}
@@ -121,13 +128,13 @@ module Lockally
121
128
  post_body = opts[:debug_body]
122
129
 
123
130
  # return_type
124
- return_type = opts[:debug_return_type] || 'Domain'
131
+ return_type = opts[:debug_return_type]
125
132
 
126
133
  # auth_names
127
134
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
128
135
 
129
136
  new_options = opts.merge(
130
- :operation => :"DomainsApi.v1_domains_domain_get",
137
+ :operation => :"DomainsApi.delete_domain",
131
138
  :header_params => header_params,
132
139
  :query_params => query_params,
133
140
  :form_params => form_params,
@@ -136,9 +143,9 @@ module Lockally
136
143
  :return_type => return_type
137
144
  )
138
145
 
139
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
146
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
140
147
  if @api_client.config.debugging
141
- @api_client.config.logger.debug "API called: DomainsApi#v1_domains_domain_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
148
+ @api_client.config.logger.debug "API called: DomainsApi#delete_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
142
149
  end
143
150
  return data, status_code, headers
144
151
  end
@@ -148,8 +155,8 @@ module Lockally
148
155
  # @param domain [String]
149
156
  # @param [Hash] opts the optional parameters
150
157
  # @return [nil]
151
- def v1_domains_domain_return_path_delete(domain, opts = {})
152
- v1_domains_domain_return_path_delete_with_http_info(domain, opts)
158
+ def disable_return_path(domain, opts = {})
159
+ disable_return_path_with_http_info(domain, opts)
153
160
  nil
154
161
  end
155
162
 
@@ -158,13 +165,13 @@ module Lockally
158
165
  # @param domain [String]
159
166
  # @param [Hash] opts the optional parameters
160
167
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
161
- def v1_domains_domain_return_path_delete_with_http_info(domain, opts = {})
168
+ def disable_return_path_with_http_info(domain, opts = {})
162
169
  if @api_client.config.debugging
163
- @api_client.config.logger.debug 'Calling API: DomainsApi.v1_domains_domain_return_path_delete ...'
170
+ @api_client.config.logger.debug 'Calling API: DomainsApi.disable_return_path ...'
164
171
  end
165
172
  # verify the required parameter 'domain' is set
166
173
  if @api_client.config.client_side_validation && domain.nil?
167
- fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.v1_domains_domain_return_path_delete"
174
+ fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.disable_return_path"
168
175
  end
169
176
  # resource path
170
177
  local_var_path = '/v1/domains/{domain}/return-path'.sub('{domain}', CGI.escape(domain.to_s))
@@ -190,7 +197,7 @@ module Lockally
190
197
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
191
198
 
192
199
  new_options = opts.merge(
193
- :operation => :"DomainsApi.v1_domains_domain_return_path_delete",
200
+ :operation => :"DomainsApi.disable_return_path",
194
201
  :header_params => header_params,
195
202
  :query_params => query_params,
196
203
  :form_params => form_params,
@@ -201,33 +208,33 @@ module Lockally
201
208
 
202
209
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
203
210
  if @api_client.config.debugging
204
- @api_client.config.logger.debug "API called: DomainsApi#v1_domains_domain_return_path_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
211
+ @api_client.config.logger.debug "API called: DomainsApi#disable_return_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
205
212
  end
206
213
  return data, status_code, headers
207
214
  end
208
215
 
209
- # Get the custom Return-Path
210
- # A custom Return-Path moves the envelope sender of mail sent through the API from this domain onto `bounces.<domain>`. Bounce reports then come back to Lockally instead of the sending mailbox, and a bounce that arrives after delivery marks the message bounced, suppresses the address and fires `delivery.bounced`. Mail sent from webmail or mail apps is not affected. DKIM stays signed by the domain itself. `status` is `off`, `pending` (records not confirmed yet) or `active`.
216
+ # Turn on the custom Return-Path
217
+ # Moves it to `pending` and returns the two records to publish on `bounces.<domain>`. Nothing changes for mail until they are confirmed with the verify call. The domain must be verified. Available on every plan except Free.
211
218
  # @param domain [String]
212
219
  # @param [Hash] opts the optional parameters
213
220
  # @return [ReturnPath]
214
- def v1_domains_domain_return_path_get(domain, opts = {})
215
- data, _status_code, _headers = v1_domains_domain_return_path_get_with_http_info(domain, opts)
221
+ def enable_return_path(domain, opts = {})
222
+ data, _status_code, _headers = enable_return_path_with_http_info(domain, opts)
216
223
  data
217
224
  end
218
225
 
219
- # Get the custom Return-Path
220
- # A custom Return-Path moves the envelope sender of mail sent through the API from this domain onto &#x60;bounces.&lt;domain&gt;&#x60;. Bounce reports then come back to Lockally instead of the sending mailbox, and a bounce that arrives after delivery marks the message bounced, suppresses the address and fires &#x60;delivery.bounced&#x60;. Mail sent from webmail or mail apps is not affected. DKIM stays signed by the domain itself. &#x60;status&#x60; is &#x60;off&#x60;, &#x60;pending&#x60; (records not confirmed yet) or &#x60;active&#x60;.
226
+ # Turn on the custom Return-Path
227
+ # Moves it to &#x60;pending&#x60; and returns the two records to publish on &#x60;bounces.&lt;domain&gt;&#x60;. Nothing changes for mail until they are confirmed with the verify call. The domain must be verified. Available on every plan except Free.
221
228
  # @param domain [String]
222
229
  # @param [Hash] opts the optional parameters
223
230
  # @return [Array<(ReturnPath, Integer, Hash)>] ReturnPath data, response status code and response headers
224
- def v1_domains_domain_return_path_get_with_http_info(domain, opts = {})
231
+ def enable_return_path_with_http_info(domain, opts = {})
225
232
  if @api_client.config.debugging
226
- @api_client.config.logger.debug 'Calling API: DomainsApi.v1_domains_domain_return_path_get ...'
233
+ @api_client.config.logger.debug 'Calling API: DomainsApi.enable_return_path ...'
227
234
  end
228
235
  # verify the required parameter 'domain' is set
229
236
  if @api_client.config.client_side_validation && domain.nil?
230
- fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.v1_domains_domain_return_path_get"
237
+ fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.enable_return_path"
231
238
  end
232
239
  # resource path
233
240
  local_var_path = '/v1/domains/{domain}/return-path'.sub('{domain}', CGI.escape(domain.to_s))
@@ -253,7 +260,7 @@ module Lockally
253
260
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
254
261
 
255
262
  new_options = opts.merge(
256
- :operation => :"DomainsApi.v1_domains_domain_return_path_get",
263
+ :operation => :"DomainsApi.enable_return_path",
257
264
  :header_params => header_params,
258
265
  :query_params => query_params,
259
266
  :form_params => form_params,
@@ -262,38 +269,36 @@ module Lockally
262
269
  :return_type => return_type
263
270
  )
264
271
 
265
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
272
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
266
273
  if @api_client.config.debugging
267
- @api_client.config.logger.debug "API called: DomainsApi#v1_domains_domain_return_path_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
274
+ @api_client.config.logger.debug "API called: DomainsApi#enable_return_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
268
275
  end
269
276
  return data, status_code, headers
270
277
  end
271
278
 
272
- # Turn on the custom Return-Path
273
- # Moves it to `pending` and returns the two records to publish on `bounces.<domain>`. Nothing changes for mail until they are confirmed with the verify call. The domain must be verified. Available on every plan except Free.
279
+ # Get a domain
274
280
  # @param domain [String]
275
281
  # @param [Hash] opts the optional parameters
276
- # @return [ReturnPath]
277
- def v1_domains_domain_return_path_post(domain, opts = {})
278
- data, _status_code, _headers = v1_domains_domain_return_path_post_with_http_info(domain, opts)
282
+ # @return [Domain]
283
+ def get_domain(domain, opts = {})
284
+ data, _status_code, _headers = get_domain_with_http_info(domain, opts)
279
285
  data
280
286
  end
281
287
 
282
- # Turn on the custom Return-Path
283
- # Moves it to &#x60;pending&#x60; and returns the two records to publish on &#x60;bounces.&lt;domain&gt;&#x60;. Nothing changes for mail until they are confirmed with the verify call. The domain must be verified. Available on every plan except Free.
288
+ # Get a domain
284
289
  # @param domain [String]
285
290
  # @param [Hash] opts the optional parameters
286
- # @return [Array<(ReturnPath, Integer, Hash)>] ReturnPath data, response status code and response headers
287
- def v1_domains_domain_return_path_post_with_http_info(domain, opts = {})
291
+ # @return [Array<(Domain, Integer, Hash)>] Domain data, response status code and response headers
292
+ def get_domain_with_http_info(domain, opts = {})
288
293
  if @api_client.config.debugging
289
- @api_client.config.logger.debug 'Calling API: DomainsApi.v1_domains_domain_return_path_post ...'
294
+ @api_client.config.logger.debug 'Calling API: DomainsApi.get_domain ...'
290
295
  end
291
296
  # verify the required parameter 'domain' is set
292
297
  if @api_client.config.client_side_validation && domain.nil?
293
- fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.v1_domains_domain_return_path_post"
298
+ fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.get_domain"
294
299
  end
295
300
  # resource path
296
- local_var_path = '/v1/domains/{domain}/return-path'.sub('{domain}', CGI.escape(domain.to_s))
301
+ local_var_path = '/v1/domains/{domain}'.sub('{domain}', CGI.escape(domain.to_s))
297
302
 
298
303
  # query parameters
299
304
  query_params = opts[:query_params] || {}
@@ -310,13 +315,13 @@ module Lockally
310
315
  post_body = opts[:debug_body]
311
316
 
312
317
  # return_type
313
- return_type = opts[:debug_return_type] || 'ReturnPath'
318
+ return_type = opts[:debug_return_type] || 'Domain'
314
319
 
315
320
  # auth_names
316
321
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
317
322
 
318
323
  new_options = opts.merge(
319
- :operation => :"DomainsApi.v1_domains_domain_return_path_post",
324
+ :operation => :"DomainsApi.get_domain",
320
325
  :header_params => header_params,
321
326
  :query_params => query_params,
322
327
  :form_params => form_params,
@@ -325,38 +330,38 @@ module Lockally
325
330
  :return_type => return_type
326
331
  )
327
332
 
328
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
333
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
329
334
  if @api_client.config.debugging
330
- @api_client.config.logger.debug "API called: DomainsApi#v1_domains_domain_return_path_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
335
+ @api_client.config.logger.debug "API called: DomainsApi#get_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
331
336
  end
332
337
  return data, status_code, headers
333
338
  end
334
339
 
335
- # Check the custom Return-Path records
336
- # Looks up the MX and SPF records on `bounces.<domain>`. Returns 200 either way: while a record is missing the status stays `pending` and `check` says which one. Once both are found the Return-Path becomes `active` and the send path starts using it.
340
+ # Get the custom Return-Path
341
+ # A custom Return-Path moves the envelope sender of mail sent through the API from this domain onto `bounces.<domain>`. Bounce reports then come back to Lockally instead of the sending mailbox, and a bounce that arrives after delivery marks the message bounced, suppresses the address and fires `delivery.bounced`. Mail sent from webmail or mail apps is not affected. DKIM stays signed by the domain itself. `status` is `off`, `pending` (records not confirmed yet) or `active`.
337
342
  # @param domain [String]
338
343
  # @param [Hash] opts the optional parameters
339
344
  # @return [ReturnPath]
340
- def v1_domains_domain_return_path_verify_post(domain, opts = {})
341
- data, _status_code, _headers = v1_domains_domain_return_path_verify_post_with_http_info(domain, opts)
345
+ def get_return_path(domain, opts = {})
346
+ data, _status_code, _headers = get_return_path_with_http_info(domain, opts)
342
347
  data
343
348
  end
344
349
 
345
- # Check the custom Return-Path records
346
- # Looks up the MX and SPF records on &#x60;bounces.&lt;domain&gt;&#x60;. Returns 200 either way: while a record is missing the status stays &#x60;pending&#x60; and &#x60;check&#x60; says which one. Once both are found the Return-Path becomes &#x60;active&#x60; and the send path starts using it.
350
+ # Get the custom Return-Path
351
+ # A custom Return-Path moves the envelope sender of mail sent through the API from this domain onto &#x60;bounces.&lt;domain&gt;&#x60;. Bounce reports then come back to Lockally instead of the sending mailbox, and a bounce that arrives after delivery marks the message bounced, suppresses the address and fires &#x60;delivery.bounced&#x60;. Mail sent from webmail or mail apps is not affected. DKIM stays signed by the domain itself. &#x60;status&#x60; is &#x60;off&#x60;, &#x60;pending&#x60; (records not confirmed yet) or &#x60;active&#x60;.
347
352
  # @param domain [String]
348
353
  # @param [Hash] opts the optional parameters
349
354
  # @return [Array<(ReturnPath, Integer, Hash)>] ReturnPath data, response status code and response headers
350
- def v1_domains_domain_return_path_verify_post_with_http_info(domain, opts = {})
355
+ def get_return_path_with_http_info(domain, opts = {})
351
356
  if @api_client.config.debugging
352
- @api_client.config.logger.debug 'Calling API: DomainsApi.v1_domains_domain_return_path_verify_post ...'
357
+ @api_client.config.logger.debug 'Calling API: DomainsApi.get_return_path ...'
353
358
  end
354
359
  # verify the required parameter 'domain' is set
355
360
  if @api_client.config.client_side_validation && domain.nil?
356
- fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.v1_domains_domain_return_path_verify_post"
361
+ fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.get_return_path"
357
362
  end
358
363
  # resource path
359
- local_var_path = '/v1/domains/{domain}/return-path/verify'.sub('{domain}', CGI.escape(domain.to_s))
364
+ local_var_path = '/v1/domains/{domain}/return-path'.sub('{domain}', CGI.escape(domain.to_s))
360
365
 
361
366
  # query parameters
362
367
  query_params = opts[:query_params] || {}
@@ -379,7 +384,7 @@ module Lockally
379
384
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
380
385
 
381
386
  new_options = opts.merge(
382
- :operation => :"DomainsApi.v1_domains_domain_return_path_verify_post",
387
+ :operation => :"DomainsApi.get_return_path",
383
388
  :header_params => header_params,
384
389
  :query_params => query_params,
385
390
  :form_params => form_params,
@@ -388,38 +393,32 @@ module Lockally
388
393
  :return_type => return_type
389
394
  )
390
395
 
391
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
396
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
392
397
  if @api_client.config.debugging
393
- @api_client.config.logger.debug "API called: DomainsApi#v1_domains_domain_return_path_verify_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
398
+ @api_client.config.logger.debug "API called: DomainsApi#get_return_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
394
399
  end
395
400
  return data, status_code, headers
396
401
  end
397
402
 
398
- # Force-poll DNS verification
399
- # Synchronously checks the `_lockally-verify.<domain>` TXT record against the stored verification token. Returns 200 either way: the returned `verified` boolean tells you whether DNS now confirms. Caller polls until `verified: true`. In v2 a background worker auto-polls and fires a `domain.verified` webhook.
400
- # @param domain [String]
403
+ # List domains
404
+ # Returns every domain registered under the calling tenant.
401
405
  # @param [Hash] opts the optional parameters
402
- # @return [Domain]
403
- def v1_domains_domain_verify_post(domain, opts = {})
404
- data, _status_code, _headers = v1_domains_domain_verify_post_with_http_info(domain, opts)
406
+ # @return [ListDomains200Response]
407
+ def list_domains(opts = {})
408
+ data, _status_code, _headers = list_domains_with_http_info(opts)
405
409
  data
406
410
  end
407
411
 
408
- # Force-poll DNS verification
409
- # Synchronously checks the &#x60;_lockally-verify.&lt;domain&gt;&#x60; TXT record against the stored verification token. Returns 200 either way: the returned &#x60;verified&#x60; boolean tells you whether DNS now confirms. Caller polls until &#x60;verified: true&#x60;. In v2 a background worker auto-polls and fires a &#x60;domain.verified&#x60; webhook.
410
- # @param domain [String]
412
+ # List domains
413
+ # Returns every domain registered under the calling tenant.
411
414
  # @param [Hash] opts the optional parameters
412
- # @return [Array<(Domain, Integer, Hash)>] Domain data, response status code and response headers
413
- def v1_domains_domain_verify_post_with_http_info(domain, opts = {})
415
+ # @return [Array<(ListDomains200Response, Integer, Hash)>] ListDomains200Response data, response status code and response headers
416
+ def list_domains_with_http_info(opts = {})
414
417
  if @api_client.config.debugging
415
- @api_client.config.logger.debug 'Calling API: DomainsApi.v1_domains_domain_verify_post ...'
416
- end
417
- # verify the required parameter 'domain' is set
418
- if @api_client.config.client_side_validation && domain.nil?
419
- fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.v1_domains_domain_verify_post"
418
+ @api_client.config.logger.debug 'Calling API: DomainsApi.list_domains ...'
420
419
  end
421
420
  # resource path
422
- local_var_path = '/v1/domains/{domain}/verify'.sub('{domain}', CGI.escape(domain.to_s))
421
+ local_var_path = '/v1/domains'
423
422
 
424
423
  # query parameters
425
424
  query_params = opts[:query_params] || {}
@@ -436,13 +435,13 @@ module Lockally
436
435
  post_body = opts[:debug_body]
437
436
 
438
437
  # return_type
439
- return_type = opts[:debug_return_type] || 'Domain'
438
+ return_type = opts[:debug_return_type] || 'ListDomains200Response'
440
439
 
441
440
  # auth_names
442
441
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
443
442
 
444
443
  new_options = opts.merge(
445
- :operation => :"DomainsApi.v1_domains_domain_verify_post",
444
+ :operation => :"DomainsApi.list_domains",
446
445
  :header_params => header_params,
447
446
  :query_params => query_params,
448
447
  :form_params => form_params,
@@ -451,32 +450,38 @@ module Lockally
451
450
  :return_type => return_type
452
451
  )
453
452
 
454
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
453
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
455
454
  if @api_client.config.debugging
456
- @api_client.config.logger.debug "API called: DomainsApi#v1_domains_domain_verify_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
455
+ @api_client.config.logger.debug "API called: DomainsApi#list_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
457
456
  end
458
457
  return data, status_code, headers
459
458
  end
460
459
 
461
- # List domains
462
- # Returns every domain registered under the calling tenant.
460
+ # Force-poll DNS verification
461
+ # Synchronously checks the `_lockally-verify.<domain>` TXT record against the stored verification token. Returns 200 either way: the returned `verified` boolean tells you whether DNS now confirms. Caller polls until `verified: true`. In v2 a background worker auto-polls and fires a `domain.verified` webhook.
462
+ # @param domain [String]
463
463
  # @param [Hash] opts the optional parameters
464
- # @return [V1DomainsGet200Response]
465
- def v1_domains_get(opts = {})
466
- data, _status_code, _headers = v1_domains_get_with_http_info(opts)
464
+ # @return [Domain]
465
+ def verify_domain(domain, opts = {})
466
+ data, _status_code, _headers = verify_domain_with_http_info(domain, opts)
467
467
  data
468
468
  end
469
469
 
470
- # List domains
471
- # Returns every domain registered under the calling tenant.
470
+ # Force-poll DNS verification
471
+ # Synchronously checks the &#x60;_lockally-verify.&lt;domain&gt;&#x60; TXT record against the stored verification token. Returns 200 either way: the returned &#x60;verified&#x60; boolean tells you whether DNS now confirms. Caller polls until &#x60;verified: true&#x60;. In v2 a background worker auto-polls and fires a &#x60;domain.verified&#x60; webhook.
472
+ # @param domain [String]
472
473
  # @param [Hash] opts the optional parameters
473
- # @return [Array<(V1DomainsGet200Response, Integer, Hash)>] V1DomainsGet200Response data, response status code and response headers
474
- def v1_domains_get_with_http_info(opts = {})
474
+ # @return [Array<(Domain, Integer, Hash)>] Domain data, response status code and response headers
475
+ def verify_domain_with_http_info(domain, opts = {})
475
476
  if @api_client.config.debugging
476
- @api_client.config.logger.debug 'Calling API: DomainsApi.v1_domains_get ...'
477
+ @api_client.config.logger.debug 'Calling API: DomainsApi.verify_domain ...'
478
+ end
479
+ # verify the required parameter 'domain' is set
480
+ if @api_client.config.client_side_validation && domain.nil?
481
+ fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.verify_domain"
477
482
  end
478
483
  # resource path
479
- local_var_path = '/v1/domains'
484
+ local_var_path = '/v1/domains/{domain}/verify'.sub('{domain}', CGI.escape(domain.to_s))
480
485
 
481
486
  # query parameters
482
487
  query_params = opts[:query_params] || {}
@@ -493,13 +498,13 @@ module Lockally
493
498
  post_body = opts[:debug_body]
494
499
 
495
500
  # return_type
496
- return_type = opts[:debug_return_type] || 'V1DomainsGet200Response'
501
+ return_type = opts[:debug_return_type] || 'Domain'
497
502
 
498
503
  # auth_names
499
504
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
500
505
 
501
506
  new_options = opts.merge(
502
- :operation => :"DomainsApi.v1_domains_get",
507
+ :operation => :"DomainsApi.verify_domain",
503
508
  :header_params => header_params,
504
509
  :query_params => query_params,
505
510
  :form_params => form_params,
@@ -508,38 +513,38 @@ module Lockally
508
513
  :return_type => return_type
509
514
  )
510
515
 
511
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
516
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
512
517
  if @api_client.config.debugging
513
- @api_client.config.logger.debug "API called: DomainsApi#v1_domains_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
518
+ @api_client.config.logger.debug "API called: DomainsApi#verify_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
514
519
  end
515
520
  return data, status_code, headers
516
521
  end
517
522
 
518
- # Register a domain
519
- # Registers a new domain for the calling tenant. Generates a DKIM keypair and verification token. Returns DNS instructions the tenant must publish under their own DNS (verification TXT, SPF include, DKIM TXT, MX records to `mx1`/`mx2.lockally.com`, DMARC seed). **Idempotent** — re-posting the same domain returns the existing record with the same DKIM keys and token (regenerating would break the tenant's published DNS). Returns 200 on idempotent hit, 201 on first create. Returns 409 if the domain is already claimed by a different tenant.
520
- # @param v1_domains_post_request [V1DomainsPostRequest]
523
+ # Check the custom Return-Path records
524
+ # Looks up the MX and SPF records on `bounces.<domain>`. Returns 200 either way: while a record is missing the status stays `pending` and `check` says which one. Once both are found the Return-Path becomes `active` and the send path starts using it.
525
+ # @param domain [String]
521
526
  # @param [Hash] opts the optional parameters
522
- # @return [Domain]
523
- def v1_domains_post(v1_domains_post_request, opts = {})
524
- data, _status_code, _headers = v1_domains_post_with_http_info(v1_domains_post_request, opts)
527
+ # @return [ReturnPath]
528
+ def verify_return_path(domain, opts = {})
529
+ data, _status_code, _headers = verify_return_path_with_http_info(domain, opts)
525
530
  data
526
531
  end
527
532
 
528
- # Register a domain
529
- # Registers a new domain for the calling tenant. Generates a DKIM keypair and verification token. Returns DNS instructions the tenant must publish under their own DNS (verification TXT, SPF include, DKIM TXT, MX records to &#x60;mx1&#x60;/&#x60;mx2.lockally.com&#x60;, DMARC seed). **Idempotent** — re-posting the same domain returns the existing record with the same DKIM keys and token (regenerating would break the tenant&#39;s published DNS). Returns 200 on idempotent hit, 201 on first create. Returns 409 if the domain is already claimed by a different tenant.
530
- # @param v1_domains_post_request [V1DomainsPostRequest]
533
+ # Check the custom Return-Path records
534
+ # Looks up the MX and SPF records on &#x60;bounces.&lt;domain&gt;&#x60;. Returns 200 either way: while a record is missing the status stays &#x60;pending&#x60; and &#x60;check&#x60; says which one. Once both are found the Return-Path becomes &#x60;active&#x60; and the send path starts using it.
535
+ # @param domain [String]
531
536
  # @param [Hash] opts the optional parameters
532
- # @return [Array<(Domain, Integer, Hash)>] Domain data, response status code and response headers
533
- def v1_domains_post_with_http_info(v1_domains_post_request, opts = {})
537
+ # @return [Array<(ReturnPath, Integer, Hash)>] ReturnPath data, response status code and response headers
538
+ def verify_return_path_with_http_info(domain, opts = {})
534
539
  if @api_client.config.debugging
535
- @api_client.config.logger.debug 'Calling API: DomainsApi.v1_domains_post ...'
540
+ @api_client.config.logger.debug 'Calling API: DomainsApi.verify_return_path ...'
536
541
  end
537
- # verify the required parameter 'v1_domains_post_request' is set
538
- if @api_client.config.client_side_validation && v1_domains_post_request.nil?
539
- fail ArgumentError, "Missing the required parameter 'v1_domains_post_request' when calling DomainsApi.v1_domains_post"
542
+ # verify the required parameter 'domain' is set
543
+ if @api_client.config.client_side_validation && domain.nil?
544
+ fail ArgumentError, "Missing the required parameter 'domain' when calling DomainsApi.verify_return_path"
540
545
  end
541
546
  # resource path
542
- local_var_path = '/v1/domains'
547
+ local_var_path = '/v1/domains/{domain}/return-path/verify'.sub('{domain}', CGI.escape(domain.to_s))
543
548
 
544
549
  # query parameters
545
550
  query_params = opts[:query_params] || {}
@@ -548,26 +553,21 @@ module Lockally
548
553
  header_params = opts[:header_params] || {}
549
554
  # HTTP header 'Accept' (if needed)
550
555
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
551
- # HTTP header 'Content-Type'
552
- content_type = @api_client.select_header_content_type(['application/json'])
553
- if !content_type.nil?
554
- header_params['Content-Type'] = content_type
555
- end
556
556
 
557
557
  # form parameters
558
558
  form_params = opts[:form_params] || {}
559
559
 
560
560
  # http body (model)
561
- post_body = opts[:debug_body] || @api_client.object_to_http_body(v1_domains_post_request)
561
+ post_body = opts[:debug_body]
562
562
 
563
563
  # return_type
564
- return_type = opts[:debug_return_type] || 'Domain'
564
+ return_type = opts[:debug_return_type] || 'ReturnPath'
565
565
 
566
566
  # auth_names
567
567
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
568
568
 
569
569
  new_options = opts.merge(
570
- :operation => :"DomainsApi.v1_domains_post",
570
+ :operation => :"DomainsApi.verify_return_path",
571
571
  :header_params => header_params,
572
572
  :query_params => query_params,
573
573
  :form_params => form_params,
@@ -578,7 +578,7 @@ module Lockally
578
578
 
579
579
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
580
580
  if @api_client.config.debugging
581
- @api_client.config.logger.debug "API called: DomainsApi#v1_domains_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
581
+ @api_client.config.logger.debug "API called: DomainsApi#verify_return_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
582
582
  end
583
583
  return data, status_code, headers
584
584
  end