mailosaur 3.0.1 → 5.0.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +14 -13
  3. data/README.md +42 -8
  4. data/lib/Mailosaur/analysis.rb +184 -0
  5. data/lib/Mailosaur/files.rb +291 -0
  6. data/lib/Mailosaur/mailosaur_base_client.rb +120 -0
  7. data/lib/Mailosaur/mailosaur_error.rb +23 -0
  8. data/lib/Mailosaur/messages.rb +673 -0
  9. data/lib/Mailosaur/models/attachment.rb +99 -0
  10. data/lib/Mailosaur/models/forwarding_rule.rb +78 -0
  11. data/lib/Mailosaur/models/image.rb +55 -0
  12. data/lib/Mailosaur/models/link.rb +55 -0
  13. data/lib/Mailosaur/models/message.rb +219 -0
  14. data/lib/Mailosaur/models/message_address.rb +66 -0
  15. data/lib/Mailosaur/models/message_content.rb +84 -0
  16. data/lib/Mailosaur/models/message_header.rb +55 -0
  17. data/lib/Mailosaur/models/message_list_result.rb +54 -0
  18. data/lib/Mailosaur/models/message_summary.rb +199 -0
  19. data/lib/Mailosaur/models/metadata.rb +52 -0
  20. data/lib/Mailosaur/models/search_criteria.rb +69 -0
  21. data/lib/Mailosaur/models/server.rb +118 -0
  22. data/lib/Mailosaur/models/server_create_options.rb +44 -0
  23. data/lib/Mailosaur/models/server_list_result.rb +54 -0
  24. data/lib/Mailosaur/models/spam_analysis_result.rb +56 -0
  25. data/lib/Mailosaur/models/spam_assassin_rule.rb +66 -0
  26. data/lib/Mailosaur/models/spam_filter_results.rb +53 -0
  27. data/lib/Mailosaur/module_definition.rb +6 -0
  28. data/lib/Mailosaur/servers.rb +542 -0
  29. data/lib/Mailosaur/version.rb +8 -0
  30. data/lib/mailosaur.rb +52 -108
  31. metadata +78 -46
  32. data/lib/helper.rb +0 -6
  33. data/lib/mailosaur/attachment.rb +0 -10
  34. data/lib/mailosaur/email.rb +0 -23
  35. data/lib/mailosaur/email_address.rb +0 -9
  36. data/lib/mailosaur/email_data.rb +0 -13
  37. data/lib/mailosaur/image.rb +0 -8
  38. data/lib/mailosaur/link.rb +0 -8
  39. data/lib/mailosaur/message_generator.rb +0 -31
@@ -0,0 +1,54 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Mailosaur
7
+ module Models
8
+ #
9
+ # The result of a message listing request.
10
+ #
11
+ class MessageListResult
12
+ # @return [Array<MessageSummary>] The individual summaries of each
13
+ # message forming the result. Summaries are returned sorted by received
14
+ # date, with the most recently-received messages appearing first.
15
+ attr_accessor :items
16
+
17
+
18
+ #
19
+ # Mapper for MessageListResult class as Ruby Hash.
20
+ # This will be used for serialization/deserialization.
21
+ #
22
+ def self.mapper()
23
+ {
24
+ client_side_validation: true,
25
+ required: false,
26
+ serialized_name: 'MessageListResult',
27
+ type: {
28
+ name: 'Composite',
29
+ class_name: 'MessageListResult',
30
+ model_properties: {
31
+ items: {
32
+ client_side_validation: true,
33
+ required: false,
34
+ serialized_name: 'items',
35
+ type: {
36
+ name: 'Sequence',
37
+ element: {
38
+ client_side_validation: true,
39
+ required: false,
40
+ serialized_name: 'MessageSummaryElementType',
41
+ type: {
42
+ name: 'Composite',
43
+ class_name: 'MessageSummary'
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,199 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Mailosaur
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class MessageSummary
13
+ # @return
14
+ attr_accessor :id
15
+
16
+ # @return [String]
17
+ attr_accessor :server
18
+
19
+ # @return [Array<MessageAddress>]
20
+ attr_accessor :rcpt
21
+
22
+ # @return [Array<MessageAddress>]
23
+ attr_accessor :from
24
+
25
+ # @return [Array<MessageAddress>]
26
+ attr_accessor :to
27
+
28
+ # @return [Array<MessageAddress>]
29
+ attr_accessor :cc
30
+
31
+ # @return [Array<MessageAddress>]
32
+ attr_accessor :bcc
33
+
34
+ # @return [DateTime]
35
+ attr_accessor :received
36
+
37
+ # @return [String]
38
+ attr_accessor :subject
39
+
40
+ # @return [String]
41
+ attr_accessor :summary
42
+
43
+ # @return [Integer]
44
+ attr_accessor :attachments
45
+
46
+
47
+ #
48
+ # Mapper for MessageSummary class as Ruby Hash.
49
+ # This will be used for serialization/deserialization.
50
+ #
51
+ def self.mapper()
52
+ {
53
+ client_side_validation: true,
54
+ required: false,
55
+ serialized_name: 'MessageSummary',
56
+ type: {
57
+ name: 'Composite',
58
+ class_name: 'MessageSummary',
59
+ model_properties: {
60
+ id: {
61
+ client_side_validation: true,
62
+ required: true,
63
+ serialized_name: 'id',
64
+ type: {
65
+ name: 'String'
66
+ }
67
+ },
68
+ server: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ serialized_name: 'server',
72
+ type: {
73
+ name: 'String'
74
+ }
75
+ },
76
+ rcpt: {
77
+ client_side_validation: true,
78
+ required: false,
79
+ serialized_name: 'rcpt',
80
+ type: {
81
+ name: 'Sequence',
82
+ element: {
83
+ client_side_validation: true,
84
+ required: false,
85
+ serialized_name: 'MessageAddressElementType',
86
+ type: {
87
+ name: 'Composite',
88
+ class_name: 'MessageAddress'
89
+ }
90
+ }
91
+ }
92
+ },
93
+ from: {
94
+ client_side_validation: true,
95
+ required: false,
96
+ serialized_name: 'from',
97
+ type: {
98
+ name: 'Sequence',
99
+ element: {
100
+ client_side_validation: true,
101
+ required: false,
102
+ serialized_name: 'MessageAddressElementType',
103
+ type: {
104
+ name: 'Composite',
105
+ class_name: 'MessageAddress'
106
+ }
107
+ }
108
+ }
109
+ },
110
+ to: {
111
+ client_side_validation: true,
112
+ required: false,
113
+ serialized_name: 'to',
114
+ type: {
115
+ name: 'Sequence',
116
+ element: {
117
+ client_side_validation: true,
118
+ required: false,
119
+ serialized_name: 'MessageAddressElementType',
120
+ type: {
121
+ name: 'Composite',
122
+ class_name: 'MessageAddress'
123
+ }
124
+ }
125
+ }
126
+ },
127
+ cc: {
128
+ client_side_validation: true,
129
+ required: false,
130
+ serialized_name: 'cc',
131
+ type: {
132
+ name: 'Sequence',
133
+ element: {
134
+ client_side_validation: true,
135
+ required: false,
136
+ serialized_name: 'MessageAddressElementType',
137
+ type: {
138
+ name: 'Composite',
139
+ class_name: 'MessageAddress'
140
+ }
141
+ }
142
+ }
143
+ },
144
+ bcc: {
145
+ client_side_validation: true,
146
+ required: false,
147
+ serialized_name: 'bcc',
148
+ type: {
149
+ name: 'Sequence',
150
+ element: {
151
+ client_side_validation: true,
152
+ required: false,
153
+ serialized_name: 'MessageAddressElementType',
154
+ type: {
155
+ name: 'Composite',
156
+ class_name: 'MessageAddress'
157
+ }
158
+ }
159
+ }
160
+ },
161
+ received: {
162
+ client_side_validation: true,
163
+ required: false,
164
+ serialized_name: 'received',
165
+ type: {
166
+ name: 'DateTime'
167
+ }
168
+ },
169
+ subject: {
170
+ client_side_validation: true,
171
+ required: false,
172
+ serialized_name: 'subject',
173
+ type: {
174
+ name: 'String'
175
+ }
176
+ },
177
+ summary: {
178
+ client_side_validation: true,
179
+ required: false,
180
+ serialized_name: 'summary',
181
+ type: {
182
+ name: 'String'
183
+ }
184
+ },
185
+ attachments: {
186
+ client_side_validation: true,
187
+ required: false,
188
+ serialized_name: 'attachments',
189
+ type: {
190
+ name: 'Number'
191
+ }
192
+ }
193
+ }
194
+ }
195
+ }
196
+ end
197
+ end
198
+ end
199
+ end
@@ -0,0 +1,52 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Mailosaur
7
+ module Models
8
+ #
9
+ # Advanced use case content related to the message.
10
+ #
11
+ class Metadata
12
+ # @return [Array<MessageHeader>] Email headers.
13
+ attr_accessor :headers
14
+
15
+
16
+ #
17
+ # Mapper for Metadata class as Ruby Hash.
18
+ # This will be used for serialization/deserialization.
19
+ #
20
+ def self.mapper()
21
+ {
22
+ client_side_validation: true,
23
+ required: false,
24
+ serialized_name: 'Metadata',
25
+ type: {
26
+ name: 'Composite',
27
+ class_name: 'Metadata',
28
+ model_properties: {
29
+ headers: {
30
+ client_side_validation: true,
31
+ required: false,
32
+ serialized_name: 'headers',
33
+ type: {
34
+ name: 'Sequence',
35
+ element: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ serialized_name: 'MessageHeaderElementType',
39
+ type: {
40
+ name: 'Composite',
41
+ class_name: 'MessageHeader'
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,69 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Mailosaur
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class SearchCriteria
13
+ # @return [String] The full email address to which the target email was
14
+ # sent.
15
+ attr_accessor :sent_to
16
+
17
+ # @return [String] The value to seek within the target email's subject
18
+ # line.
19
+ attr_accessor :subject
20
+
21
+ # @return [String] The value to seek within the target email's HTML or
22
+ # text body.
23
+ attr_accessor :body
24
+
25
+
26
+ #
27
+ # Mapper for SearchCriteria class as Ruby Hash.
28
+ # This will be used for serialization/deserialization.
29
+ #
30
+ def self.mapper()
31
+ {
32
+ client_side_validation: true,
33
+ required: false,
34
+ serialized_name: 'SearchCriteria',
35
+ type: {
36
+ name: 'Composite',
37
+ class_name: 'SearchCriteria',
38
+ model_properties: {
39
+ sent_to: {
40
+ client_side_validation: true,
41
+ required: false,
42
+ serialized_name: 'sentTo',
43
+ type: {
44
+ name: 'String'
45
+ }
46
+ },
47
+ subject: {
48
+ client_side_validation: true,
49
+ required: false,
50
+ serialized_name: 'subject',
51
+ type: {
52
+ name: 'String'
53
+ }
54
+ },
55
+ body: {
56
+ client_side_validation: true,
57
+ required: false,
58
+ serialized_name: 'body',
59
+ type: {
60
+ name: 'String'
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,118 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Mailosaur
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class Server
13
+ # @return [String] Unique identifier for the server. Used as username for
14
+ # SMTP/POP3 authentication.
15
+ attr_accessor :id
16
+
17
+ # @return [String] SMTP/POP3 password.
18
+ attr_accessor :password
19
+
20
+ # @return [String] A name used to identify the server.
21
+ attr_accessor :name
22
+
23
+ # @return Users (excluding administrators) who have access to the server.
24
+ attr_accessor :users
25
+
26
+ # @return [Integer] The number of messages currently in the server.
27
+ attr_accessor :messages
28
+
29
+ # @return [Array<ForwardingRule>] The rules used to manage email
30
+ # forwarding for this server.
31
+ attr_accessor :forwarding_rules
32
+
33
+
34
+ #
35
+ # Mapper for Server class as Ruby Hash.
36
+ # This will be used for serialization/deserialization.
37
+ #
38
+ def self.mapper()
39
+ {
40
+ client_side_validation: true,
41
+ required: false,
42
+ serialized_name: 'Server',
43
+ type: {
44
+ name: 'Composite',
45
+ class_name: 'Server',
46
+ model_properties: {
47
+ id: {
48
+ client_side_validation: true,
49
+ required: false,
50
+ serialized_name: 'id',
51
+ type: {
52
+ name: 'String'
53
+ }
54
+ },
55
+ password: {
56
+ client_side_validation: true,
57
+ required: false,
58
+ serialized_name: 'password',
59
+ type: {
60
+ name: 'String'
61
+ }
62
+ },
63
+ name: {
64
+ client_side_validation: true,
65
+ required: false,
66
+ serialized_name: 'name',
67
+ type: {
68
+ name: 'String'
69
+ }
70
+ },
71
+ users: {
72
+ client_side_validation: true,
73
+ required: false,
74
+ serialized_name: 'users',
75
+ type: {
76
+ name: 'Sequence',
77
+ element: {
78
+ client_side_validation: true,
79
+ required: false,
80
+ serialized_name: 'UuidElementType',
81
+ type: {
82
+ name: 'String'
83
+ }
84
+ }
85
+ }
86
+ },
87
+ messages: {
88
+ client_side_validation: true,
89
+ required: false,
90
+ serialized_name: 'messages',
91
+ type: {
92
+ name: 'Number'
93
+ }
94
+ },
95
+ forwarding_rules: {
96
+ client_side_validation: true,
97
+ required: false,
98
+ serialized_name: 'forwardingRules',
99
+ type: {
100
+ name: 'Sequence',
101
+ element: {
102
+ client_side_validation: true,
103
+ required: false,
104
+ serialized_name: 'ForwardingRuleElementType',
105
+ type: {
106
+ name: 'Composite',
107
+ class_name: 'ForwardingRule'
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ end
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,44 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Mailosaur
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class ServerCreateOptions
13
+ # @return [String] A name used to identify the server.
14
+ attr_accessor :name
15
+
16
+
17
+ #
18
+ # Mapper for ServerCreateOptions class as Ruby Hash.
19
+ # This will be used for serialization/deserialization.
20
+ #
21
+ def self.mapper()
22
+ {
23
+ client_side_validation: true,
24
+ required: false,
25
+ serialized_name: 'ServerCreateOptions',
26
+ type: {
27
+ name: 'Composite',
28
+ class_name: 'ServerCreateOptions',
29
+ model_properties: {
30
+ name: {
31
+ client_side_validation: true,
32
+ required: false,
33
+ serialized_name: 'name',
34
+ type: {
35
+ name: 'String'
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,54 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Mailosaur
7
+ module Models
8
+ #
9
+ # The result of a server listing request.
10
+ #
11
+ class ServerListResult
12
+ # @return [Array<Server>] The individual servers forming the result.
13
+ # Servers are returned sorted by creation date, with the most
14
+ # recently-created server appearing first.
15
+ attr_accessor :items
16
+
17
+
18
+ #
19
+ # Mapper for ServerListResult class as Ruby Hash.
20
+ # This will be used for serialization/deserialization.
21
+ #
22
+ def self.mapper()
23
+ {
24
+ client_side_validation: true,
25
+ required: false,
26
+ serialized_name: 'ServerListResult',
27
+ type: {
28
+ name: 'Composite',
29
+ class_name: 'ServerListResult',
30
+ model_properties: {
31
+ items: {
32
+ client_side_validation: true,
33
+ required: false,
34
+ serialized_name: 'items',
35
+ type: {
36
+ name: 'Sequence',
37
+ element: {
38
+ client_side_validation: true,
39
+ required: false,
40
+ serialized_name: 'ServerElementType',
41
+ type: {
42
+ name: 'Composite',
43
+ class_name: 'Server'
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,56 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Mailosaur
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class SpamAnalysisResult
13
+ # @return [SpamFilterResults]
14
+ attr_accessor :spam_filter_results
15
+
16
+ # @return [Float]
17
+ attr_accessor :score
18
+
19
+
20
+ #
21
+ # Mapper for SpamAnalysisResult class as Ruby Hash.
22
+ # This will be used for serialization/deserialization.
23
+ #
24
+ def self.mapper()
25
+ {
26
+ client_side_validation: true,
27
+ required: false,
28
+ serialized_name: 'SpamAnalysisResult',
29
+ type: {
30
+ name: 'Composite',
31
+ class_name: 'SpamAnalysisResult',
32
+ model_properties: {
33
+ spam_filter_results: {
34
+ client_side_validation: true,
35
+ required: false,
36
+ serialized_name: 'spamFilterResults',
37
+ type: {
38
+ name: 'Composite',
39
+ class_name: 'SpamFilterResults'
40
+ }
41
+ },
42
+ score: {
43
+ client_side_validation: true,
44
+ required: false,
45
+ serialized_name: 'score',
46
+ type: {
47
+ name: 'Double'
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ end
54
+ end
55
+ end
56
+ end