mailslurp_client 15.0.2 → 15.0.3

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: 693c5b002da00e5a613df7b22e51887904dc963ce2b510b8242ec9defec048cf
4
- data.tar.gz: 765dbe1001662939ab0d9ccf6eae1892d561167b7f2ceefe8f37ba379fb1641c
3
+ metadata.gz: e319264e2d85a835795d2c0668a860c47dbad08872e04ead5cee71e2d2a05b22
4
+ data.tar.gz: a09f16eb8503cf150e5106127a4442dbb1644a9873a48a39da9b2bd14b889909
5
5
  SHA512:
6
- metadata.gz: 27ac19c962fc68a44925ed1d200bad44ce7d3e679bcd9decaed97840e6a52239ab71adbf2feffe0c0e714ece28eb1c88d1d348fa674ac87456f13f680adcd23d
7
- data.tar.gz: ca0bebdd9a43752764c480d67f68a013bc0048285842e58cb81a5137fa2edd27acb93a2f44e7803216f77fe5275714a2926dafc21ba6ab781e759d2b925ab1fd
6
+ metadata.gz: f4f7018df7072061f8b4c0bcfbc3b88fe495f0d0d33faa9c2d2d32b613398d811c9295b585c93bbf3d1cfca47d3de2914bddc4dba6ff904ef8607e23bbff1ba9
7
+ data.tar.gz: 75e2f5d62f2921dbe17e03dd4e23f735e5c4d5bbf4f238f987c1bf6a991f07e7c5303ec221f610fa149d7021b3eaf4f778290dc8cefcb323bcad4fe0369c2aeb
@@ -731,6 +731,60 @@ module MailSlurpClient
731
731
  return data, status_code, headers
732
732
  end
733
733
 
734
+ # Get email count
735
+ # @param [Hash] opts the optional parameters
736
+ # @return [CountDto]
737
+ def get_email_count(opts = {})
738
+ data, _status_code, _headers = get_email_count_with_http_info(opts)
739
+ data
740
+ end
741
+
742
+ # Get email count
743
+ # @param [Hash] opts the optional parameters
744
+ # @return [Array<(CountDto, Integer, Hash)>] CountDto data, response status code and response headers
745
+ def get_email_count_with_http_info(opts = {})
746
+ if @api_client.config.debugging
747
+ @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_count ...'
748
+ end
749
+ # resource path
750
+ local_var_path = '/emails/emails/count'
751
+
752
+ # query parameters
753
+ query_params = opts[:query_params] || {}
754
+
755
+ # header parameters
756
+ header_params = opts[:header_params] || {}
757
+ # HTTP header 'Accept' (if needed)
758
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
759
+
760
+ # form parameters
761
+ form_params = opts[:form_params] || {}
762
+
763
+ # http body (model)
764
+ post_body = opts[:body]
765
+
766
+ # return_type
767
+ return_type = opts[:return_type] || 'CountDto'
768
+
769
+ # auth_names
770
+ auth_names = opts[:auth_names] || ['API_KEY']
771
+
772
+ new_options = opts.merge(
773
+ :header_params => header_params,
774
+ :query_params => query_params,
775
+ :form_params => form_params,
776
+ :body => post_body,
777
+ :auth_names => auth_names,
778
+ :return_type => return_type
779
+ )
780
+
781
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
782
+ if @api_client.config.debugging
783
+ @api_client.config.logger.debug "API called: EmailControllerApi#get_email_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
784
+ end
785
+ return data, status_code, headers
786
+ end
787
+
734
788
  # Get email content as HTML. For displaying emails in browser context.
735
789
  # 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`
736
790
  # @param email_id [String] emailId
@@ -775,6 +775,120 @@ module MailSlurpClient
775
775
  return data, status_code, headers
776
776
  end
777
777
 
778
+ # Get total inbox count
779
+ # @param [Hash] opts the optional parameters
780
+ # @return [CountDto]
781
+ def get_inbox_count(opts = {})
782
+ data, _status_code, _headers = get_inbox_count_with_http_info(opts)
783
+ data
784
+ end
785
+
786
+ # Get total inbox count
787
+ # @param [Hash] opts the optional parameters
788
+ # @return [Array<(CountDto, Integer, Hash)>] CountDto data, response status code and response headers
789
+ def get_inbox_count_with_http_info(opts = {})
790
+ if @api_client.config.debugging
791
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_count ...'
792
+ end
793
+ # resource path
794
+ local_var_path = '/inboxes/count'
795
+
796
+ # query parameters
797
+ query_params = opts[:query_params] || {}
798
+
799
+ # header parameters
800
+ header_params = opts[:header_params] || {}
801
+ # HTTP header 'Accept' (if needed)
802
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
803
+
804
+ # form parameters
805
+ form_params = opts[:form_params] || {}
806
+
807
+ # http body (model)
808
+ post_body = opts[:body]
809
+
810
+ # return_type
811
+ return_type = opts[:return_type] || 'CountDto'
812
+
813
+ # auth_names
814
+ auth_names = opts[:auth_names] || ['API_KEY']
815
+
816
+ new_options = opts.merge(
817
+ :header_params => header_params,
818
+ :query_params => query_params,
819
+ :form_params => form_params,
820
+ :body => post_body,
821
+ :auth_names => auth_names,
822
+ :return_type => return_type
823
+ )
824
+
825
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
826
+ if @api_client.config.debugging
827
+ @api_client.config.logger.debug "API called: InboxControllerApi#get_inbox_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
828
+ end
829
+ return data, status_code, headers
830
+ end
831
+
832
+ # Get email count in inbox
833
+ # @param inbox_id [String] Id of inbox that emails belongs to
834
+ # @param [Hash] opts the optional parameters
835
+ # @return [CountDto]
836
+ def get_inbox_email_count(inbox_id, opts = {})
837
+ data, _status_code, _headers = get_inbox_email_count_with_http_info(inbox_id, opts)
838
+ data
839
+ end
840
+
841
+ # Get email count in inbox
842
+ # @param inbox_id [String] Id of inbox that emails belongs to
843
+ # @param [Hash] opts the optional parameters
844
+ # @return [Array<(CountDto, Integer, Hash)>] CountDto data, response status code and response headers
845
+ def get_inbox_email_count_with_http_info(inbox_id, opts = {})
846
+ if @api_client.config.debugging
847
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_email_count ...'
848
+ end
849
+ # verify the required parameter 'inbox_id' is set
850
+ if @api_client.config.client_side_validation && inbox_id.nil?
851
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.get_inbox_email_count"
852
+ end
853
+ # resource path
854
+ local_var_path = '/inboxes/{inboxId}/emails/count'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
855
+
856
+ # query parameters
857
+ query_params = opts[:query_params] || {}
858
+
859
+ # header parameters
860
+ header_params = opts[:header_params] || {}
861
+ # HTTP header 'Accept' (if needed)
862
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
863
+
864
+ # form parameters
865
+ form_params = opts[:form_params] || {}
866
+
867
+ # http body (model)
868
+ post_body = opts[:body]
869
+
870
+ # return_type
871
+ return_type = opts[:return_type] || 'CountDto'
872
+
873
+ # auth_names
874
+ auth_names = opts[:auth_names] || ['API_KEY']
875
+
876
+ new_options = opts.merge(
877
+ :header_params => header_params,
878
+ :query_params => query_params,
879
+ :form_params => form_params,
880
+ :body => post_body,
881
+ :auth_names => auth_names,
882
+ :return_type => return_type
883
+ )
884
+
885
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
886
+ if @api_client.config.debugging
887
+ @api_client.config.logger.debug "API called: InboxControllerApi#get_inbox_email_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
888
+ end
889
+ return data, status_code, headers
890
+ end
891
+
778
892
  # Get inbox emails paginated
779
893
  # Get a paginated list of emails in an inbox. Does not hold connections open.
780
894
  # @param inbox_id [String] Id of inbox that emails belongs to
@@ -0,0 +1,211 @@
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
+ class CountDto
17
+ attr_accessor :total_elements
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'total_elements' => :'totalElements'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ :'total_elements' => :'Integer'
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CountDto` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CountDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
53
+
54
+ if attributes.key?(:'total_elements')
55
+ self.total_elements = attributes[:'total_elements']
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ if @total_elements.nil?
64
+ invalid_properties.push('invalid value for "total_elements", total_elements cannot be nil.')
65
+ end
66
+
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ return false if @total_elements.nil?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ total_elements == o.total_elements
83
+ end
84
+
85
+ # @see the `==` method
86
+ # @param [Object] Object to be compared
87
+ def eql?(o)
88
+ self == o
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Integer] Hash code
93
+ def hash
94
+ [total_elements].hash
95
+ end
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def self.build_from_hash(attributes)
101
+ new.build_from_hash(attributes)
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.openapi_types.each_pair do |key, type|
110
+ if type =~ /\AArray<(.*)>/i
111
+ # check to ensure the input is an array given that the attribute
112
+ # is documented as an array but the input is not
113
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
114
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
115
+ end
116
+ elsif !attributes[self.class.attribute_map[key]].nil?
117
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
119
+ end
120
+
121
+ self
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def _deserialize(type, value)
129
+ case type.to_sym
130
+ when :DateTime
131
+ DateTime.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :Boolean
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ MailSlurpClient.const_get(type).build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ if value.nil?
184
+ is_nullable = self.class.openapi_nullable.include?(attr)
185
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
186
+ end
187
+
188
+ hash[param] = _to_hash(value)
189
+ end
190
+ hash
191
+ end
192
+
193
+ # Outputs non-array value in the form of hash
194
+ # For object, use to_hash. Otherwise, just return the value
195
+ # @param [Object] value Any valid value
196
+ # @return [Hash] Returns the value in the form of hash
197
+ def _to_hash(value)
198
+ if value.is_a?(Array)
199
+ value.compact.map { |v| _to_hash(v) }
200
+ elsif value.is_a?(Hash)
201
+ {}.tap do |hash|
202
+ value.each { |k, v| hash[k] = _to_hash(v) }
203
+ end
204
+ elsif value.respond_to? :to_hash
205
+ value.to_hash
206
+ else
207
+ value
208
+ end
209
+ end
210
+ end
211
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '15.0.2'
14
+ VERSION = '15.0.3'
15
15
  end
@@ -33,6 +33,7 @@ require 'mailslurp_client/models/condition_option'
33
33
  require 'mailslurp_client/models/contact_dto'
34
34
  require 'mailslurp_client/models/contact_projection'
35
35
  require 'mailslurp_client/models/content_match_options'
36
+ require 'mailslurp_client/models/count_dto'
36
37
  require 'mailslurp_client/models/create_alias_options'
37
38
  require 'mailslurp_client/models/create_contact_options'
38
39
  require 'mailslurp_client/models/create_domain_options'
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: 15.0.2
4
+ version: 15.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mailslurp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-09 00:00:00.000000000 Z
11
+ date: 2021-11-01 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.
@@ -64,6 +64,7 @@ files:
64
64
  - lib/mailslurp_client/models/contact_dto.rb
65
65
  - lib/mailslurp_client/models/contact_projection.rb
66
66
  - lib/mailslurp_client/models/content_match_options.rb
67
+ - lib/mailslurp_client/models/count_dto.rb
67
68
  - lib/mailslurp_client/models/create_alias_options.rb
68
69
  - lib/mailslurp_client/models/create_contact_options.rb
69
70
  - lib/mailslurp_client/models/create_domain_options.rb