mailslurp_client 11.8.13 → 11.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11ebaabec4bbbf121b6a4e25953c0c9facd1eca5f287d13652d58e8e148857d3
4
- data.tar.gz: 1b99f7d5e4dfc0079e8918051a83b7a32b81171dbd3eee85eaad1c9d4aa429ce
3
+ metadata.gz: a71ed75df545930dc62b3579bc134fa293d36c746fcd4471a738c1a2c1f29bcf
4
+ data.tar.gz: 416cd46b4cffb6f3a61fbd9fdc5543800c62670a68652621674ae450f5428daf
5
5
  SHA512:
6
- metadata.gz: a3da7479cb4a1577644c0113c3f0a04eafe3153e57825ee87dab7a7197fbf5ff110ee6aaa94ce90dd66a878112fe2e7a98d3c138ebe86c31bedbee0cd0271343
7
- data.tar.gz: e0ed6e71c82824d0b3d8e34b443f56f2e364c4aa16cd9b634442b51be529c02ea0e9adcfb8ad3b4748d3fc8d0a9059f6e1db16e46a63af18019ebaa3961a9e52
6
+ metadata.gz: '069aca4edc0db8dc46187d2796ba0a012b4f4c6ee6b684188147ebbf037ddab7362224db8512084cd13e4fe975aee83ec78c6bf897134ca265e276a9b1846cf5'
7
+ data.tar.gz: 0e65f158ed5b1bb606cf50b31736768109d836ceca535bee7552e038e8fcbca20aef2c6d06c21f78d64836b454a78559d72af3e6cb2af54c12eecf6c90591263
@@ -19,6 +19,192 @@ module MailSlurpClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Get email attachment as base64 encoded string (alternative to binary responses). To read the content decode the Base64 encoded contents.
23
+ # Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
24
+ # @param attachment_id [String] ID of attachment
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [DownloadAttachmentDto]
27
+ def download_attachment_as_base64_encoded(attachment_id, opts = {})
28
+ data, _status_code, _headers = download_attachment_as_base64_encoded_with_http_info(attachment_id, opts)
29
+ data
30
+ end
31
+
32
+ # Get email attachment as base64 encoded string (alternative to binary responses). To read the content decode the Base64 encoded contents.
33
+ # Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
34
+ # @param attachment_id [String] ID of attachment
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(DownloadAttachmentDto, Integer, Hash)>] DownloadAttachmentDto data, response status code and response headers
37
+ def download_attachment_as_base64_encoded_with_http_info(attachment_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.download_attachment_as_base64_encoded ...'
40
+ end
41
+ # verify the required parameter 'attachment_id' is set
42
+ if @api_client.config.client_side_validation && attachment_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AttachmentControllerApi.download_attachment_as_base64_encoded"
44
+ end
45
+ # resource path
46
+ local_var_path = '/attachments/{attachmentId}/base64'.sub('{' + 'attachmentId' + '}', CGI.escape(attachment_id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:body]
61
+
62
+ # return_type
63
+ return_type = opts[:return_type] || 'DownloadAttachmentDto'
64
+
65
+ # auth_names
66
+ auth_names = opts[:auth_names] || ['API_KEY']
67
+
68
+ new_options = opts.merge(
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => return_type
75
+ )
76
+
77
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
78
+ if @api_client.config.debugging
79
+ @api_client.config.logger.debug "API called: AttachmentControllerApi#download_attachment_as_base64_encoded\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
80
+ end
81
+ return data, status_code, headers
82
+ end
83
+
84
+ # Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
85
+ # Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
86
+ # @param attachment_id [String] ID of attachment
87
+ # @param [Hash] opts the optional parameters
88
+ # @return [String]
89
+ def download_attachment_as_bytes(attachment_id, opts = {})
90
+ data, _status_code, _headers = download_attachment_as_bytes_with_http_info(attachment_id, opts)
91
+ data
92
+ end
93
+
94
+ # Download attachments. Get email attachment bytes. If you have trouble with byte responses try the &#x60;downloadAttachmentBase64&#x60; response endpoints.
95
+ # Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
96
+ # @param attachment_id [String] ID of attachment
97
+ # @param [Hash] opts the optional parameters
98
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
99
+ def download_attachment_as_bytes_with_http_info(attachment_id, opts = {})
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.download_attachment_as_bytes ...'
102
+ end
103
+ # verify the required parameter 'attachment_id' is set
104
+ if @api_client.config.client_side_validation && attachment_id.nil?
105
+ fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AttachmentControllerApi.download_attachment_as_bytes"
106
+ end
107
+ # resource path
108
+ local_var_path = '/attachments/{attachmentId}/bytes'.sub('{' + 'attachmentId' + '}', CGI.escape(attachment_id.to_s))
109
+
110
+ # query parameters
111
+ query_params = opts[:query_params] || {}
112
+
113
+ # header parameters
114
+ header_params = opts[:header_params] || {}
115
+ # HTTP header 'Accept' (if needed)
116
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
117
+
118
+ # form parameters
119
+ form_params = opts[:form_params] || {}
120
+
121
+ # http body (model)
122
+ post_body = opts[:body]
123
+
124
+ # return_type
125
+ return_type = opts[:return_type] || 'String'
126
+
127
+ # auth_names
128
+ auth_names = opts[:auth_names] || ['API_KEY']
129
+
130
+ new_options = opts.merge(
131
+ :header_params => header_params,
132
+ :query_params => query_params,
133
+ :form_params => form_params,
134
+ :body => post_body,
135
+ :auth_names => auth_names,
136
+ :return_type => return_type
137
+ )
138
+
139
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
140
+ if @api_client.config.debugging
141
+ @api_client.config.logger.debug "API called: AttachmentControllerApi#download_attachment_as_bytes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
142
+ end
143
+ return data, status_code, headers
144
+ end
145
+
146
+ # Get email attachment metadata information
147
+ # Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties `name` and `content-type` and `content-length` in bytes for a given attachment.
148
+ # @param attachment_id [String] ID of attachment
149
+ # @param [Hash] opts the optional parameters
150
+ # @return [AttachmentMetaData]
151
+ def get_attachment_info(attachment_id, opts = {})
152
+ data, _status_code, _headers = get_attachment_info_with_http_info(attachment_id, opts)
153
+ data
154
+ end
155
+
156
+ # Get email attachment metadata information
157
+ # Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties &#x60;name&#x60; and &#x60;content-type&#x60; and &#x60;content-length&#x60; in bytes for a given attachment.
158
+ # @param attachment_id [String] ID of attachment
159
+ # @param [Hash] opts the optional parameters
160
+ # @return [Array<(AttachmentMetaData, Integer, Hash)>] AttachmentMetaData data, response status code and response headers
161
+ def get_attachment_info_with_http_info(attachment_id, opts = {})
162
+ if @api_client.config.debugging
163
+ @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.get_attachment_info ...'
164
+ end
165
+ # verify the required parameter 'attachment_id' is set
166
+ if @api_client.config.client_side_validation && attachment_id.nil?
167
+ fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AttachmentControllerApi.get_attachment_info"
168
+ end
169
+ # resource path
170
+ local_var_path = '/attachments/{attachmentId}/metadata'.sub('{' + 'attachmentId' + '}', CGI.escape(attachment_id.to_s))
171
+
172
+ # query parameters
173
+ query_params = opts[:query_params] || {}
174
+
175
+ # header parameters
176
+ header_params = opts[:header_params] || {}
177
+ # HTTP header 'Accept' (if needed)
178
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
179
+
180
+ # form parameters
181
+ form_params = opts[:form_params] || {}
182
+
183
+ # http body (model)
184
+ post_body = opts[:body]
185
+
186
+ # return_type
187
+ return_type = opts[:return_type] || 'AttachmentMetaData'
188
+
189
+ # auth_names
190
+ auth_names = opts[:auth_names] || ['API_KEY']
191
+
192
+ new_options = opts.merge(
193
+ :header_params => header_params,
194
+ :query_params => query_params,
195
+ :form_params => form_params,
196
+ :body => post_body,
197
+ :auth_names => auth_names,
198
+ :return_type => return_type
199
+ )
200
+
201
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
202
+ if @api_client.config.debugging
203
+ @api_client.config.logger.debug "API called: AttachmentControllerApi#get_attachment_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
204
+ end
205
+ return data, status_code, headers
206
+ end
207
+
22
208
  # Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
23
209
  # Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
24
210
  # @param upload_options [UploadAttachmentOptions] uploadOptions
@@ -18,13 +18,13 @@ module MailSlurpClient
18
18
  # Size of attachment in bytes
19
19
  attr_accessor :content_length
20
20
 
21
- # Content type of attachment
21
+ # Content type of attachment such as `image/png`
22
22
  attr_accessor :content_type
23
23
 
24
24
  # ID of attachment
25
25
  attr_accessor :id
26
26
 
27
- # Name of attachment
27
+ # Name of attachment if given
28
28
  attr_accessor :name
29
29
 
30
30
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -15,13 +15,13 @@ require 'date'
15
15
  module MailSlurpClient
16
16
  # Content of attachment
17
17
  class DownloadAttachmentDto
18
- # Base64 encoded string of attachment bytes. Decode the base64 string to get the raw file bytes
18
+ # Base64 encoded string of attachment bytes. Decode the base64 encoded string to get the raw contents. If the file has a content type such as `text/html` you can read the contents directly by converting it to string using `utf-8` encoding.
19
19
  attr_accessor :base64_file_contents
20
20
 
21
- # Content type of attachment
21
+ # Content type of attachment. Examples are `image/png`, `application/msword`, `text/csv` etc.
22
22
  attr_accessor :content_type
23
23
 
24
- # Size in bytes of attachment
24
+ # Size in bytes of attachment content
25
25
  attr_accessor :size_bytes
26
26
 
27
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '11.8.13'
14
+ VERSION = '11.9.0'
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailslurp_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.8.13
4
+ version: 11.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mailslurp