mailslurp_client 8.2.17 → 8.3.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: 881dae0965a313cf4e679fc47e998a276e07d3061765332c5ce6e383b5b837c9
4
- data.tar.gz: 37bc815bc87386f28781283cc8188d67eaff8e064017f5dcf9c13b61a6e79206
3
+ metadata.gz: e376f040ab4f7c4f9b8a7f2cc37d26e6e1fb7b4de17c7910fd0546b83967a31a
4
+ data.tar.gz: 9be17286f4a983f3916b22473627371b46c0189988f848477fae897402434fbb
5
5
  SHA512:
6
- metadata.gz: 8f96ca7c6b8e8576577ab457784427bd827f6c2168ca80baf22d979107aac4ab9491643e6f06172fb002e0583ac34c58efa2796f35d800bd6717ea9216902fb5
7
- data.tar.gz: 1210557bf09554f787242009ef9d604c4ce4565ec3bc0a3b72f605c484869a5707cc5e4e93f8d9fb8f5267e7e45294102f9609464ebc3197a0004cd44ea62ec0
6
+ metadata.gz: 50c0382af36f9a4bb707b628e80180f4882a1b75575097862f350c02fe9d29b076f5d2cfcf3bfc88e22a967f655673f889e66d0889535653723be61f0f2aa4b2
7
+ data.tar.gz: cfac41f0383d467211632dcbc6773b401181b9e696c93d50bed0c9209117c3dc67e1e141ca0e55aef86ff2167b577ac5585b737d4cb5e38e85325e21553914a9
@@ -27,6 +27,7 @@ require 'mailslurp_client/models/create_anonymous_alias_options'
27
27
  require 'mailslurp_client/models/create_contact_options'
28
28
  require 'mailslurp_client/models/create_domain_options'
29
29
  require 'mailslurp_client/models/create_group_options'
30
+ require 'mailslurp_client/models/create_inbox_dto'
30
31
  require 'mailslurp_client/models/create_owned_alias_options'
31
32
  require 'mailslurp_client/models/create_template_options'
32
33
  require 'mailslurp_client/models/create_webhook_options'
@@ -87,17 +87,17 @@ module MailSlurpClient
87
87
  # Delete a domain. This will disable any existing inboxes that use this domain.
88
88
  # @param id [String] id
89
89
  # @param [Hash] opts the optional parameters
90
- # @return [nil]
90
+ # @return [Array<String>]
91
91
  def delete_domain(id, opts = {})
92
- delete_domain_with_http_info(id, opts)
93
- nil
92
+ data, _status_code, _headers = delete_domain_with_http_info(id, opts)
93
+ data
94
94
  end
95
95
 
96
96
  # Delete a domain
97
97
  # Delete a domain. This will disable any existing inboxes that use this domain.
98
98
  # @param id [String] id
99
99
  # @param [Hash] opts the optional parameters
100
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
100
+ # @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
101
101
  def delete_domain_with_http_info(id, opts = {})
102
102
  if @api_client.config.debugging
103
103
  @api_client.config.logger.debug 'Calling API: DomainControllerApi.delete_domain ...'
@@ -114,6 +114,8 @@ module MailSlurpClient
114
114
 
115
115
  # header parameters
116
116
  header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
117
119
 
118
120
  # form parameters
119
121
  form_params = opts[:form_params] || {}
@@ -122,7 +124,7 @@ module MailSlurpClient
122
124
  post_body = opts[:body]
123
125
 
124
126
  # return_type
125
- return_type = opts[:return_type]
127
+ return_type = opts[:return_type] || 'Array<String>'
126
128
 
127
129
  # auth_names
128
130
  auth_names = opts[:auth_names] || ['API_KEY']
@@ -93,6 +93,70 @@ module MailSlurpClient
93
93
  return data, status_code, headers
94
94
  end
95
95
 
96
+ # Create an inbox with additional options
97
+ # Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients.
98
+ # @param create_inbox_dto [CreateInboxDto] createInboxDto
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Inbox]
101
+ def create_inbox_with_options(create_inbox_dto, opts = {})
102
+ data, _status_code, _headers = create_inbox_with_options_with_http_info(create_inbox_dto, opts)
103
+ data
104
+ end
105
+
106
+ # Create an inbox with additional options
107
+ # Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients.
108
+ # @param create_inbox_dto [CreateInboxDto] createInboxDto
109
+ # @param [Hash] opts the optional parameters
110
+ # @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers
111
+ def create_inbox_with_options_with_http_info(create_inbox_dto, opts = {})
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.create_inbox_with_options ...'
114
+ end
115
+ # verify the required parameter 'create_inbox_dto' is set
116
+ if @api_client.config.client_side_validation && create_inbox_dto.nil?
117
+ fail ArgumentError, "Missing the required parameter 'create_inbox_dto' when calling InboxControllerApi.create_inbox_with_options"
118
+ end
119
+ # resource path
120
+ local_var_path = '/inboxes/withOptions'
121
+
122
+ # query parameters
123
+ query_params = opts[:query_params] || {}
124
+
125
+ # header parameters
126
+ header_params = opts[:header_params] || {}
127
+ # HTTP header 'Accept' (if needed)
128
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
129
+ # HTTP header 'Content-Type'
130
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
131
+
132
+ # form parameters
133
+ form_params = opts[:form_params] || {}
134
+
135
+ # http body (model)
136
+ post_body = opts[:body] || @api_client.object_to_http_body(create_inbox_dto)
137
+
138
+ # return_type
139
+ return_type = opts[:return_type] || 'Inbox'
140
+
141
+ # auth_names
142
+ auth_names = opts[:auth_names] || ['API_KEY']
143
+
144
+ new_options = opts.merge(
145
+ :header_params => header_params,
146
+ :query_params => query_params,
147
+ :form_params => form_params,
148
+ :body => post_body,
149
+ :auth_names => auth_names,
150
+ :return_type => return_type
151
+ )
152
+
153
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug "API called: InboxControllerApi#create_inbox_with_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
156
+ end
157
+ return data, status_code, headers
158
+ end
159
+
96
160
  # Delete all inboxes
97
161
  # Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have.
98
162
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,259 @@
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 CreateInboxDto
17
+ # Optional description of an inbox for labelling purposes
18
+ attr_accessor :description
19
+
20
+ # Optionally specify an email address you want the inbox to have. When left blank an email address will be randomly assigned to the inbox usually ending in `@mailslurp.com`. Custom email addresses must include your own custom domain that you have configured in MailSlurp. So if your domain is `mysite.com` you can created any email address ending in `@mysite.com`. All email addresses are transformed to lowercase!
21
+ attr_accessor :email_address
22
+
23
+ # When, if ever, will the inbox expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. Timestamp passed as string.
24
+ attr_accessor :expires_at
25
+
26
+ # Is the inbox favorited. Favouriting inboxes is typically done in the dashboard for quick access
27
+ attr_accessor :favourite
28
+
29
+ # Optional name of the inbox. Displayed in the dashboard for easier search
30
+ attr_accessor :name
31
+
32
+ # Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.
33
+ attr_accessor :tags
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'description' => :'description',
39
+ :'email_address' => :'emailAddress',
40
+ :'expires_at' => :'expiresAt',
41
+ :'favourite' => :'favourite',
42
+ :'name' => :'name',
43
+ :'tags' => :'tags'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'description' => :'String',
51
+ :'email_address' => :'String',
52
+ :'expires_at' => :'DateTime',
53
+ :'favourite' => :'Boolean',
54
+ :'name' => :'String',
55
+ :'tags' => :'Array<String>'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateInboxDto` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CreateInboxDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'description')
81
+ self.description = attributes[:'description']
82
+ end
83
+
84
+ if attributes.key?(:'email_address')
85
+ self.email_address = attributes[:'email_address']
86
+ end
87
+
88
+ if attributes.key?(:'expires_at')
89
+ self.expires_at = attributes[:'expires_at']
90
+ end
91
+
92
+ if attributes.key?(:'favourite')
93
+ self.favourite = attributes[:'favourite']
94
+ end
95
+
96
+ if attributes.key?(:'name')
97
+ self.name = attributes[:'name']
98
+ end
99
+
100
+ if attributes.key?(:'tags')
101
+ if (value = attributes[:'tags']).is_a?(Array)
102
+ self.tags = value
103
+ end
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ description == o.description &&
126
+ email_address == o.email_address &&
127
+ expires_at == o.expires_at &&
128
+ favourite == o.favourite &&
129
+ name == o.name &&
130
+ tags == o.tags
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [description, email_address, expires_at, favourite, name, tags].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ new.build_from_hash(attributes)
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ self.class.openapi_types.each_pair do |key, type|
158
+ if type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
162
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
163
+ end
164
+ elsif !attributes[self.class.attribute_map[key]].nil?
165
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
167
+ end
168
+
169
+ self
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def _deserialize(type, value)
177
+ case type.to_sym
178
+ when :DateTime
179
+ DateTime.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :Boolean
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ MailSlurpClient.const_get(type).build_from_hash(value)
210
+ end
211
+ end
212
+
213
+ # Returns the string representation of the object
214
+ # @return [String] String presentation of the object
215
+ def to_s
216
+ to_hash.to_s
217
+ end
218
+
219
+ # to_body is an alias to to_hash (backward compatibility)
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_body
222
+ to_hash
223
+ end
224
+
225
+ # Returns the object in the form of hash
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_hash
228
+ hash = {}
229
+ self.class.attribute_map.each_pair do |attr, param|
230
+ value = self.send(attr)
231
+ if value.nil?
232
+ is_nullable = self.class.openapi_nullable.include?(attr)
233
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
234
+ end
235
+
236
+ hash[param] = _to_hash(value)
237
+ end
238
+ hash
239
+ end
240
+
241
+ # Outputs non-array value in the form of hash
242
+ # For object, use to_hash. Otherwise, just return the value
243
+ # @param [Object] value Any valid value
244
+ # @return [Hash] Returns the value in the form of hash
245
+ def _to_hash(value)
246
+ if value.is_a?(Array)
247
+ value.compact.map { |v| _to_hash(v) }
248
+ elsif value.is_a?(Hash)
249
+ {}.tap do |hash|
250
+ value.each { |k, v| hash[k] = _to_hash(v) }
251
+ end
252
+ elsif value.respond_to? :to_hash
253
+ value.to_hash
254
+ else
255
+ value
256
+ end
257
+ end
258
+ end
259
+ end
@@ -17,22 +17,29 @@ module MailSlurpClient
17
17
  class DomainDto
18
18
  attr_accessor :created_at
19
19
 
20
+ # DNS records for DKIM approval
21
+ attr_accessor :dkim_tokens
22
+
23
+ # Custom domain name
20
24
  attr_accessor :domain
21
25
 
22
26
  attr_accessor :id
23
27
 
28
+ # Whether domain has been verified or not. If the domain is not verified after 72 hours there is most likely an issue with the domains DNS records.
24
29
  attr_accessor :is_verified
25
30
 
26
31
  attr_accessor :updated_at
27
32
 
28
33
  attr_accessor :user_id
29
34
 
35
+ # A TXT record that you must place in the DNS settings of the domain to complete domain verification
30
36
  attr_accessor :verification_token
31
37
 
32
38
  # Attribute mapping from ruby-style variable name to JSON key.
33
39
  def self.attribute_map
34
40
  {
35
41
  :'created_at' => :'createdAt',
42
+ :'dkim_tokens' => :'dkimTokens',
36
43
  :'domain' => :'domain',
37
44
  :'id' => :'id',
38
45
  :'is_verified' => :'isVerified',
@@ -46,6 +53,7 @@ module MailSlurpClient
46
53
  def self.openapi_types
47
54
  {
48
55
  :'created_at' => :'DateTime',
56
+ :'dkim_tokens' => :'Array<String>',
49
57
  :'domain' => :'String',
50
58
  :'id' => :'String',
51
59
  :'is_verified' => :'Boolean',
@@ -80,6 +88,12 @@ module MailSlurpClient
80
88
  self.created_at = attributes[:'created_at']
81
89
  end
82
90
 
91
+ if attributes.key?(:'dkim_tokens')
92
+ if (value = attributes[:'dkim_tokens']).is_a?(Array)
93
+ self.dkim_tokens = value
94
+ end
95
+ end
96
+
83
97
  if attributes.key?(:'domain')
84
98
  self.domain = attributes[:'domain']
85
99
  end
@@ -113,18 +127,10 @@ module MailSlurpClient
113
127
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
114
128
  end
115
129
 
116
- if @domain.nil?
117
- invalid_properties.push('invalid value for "domain", domain cannot be nil.')
118
- end
119
-
120
130
  if @id.nil?
121
131
  invalid_properties.push('invalid value for "id", id cannot be nil.')
122
132
  end
123
133
 
124
- if @is_verified.nil?
125
- invalid_properties.push('invalid value for "is_verified", is_verified cannot be nil.')
126
- end
127
-
128
134
  if @updated_at.nil?
129
135
  invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
130
136
  end
@@ -133,10 +139,6 @@ module MailSlurpClient
133
139
  invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
134
140
  end
135
141
 
136
- if @verification_token.nil?
137
- invalid_properties.push('invalid value for "verification_token", verification_token cannot be nil.')
138
- end
139
-
140
142
  invalid_properties
141
143
  end
142
144
 
@@ -144,12 +146,9 @@ module MailSlurpClient
144
146
  # @return true if the model is valid
145
147
  def valid?
146
148
  return false if @created_at.nil?
147
- return false if @domain.nil?
148
149
  return false if @id.nil?
149
- return false if @is_verified.nil?
150
150
  return false if @updated_at.nil?
151
151
  return false if @user_id.nil?
152
- return false if @verification_token.nil?
153
152
  true
154
153
  end
155
154
 
@@ -159,6 +158,7 @@ module MailSlurpClient
159
158
  return true if self.equal?(o)
160
159
  self.class == o.class &&
161
160
  created_at == o.created_at &&
161
+ dkim_tokens == o.dkim_tokens &&
162
162
  domain == o.domain &&
163
163
  id == o.id &&
164
164
  is_verified == o.is_verified &&
@@ -176,7 +176,7 @@ module MailSlurpClient
176
176
  # Calculates hash code according to all attributes.
177
177
  # @return [Integer] Hash code
178
178
  def hash
179
- [created_at, domain, id, is_verified, updated_at, user_id, verification_token].hash
179
+ [created_at, dkim_tokens, domain, id, is_verified, updated_at, user_id, verification_token].hash
180
180
  end
181
181
 
182
182
  # Builds the object from hash
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '8.2.17'
14
+ VERSION = '8.3.0'
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.17
4
+ version: 8.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mailslurp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-01 00:00:00.000000000 Z
11
+ date: 2020-12-08 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.
@@ -51,6 +51,7 @@ files:
51
51
  - lib/mailslurp_client/models/create_contact_options.rb
52
52
  - lib/mailslurp_client/models/create_domain_options.rb
53
53
  - lib/mailslurp_client/models/create_group_options.rb
54
+ - lib/mailslurp_client/models/create_inbox_dto.rb
54
55
  - lib/mailslurp_client/models/create_owned_alias_options.rb
55
56
  - lib/mailslurp_client/models/create_template_options.rb
56
57
  - lib/mailslurp_client/models/create_webhook_options.rb