zyphr 0.1.32 → 0.1.34

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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +54 -0
  3. data/docs/AddOrganizationMemberRequest.md +20 -0
  4. data/docs/AuthOrganizationsApi.md +864 -0
  5. data/docs/AuthUserProfileApi.md +76 -0
  6. data/docs/CreateOrganizationRequest.md +22 -0
  7. data/docs/DomainsApi.md +73 -0
  8. data/docs/InboundAttachmentUrlResponse.md +20 -0
  9. data/docs/InboundAttachmentUrlResponseData.md +22 -0
  10. data/docs/InboundEmail.md +48 -0
  11. data/docs/InboundEmailApi.md +235 -0
  12. data/docs/InboundEmailAttachment.md +24 -0
  13. data/docs/InboundEmailFrom.md +20 -0
  14. data/docs/InboundEmailListResponse.md +20 -0
  15. data/docs/InboundEmailListResponseMeta.md +24 -0
  16. data/docs/InboundEmailResponse.md +20 -0
  17. data/docs/LoginRequest.md +3 -1
  18. data/docs/MuseApi.md +681 -0
  19. data/docs/Organization.md +34 -0
  20. data/docs/OrganizationListResponse.md +20 -0
  21. data/docs/OrganizationListResponseMeta.md +20 -0
  22. data/docs/OrganizationMembersListResponse.md +20 -0
  23. data/docs/OrganizationMembership.md +30 -0
  24. data/docs/OrganizationMembershipResponse.md +20 -0
  25. data/docs/OrganizationMembershipWithUser.md +34 -0
  26. data/docs/OrganizationResponse.md +20 -0
  27. data/docs/RegisterRequest.md +5 -1
  28. data/docs/SetDomainInboundRequest.md +18 -0
  29. data/docs/SwitchOrganizationRequest.md +20 -0
  30. data/docs/SwitchOrganizationResponse.md +20 -0
  31. data/docs/SwitchOrganizationResponseData.md +22 -0
  32. data/docs/SwitchOrganizationResponseDataTokens.md +24 -0
  33. data/docs/SwitchOrganizationResponseDataUser.md +20 -0
  34. data/docs/UpdateOrganizationMemberRoleRequest.md +18 -0
  35. data/docs/UpdateOrganizationRequest.md +22 -0
  36. data/docs/V1MuseSubjectsSuggestPostRequest.md +24 -0
  37. data/lib/zyphr/api/auth_organizations_api.rb +773 -0
  38. data/lib/zyphr/api/auth_user_profile_api.rb +61 -0
  39. data/lib/zyphr/api/domains_api.rb +72 -0
  40. data/lib/zyphr/api/inbound_email_api.rb +234 -0
  41. data/lib/zyphr/api/muse_api.rb +644 -0
  42. data/lib/zyphr/models/add_organization_member_request.rb +248 -0
  43. data/lib/zyphr/models/create_organization_request.rb +258 -0
  44. data/lib/zyphr/models/inbound_attachment_url_response.rb +229 -0
  45. data/lib/zyphr/models/inbound_attachment_url_response_data.rb +240 -0
  46. data/lib/zyphr/models/inbound_email.rb +441 -0
  47. data/lib/zyphr/models/inbound_email_attachment.rb +250 -0
  48. data/lib/zyphr/models/inbound_email_from.rb +230 -0
  49. data/lib/zyphr/models/inbound_email_list_response.rb +231 -0
  50. data/lib/zyphr/models/inbound_email_list_response_meta.rb +247 -0
  51. data/lib/zyphr/models/inbound_email_response.rb +229 -0
  52. data/lib/zyphr/models/login_request.rb +14 -4
  53. data/lib/zyphr/models/organization.rb +434 -0
  54. data/lib/zyphr/models/organization_list_response.rb +265 -0
  55. data/lib/zyphr/models/organization_list_response_meta.rb +230 -0
  56. data/lib/zyphr/models/organization_members_list_response.rb +265 -0
  57. data/lib/zyphr/models/organization_membership.rb +379 -0
  58. data/lib/zyphr/models/organization_membership_response.rb +263 -0
  59. data/lib/zyphr/models/organization_membership_with_user.rb +405 -0
  60. data/lib/zyphr/models/organization_response.rb +263 -0
  61. data/lib/zyphr/models/register_request.rb +43 -4
  62. data/lib/zyphr/models/set_domain_inbound_request.rb +220 -0
  63. data/lib/zyphr/models/switch_organization_request.rb +263 -0
  64. data/lib/zyphr/models/switch_organization_response.rb +263 -0
  65. data/lib/zyphr/models/switch_organization_response_data.rb +289 -0
  66. data/lib/zyphr/models/switch_organization_response_data_tokens.rb +339 -0
  67. data/lib/zyphr/models/switch_organization_response_data_user.rb +230 -0
  68. data/lib/zyphr/models/update_organization_member_role_request.rb +223 -0
  69. data/lib/zyphr/models/update_organization_request.rb +239 -0
  70. data/lib/zyphr/models/v1_muse_subjects_suggest_post_request.rb +326 -0
  71. data/lib/zyphr.rb +30 -0
  72. data/spec/api/auth_organizations_api_spec.rb +171 -0
  73. data/spec/api/auth_user_profile_api_spec.rb +12 -0
  74. data/spec/api/domains_api_spec.rb +13 -0
  75. data/spec/api/inbound_email_api_spec.rb +76 -0
  76. data/spec/api/muse_api_spec.rb +156 -0
  77. data/spec/models/add_organization_member_request_spec.rb +42 -0
  78. data/spec/models/create_organization_request_spec.rb +48 -0
  79. data/spec/models/inbound_attachment_url_response_data_spec.rb +48 -0
  80. data/spec/models/inbound_attachment_url_response_spec.rb +42 -0
  81. data/spec/models/inbound_email_attachment_spec.rb +54 -0
  82. data/spec/models/inbound_email_from_spec.rb +42 -0
  83. data/spec/models/inbound_email_list_response_meta_spec.rb +54 -0
  84. data/spec/models/inbound_email_list_response_spec.rb +42 -0
  85. data/spec/models/inbound_email_response_spec.rb +42 -0
  86. data/spec/models/inbound_email_spec.rb +142 -0
  87. data/spec/models/login_request_spec.rb +6 -0
  88. data/spec/models/organization_list_response_meta_spec.rb +42 -0
  89. data/spec/models/organization_list_response_spec.rb +42 -0
  90. data/spec/models/organization_members_list_response_spec.rb +42 -0
  91. data/spec/models/organization_membership_response_spec.rb +42 -0
  92. data/spec/models/organization_membership_spec.rb +72 -0
  93. data/spec/models/organization_membership_with_user_spec.rb +84 -0
  94. data/spec/models/organization_response_spec.rb +42 -0
  95. data/spec/models/organization_spec.rb +84 -0
  96. data/spec/models/register_request_spec.rb +12 -0
  97. data/spec/models/set_domain_inbound_request_spec.rb +36 -0
  98. data/spec/models/switch_organization_request_spec.rb +42 -0
  99. data/spec/models/switch_organization_response_data_spec.rb +48 -0
  100. data/spec/models/switch_organization_response_data_tokens_spec.rb +58 -0
  101. data/spec/models/switch_organization_response_data_user_spec.rb +42 -0
  102. data/spec/models/switch_organization_response_spec.rb +42 -0
  103. data/spec/models/update_organization_member_role_request_spec.rb +36 -0
  104. data/spec/models/update_organization_request_spec.rb +48 -0
  105. data/spec/models/v1_muse_subjects_suggest_post_request_spec.rb +58 -0
  106. data/zyphr.gemspec +1 -1
  107. metadata +122 -2
@@ -76,6 +76,67 @@ module Zyphr
76
76
  return data, status_code, headers
77
77
  end
78
78
 
79
+ # Delete an end user (test environment only)
80
+ # App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status='deleted'), and emits a `user.deleted` webhook with `method='application_admin'`. The audit log row survives (no FK to end_users), so org-history queries still resolve. Intended for smoke / test-fixture cleanup. Production deletes should continue to use `DELETE /auth/users/me` from the end-user's own session or the dashboard.
81
+ # @param user_id [String]
82
+ # @param [Hash] opts the optional parameters
83
+ # @return [nil]
84
+ def delete_end_user_by_application(user_id, opts = {})
85
+ delete_end_user_by_application_with_http_info(user_id, opts)
86
+ nil
87
+ end
88
+
89
+ # Delete an end user (test environment only)
90
+ # App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status='deleted'), and emits a `user.deleted` webhook with `method='application_admin'`. The audit log row survives (no FK to end_users), so org-history queries still resolve. Intended for smoke / test-fixture cleanup. Production deletes should continue to use `DELETE /auth/users/me` from the end-user's own session or the dashboard.
91
+ # @param user_id [String]
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
94
+ def delete_end_user_by_application_with_http_info(user_id, opts = {})
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug 'Calling API: AuthUserProfileApi.delete_end_user_by_application ...'
97
+ end
98
+ # verify the required parameter 'user_id' is set
99
+ if @api_client.config.client_side_validation && user_id.nil?
100
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling AuthUserProfileApi.delete_end_user_by_application"
101
+ end
102
+ # resource path
103
+ local_var_path = '/auth/users/{user_id}'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
104
+
105
+ # query parameters
106
+ query_params = opts[:query_params] || {}
107
+
108
+ # header parameters
109
+ header_params = opts[:header_params] || {}
110
+
111
+ # form parameters
112
+ form_params = opts[:form_params] || {}
113
+
114
+ # http body (model)
115
+ post_body = opts[:debug_body]
116
+
117
+ # return_type
118
+ return_type = opts[:debug_return_type]
119
+
120
+ # auth_names
121
+ auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
122
+
123
+ new_options = opts.merge(
124
+ :operation => :"AuthUserProfileApi.delete_end_user_by_application",
125
+ :header_params => header_params,
126
+ :query_params => query_params,
127
+ :form_params => form_params,
128
+ :body => post_body,
129
+ :auth_names => auth_names,
130
+ :return_type => return_type
131
+ )
132
+
133
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
134
+ if @api_client.config.debugging
135
+ @api_client.config.logger.debug "API called: AuthUserProfileApi#delete_end_user_by_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
136
+ end
137
+ return data, status_code, headers
138
+ end
139
+
79
140
  # Get current end user profile
80
141
  # Retrieve the profile of the currently authenticated end user.
81
142
  # @param [Hash] opts the optional parameters
@@ -333,6 +333,78 @@ module Zyphr
333
333
  return data, status_code, headers
334
334
  end
335
335
 
336
+ # Enable or disable inbound email for a domain
337
+ # Toggle email receiving for a domain. When enabled, the domain's DNS records gain an MX record on the `inbound.` subdomain that the tenant must publish. Requires a plan with inbound email (Starter+).
338
+ # @param id [String]
339
+ # @param set_domain_inbound_request [SetDomainInboundRequest]
340
+ # @param [Hash] opts the optional parameters
341
+ # @return [nil]
342
+ def set_domain_inbound(id, set_domain_inbound_request, opts = {})
343
+ set_domain_inbound_with_http_info(id, set_domain_inbound_request, opts)
344
+ nil
345
+ end
346
+
347
+ # Enable or disable inbound email for a domain
348
+ # Toggle email receiving for a domain. When enabled, the domain&#39;s DNS records gain an MX record on the &#x60;inbound.&#x60; subdomain that the tenant must publish. Requires a plan with inbound email (Starter+).
349
+ # @param id [String]
350
+ # @param set_domain_inbound_request [SetDomainInboundRequest]
351
+ # @param [Hash] opts the optional parameters
352
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
353
+ def set_domain_inbound_with_http_info(id, set_domain_inbound_request, opts = {})
354
+ if @api_client.config.debugging
355
+ @api_client.config.logger.debug 'Calling API: DomainsApi.set_domain_inbound ...'
356
+ end
357
+ # verify the required parameter 'id' is set
358
+ if @api_client.config.client_side_validation && id.nil?
359
+ fail ArgumentError, "Missing the required parameter 'id' when calling DomainsApi.set_domain_inbound"
360
+ end
361
+ # verify the required parameter 'set_domain_inbound_request' is set
362
+ if @api_client.config.client_side_validation && set_domain_inbound_request.nil?
363
+ fail ArgumentError, "Missing the required parameter 'set_domain_inbound_request' when calling DomainsApi.set_domain_inbound"
364
+ end
365
+ # resource path
366
+ local_var_path = '/domains/{id}/inbound'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
367
+
368
+ # query parameters
369
+ query_params = opts[:query_params] || {}
370
+
371
+ # header parameters
372
+ header_params = opts[:header_params] || {}
373
+ # HTTP header 'Content-Type'
374
+ content_type = @api_client.select_header_content_type(['application/json'])
375
+ if !content_type.nil?
376
+ header_params['Content-Type'] = content_type
377
+ end
378
+
379
+ # form parameters
380
+ form_params = opts[:form_params] || {}
381
+
382
+ # http body (model)
383
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(set_domain_inbound_request)
384
+
385
+ # return_type
386
+ return_type = opts[:debug_return_type]
387
+
388
+ # auth_names
389
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
390
+
391
+ new_options = opts.merge(
392
+ :operation => :"DomainsApi.set_domain_inbound",
393
+ :header_params => header_params,
394
+ :query_params => query_params,
395
+ :form_params => form_params,
396
+ :body => post_body,
397
+ :auth_names => auth_names,
398
+ :return_type => return_type
399
+ )
400
+
401
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
402
+ if @api_client.config.debugging
403
+ @api_client.config.logger.debug "API called: DomainsApi#set_domain_inbound\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
404
+ end
405
+ return data, status_code, headers
406
+ end
407
+
336
408
  # Trigger domain verification
337
409
  # Queue an asynchronous DNS verification check. Returns immediately with a `job_id`. Poll `GET /v1/domains/{id}/verification-status` (or the higher-level `GET /v1/domains/{id}`) for the result, or subscribe to the `domain.verified` webhook event when sc-5444 ships. Returns 409 if a verification is already in progress for this domain (within the last 2 minutes).
338
410
  # @param id [String]
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Zyphr API
3
+
4
+ #Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@zyphr.dev
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Zyphr
16
+ class InboundEmailApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get an attachment download URL
23
+ # Return a short-lived presigned S3 download URL for one attachment of a received email. `attachmentId` is the positional id from the email's `attachments` array.
24
+ # @param id [String]
25
+ # @param attachment_id [String]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [InboundAttachmentUrlResponse]
28
+ def get_inbound_attachment_url(id, attachment_id, opts = {})
29
+ data, _status_code, _headers = get_inbound_attachment_url_with_http_info(id, attachment_id, opts)
30
+ data
31
+ end
32
+
33
+ # Get an attachment download URL
34
+ # Return a short-lived presigned S3 download URL for one attachment of a received email. &#x60;attachmentId&#x60; is the positional id from the email&#39;s &#x60;attachments&#x60; array.
35
+ # @param id [String]
36
+ # @param attachment_id [String]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(InboundAttachmentUrlResponse, Integer, Hash)>] InboundAttachmentUrlResponse data, response status code and response headers
39
+ def get_inbound_attachment_url_with_http_info(id, attachment_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: InboundEmailApi.get_inbound_attachment_url ...'
42
+ end
43
+ # verify the required parameter 'id' is set
44
+ if @api_client.config.client_side_validation && id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'id' when calling InboundEmailApi.get_inbound_attachment_url"
46
+ end
47
+ # verify the required parameter 'attachment_id' is set
48
+ if @api_client.config.client_side_validation && attachment_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'attachment_id' when calling InboundEmailApi.get_inbound_attachment_url"
50
+ end
51
+ # resource path
52
+ local_var_path = '/inbound-emails/{id}/attachments/{attachmentId}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'attachmentId' + '}', CGI.escape(attachment_id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:debug_body]
67
+
68
+ # return_type
69
+ return_type = opts[:debug_return_type] || 'InboundAttachmentUrlResponse'
70
+
71
+ # auth_names
72
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
73
+
74
+ new_options = opts.merge(
75
+ :operation => :"InboundEmailApi.get_inbound_attachment_url",
76
+ :header_params => header_params,
77
+ :query_params => query_params,
78
+ :form_params => form_params,
79
+ :body => post_body,
80
+ :auth_names => auth_names,
81
+ :return_type => return_type
82
+ )
83
+
84
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
85
+ if @api_client.config.debugging
86
+ @api_client.config.logger.debug "API called: InboundEmailApi#get_inbound_attachment_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
87
+ end
88
+ return data, status_code, headers
89
+ end
90
+
91
+ # Get a received email
92
+ # Retrieve a single inbound email by id (scoped to the project).
93
+ # @param id [String]
94
+ # @param [Hash] opts the optional parameters
95
+ # @return [InboundEmailResponse]
96
+ def get_inbound_email(id, opts = {})
97
+ data, _status_code, _headers = get_inbound_email_with_http_info(id, opts)
98
+ data
99
+ end
100
+
101
+ # Get a received email
102
+ # Retrieve a single inbound email by id (scoped to the project).
103
+ # @param id [String]
104
+ # @param [Hash] opts the optional parameters
105
+ # @return [Array<(InboundEmailResponse, Integer, Hash)>] InboundEmailResponse data, response status code and response headers
106
+ def get_inbound_email_with_http_info(id, opts = {})
107
+ if @api_client.config.debugging
108
+ @api_client.config.logger.debug 'Calling API: InboundEmailApi.get_inbound_email ...'
109
+ end
110
+ # verify the required parameter 'id' is set
111
+ if @api_client.config.client_side_validation && id.nil?
112
+ fail ArgumentError, "Missing the required parameter 'id' when calling InboundEmailApi.get_inbound_email"
113
+ end
114
+ # resource path
115
+ local_var_path = '/inbound-emails/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
116
+
117
+ # query parameters
118
+ query_params = opts[:query_params] || {}
119
+
120
+ # header parameters
121
+ header_params = opts[:header_params] || {}
122
+ # HTTP header 'Accept' (if needed)
123
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
124
+
125
+ # form parameters
126
+ form_params = opts[:form_params] || {}
127
+
128
+ # http body (model)
129
+ post_body = opts[:debug_body]
130
+
131
+ # return_type
132
+ return_type = opts[:debug_return_type] || 'InboundEmailResponse'
133
+
134
+ # auth_names
135
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
136
+
137
+ new_options = opts.merge(
138
+ :operation => :"InboundEmailApi.get_inbound_email",
139
+ :header_params => header_params,
140
+ :query_params => query_params,
141
+ :form_params => form_params,
142
+ :body => post_body,
143
+ :auth_names => auth_names,
144
+ :return_type => return_type
145
+ )
146
+
147
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug "API called: InboundEmailApi#get_inbound_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
150
+ end
151
+ return data, status_code, headers
152
+ end
153
+
154
+ # List received emails
155
+ # List inbound (received) emails for the project, newest first. By default only delivered mail (`received`/`processed`) is returned; pass `include_withheld=true` to also see quarantined/dropped.
156
+ # @param [Hash] opts the optional parameters
157
+ # @option opts [String] :status
158
+ # @option opts [String] :to Filter by receiving address
159
+ # @option opts [Boolean] :include_withheld Include quarantined/dropped mail
160
+ # @option opts [Integer] :limit (default to 50)
161
+ # @option opts [Integer] :offset (default to 0)
162
+ # @return [InboundEmailListResponse]
163
+ def list_inbound_emails(opts = {})
164
+ data, _status_code, _headers = list_inbound_emails_with_http_info(opts)
165
+ data
166
+ end
167
+
168
+ # List received emails
169
+ # List inbound (received) emails for the project, newest first. By default only delivered mail (&#x60;received&#x60;/&#x60;processed&#x60;) is returned; pass &#x60;include_withheld&#x3D;true&#x60; to also see quarantined/dropped.
170
+ # @param [Hash] opts the optional parameters
171
+ # @option opts [String] :status
172
+ # @option opts [String] :to Filter by receiving address
173
+ # @option opts [Boolean] :include_withheld Include quarantined/dropped mail
174
+ # @option opts [Integer] :limit (default to 50)
175
+ # @option opts [Integer] :offset (default to 0)
176
+ # @return [Array<(InboundEmailListResponse, Integer, Hash)>] InboundEmailListResponse data, response status code and response headers
177
+ def list_inbound_emails_with_http_info(opts = {})
178
+ if @api_client.config.debugging
179
+ @api_client.config.logger.debug 'Calling API: InboundEmailApi.list_inbound_emails ...'
180
+ end
181
+ allowable_values = ["received", "processed", "quarantined", "dropped", "failed"]
182
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
183
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
184
+ end
185
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
186
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling InboundEmailApi.list_inbound_emails, must be smaller than or equal to 100.'
187
+ end
188
+
189
+ # resource path
190
+ local_var_path = '/inbound-emails'
191
+
192
+ # query parameters
193
+ query_params = opts[:query_params] || {}
194
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
195
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
196
+ query_params[:'include_withheld'] = opts[:'include_withheld'] if !opts[:'include_withheld'].nil?
197
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
198
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
199
+
200
+ # header parameters
201
+ header_params = opts[:header_params] || {}
202
+ # HTTP header 'Accept' (if needed)
203
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
204
+
205
+ # form parameters
206
+ form_params = opts[:form_params] || {}
207
+
208
+ # http body (model)
209
+ post_body = opts[:debug_body]
210
+
211
+ # return_type
212
+ return_type = opts[:debug_return_type] || 'InboundEmailListResponse'
213
+
214
+ # auth_names
215
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
216
+
217
+ new_options = opts.merge(
218
+ :operation => :"InboundEmailApi.list_inbound_emails",
219
+ :header_params => header_params,
220
+ :query_params => query_params,
221
+ :form_params => form_params,
222
+ :body => post_body,
223
+ :auth_names => auth_names,
224
+ :return_type => return_type
225
+ )
226
+
227
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
228
+ if @api_client.config.debugging
229
+ @api_client.config.logger.debug "API called: InboundEmailApi#list_inbound_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
230
+ end
231
+ return data, status_code, headers
232
+ end
233
+ end
234
+ end