mailslurp_client 11.4.0 → 11.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,7 +33,7 @@ module MailSlurpClient
33
33
  # ID of the email
34
34
  attr_accessor :id
35
35
 
36
- # Has the email been viewed ever
36
+ # Has the email been viewed ever. This means viewed in the dashboard or requested via the full email entity endpoints
37
37
  attr_accessor :read
38
38
 
39
39
  # The subject line of the email message
@@ -35,6 +35,8 @@ module MailSlurpClient
35
35
 
36
36
  attr_accessor :subject
37
37
 
38
+ attr_accessor :team_access
39
+
38
40
  attr_accessor :to
39
41
 
40
42
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -50,6 +52,7 @@ module MailSlurpClient
50
52
  :'inbox_id' => :'inboxId',
51
53
  :'read' => :'read',
52
54
  :'subject' => :'subject',
55
+ :'team_access' => :'teamAccess',
53
56
  :'to' => :'to'
54
57
  }
55
58
  end
@@ -67,6 +70,7 @@ module MailSlurpClient
67
70
  :'inbox_id' => :'String',
68
71
  :'read' => :'Boolean',
69
72
  :'subject' => :'String',
73
+ :'team_access' => :'Boolean',
70
74
  :'to' => :'Array<String>'
71
75
  }
72
76
  end
@@ -138,6 +142,10 @@ module MailSlurpClient
138
142
  self.subject = attributes[:'subject']
139
143
  end
140
144
 
145
+ if attributes.key?(:'team_access')
146
+ self.team_access = attributes[:'team_access']
147
+ end
148
+
141
149
  if attributes.key?(:'to')
142
150
  if (value = attributes[:'to']).is_a?(Array)
143
151
  self.to = value
@@ -193,6 +201,7 @@ module MailSlurpClient
193
201
  inbox_id == o.inbox_id &&
194
202
  read == o.read &&
195
203
  subject == o.subject &&
204
+ team_access == o.team_access &&
196
205
  to == o.to
197
206
  end
198
207
 
@@ -205,7 +214,7 @@ module MailSlurpClient
205
214
  # Calculates hash code according to all attributes.
206
215
  # @return [Integer] Hash code
207
216
  def hash
208
- [attachments, bcc, body_md5_hash, cc, created_at, from, id, inbox_id, read, subject, to].hash
217
+ [attachments, bcc, body_md5_hash, cc, created_at, from, id, inbox_id, read, subject, team_access, to].hash
209
218
  end
210
219
 
211
220
  # Builds the object from hash
@@ -21,7 +21,7 @@ module MailSlurpClient
21
21
  # Description of an inbox for labelling and searching purposes
22
22
  attr_accessor :description
23
23
 
24
- # The inbox's email address. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.
24
+ # The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.
25
25
  attr_accessor :email_address
26
26
 
27
27
  # Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email.
@@ -36,9 +36,15 @@ module MailSlurpClient
36
36
  # Name of the inbox. Displayed in the dashboard for easier search
37
37
  attr_accessor :name
38
38
 
39
+ # Is the inbox readOnly for the caller. Read only means can not be deleted or modified.
40
+ attr_accessor :read_only
41
+
39
42
  # 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.
40
43
  attr_accessor :tags
41
44
 
45
+ # Does inbox permit team access for organization team members. If so team users can use inbox and emails associated with it.
46
+ attr_accessor :team_access
47
+
42
48
  # ID of user that inbox belongs to
43
49
  attr_accessor :user_id
44
50
 
@@ -52,7 +58,9 @@ module MailSlurpClient
52
58
  :'favourite' => :'favourite',
53
59
  :'id' => :'id',
54
60
  :'name' => :'name',
61
+ :'read_only' => :'readOnly',
55
62
  :'tags' => :'tags',
63
+ :'team_access' => :'teamAccess',
56
64
  :'user_id' => :'userId'
57
65
  }
58
66
  end
@@ -67,7 +75,9 @@ module MailSlurpClient
67
75
  :'favourite' => :'Boolean',
68
76
  :'id' => :'String',
69
77
  :'name' => :'String',
78
+ :'read_only' => :'Boolean',
70
79
  :'tags' => :'Array<String>',
80
+ :'team_access' => :'Boolean',
71
81
  :'user_id' => :'String'
72
82
  }
73
83
  end
@@ -121,12 +131,20 @@ module MailSlurpClient
121
131
  self.name = attributes[:'name']
122
132
  end
123
133
 
134
+ if attributes.key?(:'read_only')
135
+ self.read_only = attributes[:'read_only']
136
+ end
137
+
124
138
  if attributes.key?(:'tags')
125
139
  if (value = attributes[:'tags']).is_a?(Array)
126
140
  self.tags = value
127
141
  end
128
142
  end
129
143
 
144
+ if attributes.key?(:'team_access')
145
+ self.team_access = attributes[:'team_access']
146
+ end
147
+
130
148
  if attributes.key?(:'user_id')
131
149
  self.user_id = attributes[:'user_id']
132
150
  end
@@ -157,7 +175,9 @@ module MailSlurpClient
157
175
  favourite == o.favourite &&
158
176
  id == o.id &&
159
177
  name == o.name &&
178
+ read_only == o.read_only &&
160
179
  tags == o.tags &&
180
+ team_access == o.team_access &&
161
181
  user_id == o.user_id
162
182
  end
163
183
 
@@ -170,7 +190,7 @@ module MailSlurpClient
170
190
  # Calculates hash code according to all attributes.
171
191
  # @return [Integer] Hash code
172
192
  def hash
173
- [created_at, description, email_address, expires_at, favourite, id, name, tags, user_id].hash
193
+ [created_at, description, email_address, expires_at, favourite, id, name, read_only, tags, team_access, user_id].hash
174
194
  end
175
195
 
176
196
  # Builds the object from hash
@@ -26,6 +26,8 @@ module MailSlurpClient
26
26
 
27
27
  attr_accessor :tags
28
28
 
29
+ attr_accessor :team_access
30
+
29
31
  # Attribute mapping from ruby-style variable name to JSON key.
30
32
  def self.attribute_map
31
33
  {
@@ -34,7 +36,8 @@ module MailSlurpClient
34
36
  :'favourite' => :'favourite',
35
37
  :'id' => :'id',
36
38
  :'name' => :'name',
37
- :'tags' => :'tags'
39
+ :'tags' => :'tags',
40
+ :'team_access' => :'teamAccess'
38
41
  }
39
42
  end
40
43
 
@@ -46,7 +49,8 @@ module MailSlurpClient
46
49
  :'favourite' => :'Boolean',
47
50
  :'id' => :'String',
48
51
  :'name' => :'String',
49
- :'tags' => :'Array<String>'
52
+ :'tags' => :'Array<String>',
53
+ :'team_access' => :'Boolean'
50
54
  }
51
55
  end
52
56
 
@@ -96,6 +100,10 @@ module MailSlurpClient
96
100
  self.tags = value
97
101
  end
98
102
  end
103
+
104
+ if attributes.key?(:'team_access')
105
+ self.team_access = attributes[:'team_access']
106
+ end
99
107
  end
100
108
 
101
109
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -136,7 +144,8 @@ module MailSlurpClient
136
144
  favourite == o.favourite &&
137
145
  id == o.id &&
138
146
  name == o.name &&
139
- tags == o.tags
147
+ tags == o.tags &&
148
+ team_access == o.team_access
140
149
  end
141
150
 
142
151
  # @see the `==` method
@@ -148,7 +157,7 @@ module MailSlurpClient
148
157
  # Calculates hash code according to all attributes.
149
158
  # @return [Integer] Hash code
150
159
  def hash
151
- [created_at, email_address, favourite, id, name, tags].hash
160
+ [created_at, email_address, favourite, id, name, tags, team_access].hash
152
161
  end
153
162
 
154
163
  # Builds the object from hash
@@ -0,0 +1,279 @@
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 OrganizationInboxProjection
17
+ # When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`.
18
+ attr_accessor :created_at
19
+
20
+ # The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.
21
+ attr_accessor :email_address
22
+
23
+ # Is the inbox favorited. Favouriting inboxes is typically done in the dashboard for quick access or filtering
24
+ attr_accessor :favourite
25
+
26
+ # ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically.
27
+ attr_accessor :id
28
+
29
+ # Name of the inbox. Displayed in the dashboard for easier search
30
+ attr_accessor :name
31
+
32
+ # Is the inbox readOnly for the caller. Read only means can not be deleted or modified.
33
+ attr_accessor :read_only
34
+
35
+ # 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.
36
+ attr_accessor :tags
37
+
38
+ # Does inbox permit team access for organization team members. If so team users can use inbox and emails associated with it.
39
+ attr_accessor :team_access
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'created_at' => :'createdAt',
45
+ :'email_address' => :'emailAddress',
46
+ :'favourite' => :'favourite',
47
+ :'id' => :'id',
48
+ :'name' => :'name',
49
+ :'read_only' => :'readOnly',
50
+ :'tags' => :'tags',
51
+ :'team_access' => :'teamAccess'
52
+ }
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'created_at' => :'DateTime',
59
+ :'email_address' => :'String',
60
+ :'favourite' => :'Boolean',
61
+ :'id' => :'String',
62
+ :'name' => :'String',
63
+ :'read_only' => :'Boolean',
64
+ :'tags' => :'Array<String>',
65
+ :'team_access' => :'Boolean'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::OrganizationInboxProjection` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!self.class.attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::OrganizationInboxProjection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'created_at')
91
+ self.created_at = attributes[:'created_at']
92
+ end
93
+
94
+ if attributes.key?(:'email_address')
95
+ self.email_address = attributes[:'email_address']
96
+ end
97
+
98
+ if attributes.key?(:'favourite')
99
+ self.favourite = attributes[:'favourite']
100
+ end
101
+
102
+ if attributes.key?(:'id')
103
+ self.id = attributes[:'id']
104
+ end
105
+
106
+ if attributes.key?(:'name')
107
+ self.name = attributes[:'name']
108
+ end
109
+
110
+ if attributes.key?(:'read_only')
111
+ self.read_only = attributes[:'read_only']
112
+ end
113
+
114
+ if attributes.key?(:'tags')
115
+ if (value = attributes[:'tags']).is_a?(Array)
116
+ self.tags = value
117
+ end
118
+ end
119
+
120
+ if attributes.key?(:'team_access')
121
+ self.team_access = attributes[:'team_access']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ invalid_properties = Array.new
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ true
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ created_at == o.created_at &&
144
+ email_address == o.email_address &&
145
+ favourite == o.favourite &&
146
+ id == o.id &&
147
+ name == o.name &&
148
+ read_only == o.read_only &&
149
+ tags == o.tags &&
150
+ team_access == o.team_access
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [created_at, email_address, favourite, id, name, read_only, tags, team_access].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ new.build_from_hash(attributes)
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ self.class.openapi_types.each_pair do |key, type|
178
+ if type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ end
184
+ elsif !attributes[self.class.attribute_map[key]].nil?
185
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
187
+ end
188
+
189
+ self
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :DateTime
199
+ DateTime.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :Boolean
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ MailSlurpClient.const_get(type).build_from_hash(value)
230
+ end
231
+ end
232
+
233
+ # Returns the string representation of the object
234
+ # @return [String] String presentation of the object
235
+ def to_s
236
+ to_hash.to_s
237
+ end
238
+
239
+ # to_body is an alias to to_hash (backward compatibility)
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_body
242
+ to_hash
243
+ end
244
+
245
+ # Returns the object in the form of hash
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_hash
248
+ hash = {}
249
+ self.class.attribute_map.each_pair do |attr, param|
250
+ value = self.send(attr)
251
+ if value.nil?
252
+ is_nullable = self.class.openapi_nullable.include?(attr)
253
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
254
+ end
255
+
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+ end
279
+ end