mailslurp_client 8.2.8 → 8.2.14

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: c939cc4a13acdfa00befd57219f03fb5043cfcd59388d515edb4fb998a5b6d79
4
- data.tar.gz: 0e2a9812fe11d95e8cf0fff0a529ab013a502ed09fb801088efb5cebeddea021
3
+ metadata.gz: 885a47966c945561dd2f0d6ded52689c21a44d055877e7ce1c6298cbfc7b6e43
4
+ data.tar.gz: a30ae7021cefd27456e10ff7503e6674ee45e822bf9c826c69289faec89133ba
5
5
  SHA512:
6
- metadata.gz: 9ec7920d5f89318fb2dc9dd36ee6c1f862e56d78fb7ec3b5d1db19f528f04fa7b494b0d20e1eee66953ccc115e569b4844ac020df7f2634e479bde828753b0ee
7
- data.tar.gz: 6a10885e285042aaf67a7ce890b512bea25205b358a2e0e3b84a2361e38e021ff81c3e04649ed246a7fc43e55eb9c18684c0682caf57e1038b9ea5f3167be6f0
6
+ metadata.gz: f91f21f8d50b6c154ae5a2240554734dce8c922c5e213f3a9a402959c286008a53b9c47f16da51e8e95c2d06ab3fb83f946324ccbba47281c0eb1237f15cba15
7
+ data.tar.gz: 69b0b31c1248e8660446d0eb35328bd659a80080c1b62cfd0bb79f08366ff422a9064e33b48d7a2770dd5ac4f1ce3da27731487c43adf117700e029ea572d014
@@ -22,6 +22,7 @@ require 'mailslurp_client/models/basic_auth_options'
22
22
  require 'mailslurp_client/models/bulk_send_email_options'
23
23
  require 'mailslurp_client/models/contact_dto'
24
24
  require 'mailslurp_client/models/contact_projection'
25
+ require 'mailslurp_client/models/content_match_options'
25
26
  require 'mailslurp_client/models/create_anonymous_alias_options'
26
27
  require 'mailslurp_client/models/create_contact_options'
27
28
  require 'mailslurp_client/models/create_domain_options'
@@ -36,6 +37,7 @@ require 'mailslurp_client/models/domain_preview'
36
37
  require 'mailslurp_client/models/download_attachment_dto'
37
38
  require 'mailslurp_client/models/email'
38
39
  require 'mailslurp_client/models/email_analysis'
40
+ require 'mailslurp_client/models/email_content_match_result'
39
41
  require 'mailslurp_client/models/email_preview'
40
42
  require 'mailslurp_client/models/email_projection'
41
43
  require 'mailslurp_client/models/email_verification_result'
@@ -20,7 +20,7 @@ module MailSlurpClient
20
20
  @api_client = api_client
21
21
  end
22
22
  # Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
23
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
23
+ # 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
24
  # @param upload_options [UploadAttachmentOptions] uploadOptions
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [Array<String>]
@@ -30,7 +30,7 @@ module MailSlurpClient
30
30
  end
31
31
 
32
32
  # Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
33
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
33
+ # 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 &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
34
34
  # @param upload_options [UploadAttachmentOptions] uploadOptions
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
@@ -84,7 +84,7 @@ module MailSlurpClient
84
84
  end
85
85
 
86
86
  # Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
87
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
87
+ # 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.
88
88
  # @param [Hash] opts the optional parameters
89
89
  # @option opts [String] :string Optional contentType for file. For instance &#x60;application/pdf&#x60;
90
90
  # @option opts [String] :filename Optional filename to save upload with
@@ -96,7 +96,7 @@ module MailSlurpClient
96
96
  end
97
97
 
98
98
  # Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
99
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
99
+ # 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 &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
100
100
  # @param [Hash] opts the optional parameters
101
101
  # @option opts [String] :string Optional contentType for file. For instance &#x60;application/pdf&#x60;
102
102
  # @option opts [String] :filename Optional filename to save upload with
@@ -150,7 +150,7 @@ module MailSlurpClient
150
150
  end
151
151
 
152
152
  # Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
153
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
153
+ # 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.
154
154
  # @param file [File] file
155
155
  # @param [Hash] opts the optional parameters
156
156
  # @option opts [String] :content_type Optional content type of attachment
@@ -163,7 +163,7 @@ module MailSlurpClient
163
163
  end
164
164
 
165
165
  # Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
166
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
166
+ # 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 &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
167
167
  # @param file [File] file
168
168
  # @param [Hash] opts the optional parameters
169
169
  # @option opts [String] :content_type Optional content type of attachment
@@ -535,6 +535,76 @@ module MailSlurpClient
535
535
  return data, status_code, headers
536
536
  end
537
537
 
538
+ # Get email content regex pattern match results. Runs regex against email body and returns match groups.
539
+ # Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
540
+ # @param email_id [String] ID of email to match against
541
+ # @param content_match_options [ContentMatchOptions] contentMatchOptions
542
+ # @param [Hash] opts the optional parameters
543
+ # @return [EmailContentMatchResult]
544
+ def get_email_content_match(email_id, content_match_options, opts = {})
545
+ data, _status_code, _headers = get_email_content_match_with_http_info(email_id, content_match_options, opts)
546
+ data
547
+ end
548
+
549
+ # Get email content regex pattern match results. Runs regex against email body and returns match groups.
550
+ # Return the matches for a given Java style regex pattern. Do not include the typical &#x60;/&#x60; at start or end of regex in some languages. Given an example &#x60;your code is: 12345&#x60; the pattern to extract match looks like &#x60;code is: (\\d{6})&#x60;. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: &#x60;[&#39;code is: 123456&#39;, &#39;123456&#39;]&#x60; See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
551
+ # @param email_id [String] ID of email to match against
552
+ # @param content_match_options [ContentMatchOptions] contentMatchOptions
553
+ # @param [Hash] opts the optional parameters
554
+ # @return [Array<(EmailContentMatchResult, Integer, Hash)>] EmailContentMatchResult data, response status code and response headers
555
+ def get_email_content_match_with_http_info(email_id, content_match_options, opts = {})
556
+ if @api_client.config.debugging
557
+ @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_content_match ...'
558
+ end
559
+ # verify the required parameter 'email_id' is set
560
+ if @api_client.config.client_side_validation && email_id.nil?
561
+ fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_content_match"
562
+ end
563
+ # verify the required parameter 'content_match_options' is set
564
+ if @api_client.config.client_side_validation && content_match_options.nil?
565
+ fail ArgumentError, "Missing the required parameter 'content_match_options' when calling EmailControllerApi.get_email_content_match"
566
+ end
567
+ # resource path
568
+ local_var_path = '/emails/{emailId}/contentMatch'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
569
+
570
+ # query parameters
571
+ query_params = opts[:query_params] || {}
572
+
573
+ # header parameters
574
+ header_params = opts[:header_params] || {}
575
+ # HTTP header 'Accept' (if needed)
576
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
577
+ # HTTP header 'Content-Type'
578
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
579
+
580
+ # form parameters
581
+ form_params = opts[:form_params] || {}
582
+
583
+ # http body (model)
584
+ post_body = opts[:body] || @api_client.object_to_http_body(content_match_options)
585
+
586
+ # return_type
587
+ return_type = opts[:return_type] || 'EmailContentMatchResult'
588
+
589
+ # auth_names
590
+ auth_names = opts[:auth_names] || ['API_KEY']
591
+
592
+ new_options = opts.merge(
593
+ :header_params => header_params,
594
+ :query_params => query_params,
595
+ :form_params => form_params,
596
+ :body => post_body,
597
+ :auth_names => auth_names,
598
+ :return_type => return_type
599
+ )
600
+
601
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
602
+ if @api_client.config.debugging
603
+ @api_client.config.logger.debug "API called: EmailControllerApi#get_email_content_match\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
604
+ end
605
+ return data, status_code, headers
606
+ end
607
+
538
608
  # Get email content as HTML
539
609
  # Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: `?apiKey=xxx`
540
610
  # @param email_id [String] emailId
@@ -691,7 +691,7 @@ module MailSlurpClient
691
691
  end
692
692
 
693
693
  # Send Email
694
- # Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails.
694
+ # Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`.
695
695
  # @param inbox_id [String] ID of the inbox you want to send the email from
696
696
  # @param [Hash] opts the optional parameters
697
697
  # @option opts [SendEmailOptions] :send_email_options Options for the email
@@ -702,7 +702,7 @@ module MailSlurpClient
702
702
  end
703
703
 
704
704
  # Send Email
705
- # Send an email from an inbox&#39;s email address. The request body should contain the &#x60;SendEmailOptions&#x60; that include recipients, attachments, body etc. See &#x60;SendEmailOptions&#x60; for all available properties. Note the &#x60;inboxId&#x60; refers to the inbox&#39;s id not the inbox&#39;s email address. See https://www.mailslurp.com/guides/ for more information on how to send emails.
705
+ # Send an email from an inbox&#39;s email address. The request body should contain the &#x60;SendEmailOptions&#x60; that include recipients, attachments, body etc. See &#x60;SendEmailOptions&#x60; for all available properties. Note the &#x60;inboxId&#x60; refers to the inbox&#39;s id not the inbox&#39;s email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method &#x60;sendEmailAndConfirm&#x60;.
706
706
  # @param inbox_id [String] ID of the inbox you want to send the email from
707
707
  # @param [Hash] opts the optional parameters
708
708
  # @option opts [SendEmailOptions] :send_email_options Options for the email
@@ -754,6 +754,72 @@ module MailSlurpClient
754
754
  return data, status_code, headers
755
755
  end
756
756
 
757
+ # Send email and return sent confirmation
758
+ # Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with link the the sent object created for it.
759
+ # @param inbox_id [String] ID of the inbox you want to send the email from
760
+ # @param [Hash] opts the optional parameters
761
+ # @option opts [SendEmailOptions] :send_email_options Options for the email
762
+ # @return [SentEmailDto]
763
+ def send_email_and_confirm(inbox_id, opts = {})
764
+ data, _status_code, _headers = send_email_and_confirm_with_http_info(inbox_id, opts)
765
+ data
766
+ end
767
+
768
+ # Send email and return sent confirmation
769
+ # Sister method for standard &#x60;sendEmail&#x60; method with the benefit of returning a &#x60;SentEmail&#x60; entity confirming the successful sending of the email with link the the sent object created for it.
770
+ # @param inbox_id [String] ID of the inbox you want to send the email from
771
+ # @param [Hash] opts the optional parameters
772
+ # @option opts [SendEmailOptions] :send_email_options Options for the email
773
+ # @return [Array<(SentEmailDto, Integer, Hash)>] SentEmailDto data, response status code and response headers
774
+ def send_email_and_confirm_with_http_info(inbox_id, opts = {})
775
+ if @api_client.config.debugging
776
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.send_email_and_confirm ...'
777
+ end
778
+ # verify the required parameter 'inbox_id' is set
779
+ if @api_client.config.client_side_validation && inbox_id.nil?
780
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.send_email_and_confirm"
781
+ end
782
+ # resource path
783
+ local_var_path = '/inboxes/{inboxId}/confirm'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
784
+
785
+ # query parameters
786
+ query_params = opts[:query_params] || {}
787
+
788
+ # header parameters
789
+ header_params = opts[:header_params] || {}
790
+ # HTTP header 'Accept' (if needed)
791
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
792
+ # HTTP header 'Content-Type'
793
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
794
+
795
+ # form parameters
796
+ form_params = opts[:form_params] || {}
797
+
798
+ # http body (model)
799
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'send_email_options'])
800
+
801
+ # return_type
802
+ return_type = opts[:return_type] || 'SentEmailDto'
803
+
804
+ # auth_names
805
+ auth_names = opts[:auth_names] || ['API_KEY']
806
+
807
+ new_options = opts.merge(
808
+ :header_params => header_params,
809
+ :query_params => query_params,
810
+ :form_params => form_params,
811
+ :body => post_body,
812
+ :auth_names => auth_names,
813
+ :return_type => return_type
814
+ )
815
+
816
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
817
+ if @api_client.config.debugging
818
+ @api_client.config.logger.debug "API called: InboxControllerApi#send_email_and_confirm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
819
+ end
820
+ return data, status_code, headers
821
+ end
822
+
757
823
  # Set inbox favourited state
758
824
  # Set and return new favourite state for an inbox
759
825
  # @param inbox_id [String] inboxId
@@ -213,7 +213,7 @@ module MailSlurpClient
213
213
  end
214
214
 
215
215
  # Wait or return list of emails that match simple matching patterns
216
- # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options.
216
+ # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
217
217
  # @param match_options [MatchOptions] matchOptions
218
218
  # @param [Hash] opts the optional parameters
219
219
  # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1
@@ -227,7 +227,7 @@ module MailSlurpClient
227
227
  end
228
228
 
229
229
  # Wait or return list of emails that match simple matching patterns
230
- # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the &#x60;MatchOptions&#x60; object for options.
230
+ # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the &#x60;MatchOptions&#x60; object for options. An example payload is &#x60;{ matches: [{field: &#39;SUBJECT&#39;,should:&#39;CONTAIN&#39;,value:&#39;needle&#39;}] }&#x60;. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController &#x60;getEmailContentMatch&#x60; method.
231
231
  # @param match_options [MatchOptions] matchOptions
232
232
  # @param [Hash] opts the optional parameters
233
233
  # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1
@@ -0,0 +1,208 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: 6.5.2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module MailSlurpClient
16
+ # Options for matching content using regex patterns based on Java Pattern syntax
17
+ class ContentMatchOptions
18
+ # Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
19
+ attr_accessor :pattern
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'pattern' => :'pattern'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'pattern' => :'String'
32
+ }
33
+ end
34
+
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ContentMatchOptions` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ContentMatchOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'pattern')
57
+ self.pattern = attributes[:'pattern']
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ true
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ pattern == o.pattern
80
+ end
81
+
82
+ # @see the `==` method
83
+ # @param [Object] Object to be compared
84
+ def eql?(o)
85
+ self == o
86
+ end
87
+
88
+ # Calculates hash code according to all attributes.
89
+ # @return [Integer] Hash code
90
+ def hash
91
+ [pattern].hash
92
+ end
93
+
94
+ # Builds the object from hash
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ # @return [Object] Returns the model itself
97
+ def self.build_from_hash(attributes)
98
+ new.build_from_hash(attributes)
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.openapi_types.each_pair do |key, type|
107
+ if type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
111
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :Boolean
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ MailSlurpClient.const_get(type).build_from_hash(value)
159
+ end
160
+ end
161
+
162
+ # Returns the string representation of the object
163
+ # @return [String] String presentation of the object
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # to_body is an alias to to_hash (backward compatibility)
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_body
171
+ to_hash
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map { |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+ end
208
+ end
@@ -0,0 +1,228 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: 6.5.2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module MailSlurpClient
16
+ # Matches for the given pattern
17
+ class EmailContentMatchResult
18
+ attr_accessor :matches
19
+
20
+ attr_accessor :pattern
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'matches' => :'matches',
26
+ :'pattern' => :'pattern'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.openapi_types
32
+ {
33
+ :'matches' => :'Array<String>',
34
+ :'pattern' => :'String'
35
+ }
36
+ end
37
+
38
+ # List of attributes with nullable: true
39
+ def self.openapi_nullable
40
+ Set.new([
41
+ ])
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::EmailContentMatchResult` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::EmailContentMatchResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'matches')
60
+ if (value = attributes[:'matches']).is_a?(Array)
61
+ self.matches = value
62
+ end
63
+ end
64
+
65
+ if attributes.key?(:'pattern')
66
+ self.pattern = attributes[:'pattern']
67
+ end
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ if @matches.nil?
75
+ invalid_properties.push('invalid value for "matches", matches cannot be nil.')
76
+ end
77
+
78
+ if @pattern.nil?
79
+ invalid_properties.push('invalid value for "pattern", pattern cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ return false if @matches.nil?
89
+ return false if @pattern.nil?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ matches == o.matches &&
99
+ pattern == o.pattern
100
+ end
101
+
102
+ # @see the `==` method
103
+ # @param [Object] Object to be compared
104
+ def eql?(o)
105
+ self == o
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Integer] Hash code
110
+ def hash
111
+ [matches, pattern].hash
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def self.build_from_hash(attributes)
118
+ new.build_from_hash(attributes)
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.openapi_types.each_pair do |key, type|
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ MailSlurpClient.const_get(type).build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+ end
228
+ end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- # Optional filter for matching emails based on fields. For instance filter results to only include emails whose `SUBJECT` value does `CONTAIN` given match value.
16
+ # Optional filter for matching emails based on fields. For instance filter results to only include emails whose `SUBJECT` value does `CONTAIN` given match value. An example payload would be `{ matches: [{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }] }`. If you wish to extract regex matches inside the email content see the `getEmailContentMatch` method in the EmailController.
17
17
  class MatchOptions
18
18
  # 1 or more match options. Options are additive so if one does not match the email is excluded from results
19
19
  attr_accessor :matches
@@ -13,6 +13,7 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
+ # Content in raw format
16
17
  class RawEmailJson
17
18
  attr_accessor :content
18
19
 
@@ -13,13 +13,16 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
+ # Sent email details
16
17
  class SentEmailDto
18
+ # Array of IDs of attachments that were sent with this email
17
19
  attr_accessor :attachments
18
20
 
19
21
  attr_accessor :bcc
20
22
 
21
23
  attr_accessor :body
22
24
 
25
+ # MD5 Hash
23
26
  attr_accessor :body_md5_hash
24
27
 
25
28
  attr_accessor :cc
@@ -28,8 +31,10 @@ module MailSlurpClient
28
31
 
29
32
  attr_accessor :from
30
33
 
34
+ # ID of sent email
31
35
  attr_accessor :id
32
36
 
37
+ # Inbox ID email was sent from
33
38
  attr_accessor :inbox_id
34
39
 
35
40
  attr_accessor :is_html
@@ -38,8 +43,10 @@ module MailSlurpClient
38
43
 
39
44
  attr_accessor :subject
40
45
 
46
+ # Recipients email was sent to
41
47
  attr_accessor :to
42
48
 
49
+ # User ID
43
50
  attr_accessor :user_id
44
51
 
45
52
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -172,32 +179,17 @@ module MailSlurpClient
172
179
  # @return Array for valid properties with the reasons
173
180
  def list_invalid_properties
174
181
  invalid_properties = Array.new
175
- if @id.nil?
176
- invalid_properties.push('invalid value for "id", id cannot be nil.')
177
- end
178
-
179
- if @inbox_id.nil?
180
- invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
181
- end
182
-
183
182
  if @sent_at.nil?
184
183
  invalid_properties.push('invalid value for "sent_at", sent_at cannot be nil.')
185
184
  end
186
185
 
187
- if @user_id.nil?
188
- invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
189
- end
190
-
191
186
  invalid_properties
192
187
  end
193
188
 
194
189
  # Check to see if the all the properties in the model are valid
195
190
  # @return true if the model is valid
196
191
  def valid?
197
- return false if @id.nil?
198
- return false if @inbox_id.nil?
199
192
  return false if @sent_at.nil?
200
- return false if @user_id.nil?
201
193
  true
202
194
  end
203
195
 
@@ -21,7 +21,7 @@ module MailSlurpClient
21
21
  # Optional contentType for file. For instance `application/pdf`
22
22
  attr_accessor :content_type
23
23
 
24
- # Optional filename to save upload with
24
+ # Optional filename to save upload with. Will be the name that is shown in email clients
25
25
  attr_accessor :filename
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 = '8.2.8'
14
+ VERSION = '8.2.14'
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailslurp_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.2.8
4
+ version: 8.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - mailslurp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-20 00:00:00.000000000 Z
11
+ date: 2020-11-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create emails addresses in Ruby then send and receive real emails and
14
14
  attachments. See https://www.mailslurp.com/docs/ruby/ for full Ruby documentation.
@@ -46,6 +46,7 @@ files:
46
46
  - lib/mailslurp_client/models/bulk_send_email_options.rb
47
47
  - lib/mailslurp_client/models/contact_dto.rb
48
48
  - lib/mailslurp_client/models/contact_projection.rb
49
+ - lib/mailslurp_client/models/content_match_options.rb
49
50
  - lib/mailslurp_client/models/create_anonymous_alias_options.rb
50
51
  - lib/mailslurp_client/models/create_contact_options.rb
51
52
  - lib/mailslurp_client/models/create_domain_options.rb
@@ -60,6 +61,7 @@ files:
60
61
  - lib/mailslurp_client/models/download_attachment_dto.rb
61
62
  - lib/mailslurp_client/models/email.rb
62
63
  - lib/mailslurp_client/models/email_analysis.rb
64
+ - lib/mailslurp_client/models/email_content_match_result.rb
63
65
  - lib/mailslurp_client/models/email_preview.rb
64
66
  - lib/mailslurp_client/models/email_projection.rb
65
67
  - lib/mailslurp_client/models/email_verification_result.rb