qubrics-sending 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +57 -0
  3. data/LICENSE +21 -0
  4. data/README.md +112 -0
  5. data/lib/qubrics/sending/client.rb +71 -0
  6. data/lib/qubrics/sending/version.rb +7 -0
  7. data/lib/qubrics/sending.rb +12 -0
  8. data/lib/qubrics_sending_generated/api/attachments_api.rb +373 -0
  9. data/lib/qubrics_sending_generated/api/emails_api.rb +172 -0
  10. data/lib/qubrics_sending_generated/api/meta_api.rb +142 -0
  11. data/lib/qubrics_sending_generated/api_client.rb +447 -0
  12. data/lib/qubrics_sending_generated/api_error.rb +58 -0
  13. data/lib/qubrics_sending_generated/api_model_base.rb +95 -0
  14. data/lib/qubrics_sending_generated/configuration.rb +413 -0
  15. data/lib/qubrics_sending_generated/models/address.rb +215 -0
  16. data/lib/qubrics_sending_generated/models/attachment.rb +103 -0
  17. data/lib/qubrics_sending_generated/models/attachment_upload_data.rb +284 -0
  18. data/lib/qubrics_sending_generated/models/attachment_upload_intent_data.rb +337 -0
  19. data/lib/qubrics_sending_generated/models/attachment_upload_intent_request.rb +279 -0
  20. data/lib/qubrics_sending_generated/models/attachment_upload_intent_response.rb +223 -0
  21. data/lib/qubrics_sending_generated/models/attachment_upload_response.rb +223 -0
  22. data/lib/qubrics_sending_generated/models/batch_result_item.rb +256 -0
  23. data/lib/qubrics_sending_generated/models/batch_send_request.rb +185 -0
  24. data/lib/qubrics_sending_generated/models/batch_send_success_data.rb +192 -0
  25. data/lib/qubrics_sending_generated/models/batch_send_success_response.rb +223 -0
  26. data/lib/qubrics_sending_generated/models/batch_summary.rb +219 -0
  27. data/lib/qubrics_sending_generated/models/connection.rb +273 -0
  28. data/lib/qubrics_sending_generated/models/connection_credential.rb +226 -0
  29. data/lib/qubrics_sending_generated/models/connection_mailboxes_inner.rb +190 -0
  30. data/lib/qubrics_sending_generated/models/connection_response.rb +223 -0
  31. data/lib/qubrics_sending_generated/models/connection_team.rb +190 -0
  32. data/lib/qubrics_sending_generated/models/email_send_request.rb +474 -0
  33. data/lib/qubrics_sending_generated/models/email_send_request_delivery_group.rb +105 -0
  34. data/lib/qubrics_sending_generated/models/error_detail.rb +251 -0
  35. data/lib/qubrics_sending_generated/models/error_issue.rb +219 -0
  36. data/lib/qubrics_sending_generated/models/error_response.rb +216 -0
  37. data/lib/qubrics_sending_generated/models/inline_attachment.rb +274 -0
  38. data/lib/qubrics_sending_generated/models/meta.rb +165 -0
  39. data/lib/qubrics_sending_generated/models/recipient.rb +214 -0
  40. data/lib/qubrics_sending_generated/models/send_success_data.rb +227 -0
  41. data/lib/qubrics_sending_generated/models/send_success_response.rb +223 -0
  42. data/lib/qubrics_sending_generated/models/success_envelope.rb +190 -0
  43. data/lib/qubrics_sending_generated/models/uploaded_attachment_ref.rb +176 -0
  44. data/lib/qubrics_sending_generated/version.rb +15 -0
  45. data/lib/qubrics_sending_generated.rb +72 -0
  46. metadata +168 -0
@@ -0,0 +1,172 @@
1
+ =begin
2
+ #Qubrics Sending API
3
+
4
+ #Send emails programmatically via the Qubrics email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Qubrics::Sending::Generated
16
+ class EmailsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Send a single email
23
+ # Queue a single email for delivery. Requires `email.send` permission.
24
+ # @param email_send_request [EmailSendRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
27
+ # @return [SendSuccessResponse]
28
+ def sending_send_email(email_send_request, opts = {})
29
+ data, _status_code, _headers = sending_send_email_with_http_info(email_send_request, opts)
30
+ data
31
+ end
32
+
33
+ # Send a single email
34
+ # Queue a single email for delivery. Requires `email.send` permission.
35
+ # @param email_send_request [EmailSendRequest]
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
38
+ # @return [Array<(SendSuccessResponse, Integer, Hash)>] SendSuccessResponse data, response status code and response headers
39
+ def sending_send_email_with_http_info(email_send_request, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: EmailsApi.sending_send_email ...'
42
+ end
43
+ # verify the required parameter 'email_send_request' is set
44
+ if @api_client.config.client_side_validation && email_send_request.nil?
45
+ fail ArgumentError, "Missing the required parameter 'email_send_request' when calling EmailsApi.sending_send_email"
46
+ end
47
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
48
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling EmailsApi.sending_send_email, the character length must be smaller than or equal to 255.'
49
+ end
50
+
51
+ # resource path
52
+ local_var_path = '/emails/send'
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
+ # HTTP header 'Content-Type'
62
+ content_type = @api_client.select_header_content_type(['application/json'])
63
+ if !content_type.nil?
64
+ header_params['Content-Type'] = content_type
65
+ end
66
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+
71
+ # http body (model)
72
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(email_send_request)
73
+
74
+ # return_type
75
+ return_type = opts[:debug_return_type] || 'SendSuccessResponse'
76
+
77
+ # auth_names
78
+ auth_names = opts[:debug_auth_names] || ['OAuth2', 'BearerAuth']
79
+
80
+ new_options = opts.merge(
81
+ :operation => :"EmailsApi.sending_send_email",
82
+ :header_params => header_params,
83
+ :query_params => query_params,
84
+ :form_params => form_params,
85
+ :body => post_body,
86
+ :auth_names => auth_names,
87
+ :return_type => return_type
88
+ )
89
+
90
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "API called: EmailsApi#sending_send_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ end
94
+ return data, status_code, headers
95
+ end
96
+
97
+ # Send a batch of emails
98
+ # Queue up to 100 emails for delivery in a single request. Uses partial success model — individual message failures do not fail the entire batch. Requires `email.send` permission.
99
+ # @param batch_send_request [BatchSendRequest]
100
+ # @param [Hash] opts the optional parameters
101
+ # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
102
+ # @return [BatchSendSuccessResponse]
103
+ def sending_send_email_batch(batch_send_request, opts = {})
104
+ data, _status_code, _headers = sending_send_email_batch_with_http_info(batch_send_request, opts)
105
+ data
106
+ end
107
+
108
+ # Send a batch of emails
109
+ # Queue up to 100 emails for delivery in a single request. Uses partial success model — individual message failures do not fail the entire batch. Requires &#x60;email.send&#x60; permission.
110
+ # @param batch_send_request [BatchSendRequest]
111
+ # @param [Hash] opts the optional parameters
112
+ # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
113
+ # @return [Array<(BatchSendSuccessResponse, Integer, Hash)>] BatchSendSuccessResponse data, response status code and response headers
114
+ def sending_send_email_batch_with_http_info(batch_send_request, opts = {})
115
+ if @api_client.config.debugging
116
+ @api_client.config.logger.debug 'Calling API: EmailsApi.sending_send_email_batch ...'
117
+ end
118
+ # verify the required parameter 'batch_send_request' is set
119
+ if @api_client.config.client_side_validation && batch_send_request.nil?
120
+ fail ArgumentError, "Missing the required parameter 'batch_send_request' when calling EmailsApi.sending_send_email_batch"
121
+ end
122
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
123
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling EmailsApi.sending_send_email_batch, the character length must be smaller than or equal to 255.'
124
+ end
125
+
126
+ # resource path
127
+ local_var_path = '/emails/send/batch'
128
+
129
+ # query parameters
130
+ query_params = opts[:query_params] || {}
131
+
132
+ # header parameters
133
+ header_params = opts[:header_params] || {}
134
+ # HTTP header 'Accept' (if needed)
135
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
136
+ # HTTP header 'Content-Type'
137
+ content_type = @api_client.select_header_content_type(['application/json'])
138
+ if !content_type.nil?
139
+ header_params['Content-Type'] = content_type
140
+ end
141
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
142
+
143
+ # form parameters
144
+ form_params = opts[:form_params] || {}
145
+
146
+ # http body (model)
147
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_send_request)
148
+
149
+ # return_type
150
+ return_type = opts[:debug_return_type] || 'BatchSendSuccessResponse'
151
+
152
+ # auth_names
153
+ auth_names = opts[:debug_auth_names] || ['OAuth2', 'BearerAuth']
154
+
155
+ new_options = opts.merge(
156
+ :operation => :"EmailsApi.sending_send_email_batch",
157
+ :header_params => header_params,
158
+ :query_params => query_params,
159
+ :form_params => form_params,
160
+ :body => post_body,
161
+ :auth_names => auth_names,
162
+ :return_type => return_type
163
+ )
164
+
165
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug "API called: EmailsApi#sending_send_email_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
168
+ end
169
+ return data, status_code, headers
170
+ end
171
+ end
172
+ end
@@ -0,0 +1,142 @@
1
+ =begin
2
+ #Qubrics Sending API
3
+
4
+ #Send emails programmatically via the Qubrics email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Qubrics::Sending::Generated
16
+ class MetaApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get Sending connection
23
+ # Validate this Sending credential and return its team, connection label, permissions and authorised mailboxes. Requires email.send. Credits, provider readiness and mailbox storage are not checked. No user profile or secrets are returned.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :if_none_match Weak ETag from a previous response. When it matches the current resource, the server returns 304 Not Modified with no body.
26
+ # @return [ConnectionResponse]
27
+ def sending_get_connection(opts = {})
28
+ data, _status_code, _headers = sending_get_connection_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Get Sending connection
33
+ # Validate this Sending credential and return its team, connection label, permissions and authorised mailboxes. Requires email.send. Credits, provider readiness and mailbox storage are not checked. No user profile or secrets are returned.
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :if_none_match Weak ETag from a previous response. When it matches the current resource, the server returns 304 Not Modified with no body.
36
+ # @return [Array<(ConnectionResponse, Integer, Hash)>] ConnectionResponse data, response status code and response headers
37
+ def sending_get_connection_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: MetaApi.sending_get_connection ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/me'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
51
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
52
+
53
+ # form parameters
54
+ form_params = opts[:form_params] || {}
55
+
56
+ # http body (model)
57
+ post_body = opts[:debug_body]
58
+
59
+ # return_type
60
+ return_type = opts[:debug_return_type] || 'ConnectionResponse'
61
+
62
+ # auth_names
63
+ auth_names = opts[:debug_auth_names] || ['OAuth2', 'BearerAuth']
64
+
65
+ new_options = opts.merge(
66
+ :operation => :"MetaApi.sending_get_connection",
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => return_type
73
+ )
74
+
75
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: MetaApi#sending_get_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+
82
+ # OpenAPI 3.1 specification
83
+ # Auto-generated OpenAPI 3.1 spec for the Qubrics Sending API. Public endpoint (no authentication). Emits a weak ETag; clients may send `If-None-Match` to receive 304 Not Modified.
84
+ # @param [Hash] opts the optional parameters
85
+ # @option opts [String] :if_none_match Weak ETag from a previous response. When it matches the current resource, the server returns 304 Not Modified with no body.
86
+ # @return [Hash<String, Object>]
87
+ def sending_get_open_api_spec(opts = {})
88
+ data, _status_code, _headers = sending_get_open_api_spec_with_http_info(opts)
89
+ data
90
+ end
91
+
92
+ # OpenAPI 3.1 specification
93
+ # Auto-generated OpenAPI 3.1 spec for the Qubrics Sending API. Public endpoint (no authentication). Emits a weak ETag; clients may send &#x60;If-None-Match&#x60; to receive 304 Not Modified.
94
+ # @param [Hash] opts the optional parameters
95
+ # @option opts [String] :if_none_match Weak ETag from a previous response. When it matches the current resource, the server returns 304 Not Modified with no body.
96
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
97
+ def sending_get_open_api_spec_with_http_info(opts = {})
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug 'Calling API: MetaApi.sending_get_open_api_spec ...'
100
+ end
101
+ # resource path
102
+ local_var_path = '/openapi.json'
103
+
104
+ # query parameters
105
+ query_params = opts[:query_params] || {}
106
+
107
+ # header parameters
108
+ header_params = opts[:header_params] || {}
109
+ # HTTP header 'Accept' (if needed)
110
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
111
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
112
+
113
+ # form parameters
114
+ form_params = opts[:form_params] || {}
115
+
116
+ # http body (model)
117
+ post_body = opts[:debug_body]
118
+
119
+ # return_type
120
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
121
+
122
+ # auth_names
123
+ auth_names = opts[:debug_auth_names] || []
124
+
125
+ new_options = opts.merge(
126
+ :operation => :"MetaApi.sending_get_open_api_spec",
127
+ :header_params => header_params,
128
+ :query_params => query_params,
129
+ :form_params => form_params,
130
+ :body => post_body,
131
+ :auth_names => auth_names,
132
+ :return_type => return_type
133
+ )
134
+
135
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
136
+ if @api_client.config.debugging
137
+ @api_client.config.logger.debug "API called: MetaApi#sending_get_open_api_spec\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
138
+ end
139
+ return data, status_code, headers
140
+ end
141
+ end
142
+ end