aspose_email_cloud 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +22 -0
- data/README.md +48 -0
- data/aspose_email_cloud.gemspec +26 -0
- data/lib/aspose_email_cloud.rb +38 -0
- data/lib/aspose_email_cloud/api/email_api.rb +431 -0
- data/lib/aspose_email_cloud/api_client.rb +335 -0
- data/lib/aspose_email_cloud/api_error.rb +24 -0
- data/lib/aspose_email_cloud/configuration.rb +166 -0
- data/lib/aspose_email_cloud/models/base_object.rb +88 -0
- data/lib/aspose_email_cloud/models/email_document.rb +63 -0
- data/lib/aspose_email_cloud/models/email_document_response.rb +79 -0
- data/lib/aspose_email_cloud/models/email_properties.rb +47 -0
- data/lib/aspose_email_cloud/models/email_property.rb +53 -0
- data/lib/aspose_email_cloud/models/email_property_response.rb +61 -0
- data/lib/aspose_email_cloud/models/link.rb +61 -0
- data/lib/aspose_email_cloud/models/stream.rb +37 -0
- data/lib/aspose_email_cloud/version.rb +3 -0
- data/test/data/README.TXT +1 -0
- data/test/data/email_test.eml +21 -0
- data/test/data/email_test2.eml +40 -0
- data/test/email_tests.rb +111 -0
- metadata +139 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
module AsposeEmailCloud
|
2
|
+
#
|
3
|
+
class Stream < BaseObject
|
4
|
+
attr_accessor :identity
|
5
|
+
# attribute mapping from ruby-style variable name to JSON key
|
6
|
+
def self.attribute_map
|
7
|
+
{
|
8
|
+
|
9
|
+
#
|
10
|
+
:'identity' => :'identity'
|
11
|
+
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
# attribute type
|
16
|
+
def self.swagger_types
|
17
|
+
{
|
18
|
+
:'identity' => :'Object'
|
19
|
+
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(attributes = {})
|
24
|
+
return if !attributes.is_a?(Hash) || attributes.empty?
|
25
|
+
|
26
|
+
# convert string to symbol for hash key
|
27
|
+
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
28
|
+
|
29
|
+
|
30
|
+
if attributes[:'identity']
|
31
|
+
self.identity = attributes[:'identity']
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
# Aspose.Email Cloud SDK for Java APIs Examples
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Return-path: <masood@kpisol.com>
|
2
|
+
Envelope-to: masood@kpisol.com
|
3
|
+
Delivery-date: Wed, 14 May 2014 03:43:47 -0600
|
4
|
+
Received: from [115.186.144.164] (port=3158 helo=[192.168.1.101])
|
5
|
+
by box260.bluehost.com with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128)
|
6
|
+
(Exim 4.82)
|
7
|
+
(envelope-from <masood@kpisol.com>)
|
8
|
+
id 1WkVj0-0007hM-Sr
|
9
|
+
for masood@kpisol.com; Wed, 14 May 2014 03:43:47 -0600
|
10
|
+
Message-ID: <53733ACC.7050206@kpisol.com>
|
11
|
+
Date: Wed, 14 May 2014 14:43:40 +0500
|
12
|
+
From: Masood Anwer <masood@kpisol.com>
|
13
|
+
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
|
14
|
+
MIME-Version: 1.0
|
15
|
+
To: masood@kpisol.com
|
16
|
+
Subject: test
|
17
|
+
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
|
18
|
+
Content-Transfer-Encoding: 7bit
|
19
|
+
X-Identified-User: {2469:box260.bluehost.com:kpisolco:kpisol.com} {sentby:smtp auth 115.186.144.164 authed with masood@kpisol.com}
|
20
|
+
|
21
|
+
test message
|
@@ -0,0 +1,40 @@
|
|
1
|
+
To: developer@aspose.com
|
2
|
+
From: sales@aspose.com
|
3
|
+
Date: 23 Jul 2015 11:46:09 +0000
|
4
|
+
MIME-Version: 1.0
|
5
|
+
Content-Type: multipart/mixed;
|
6
|
+
boundary="--_=_NextPart1_e7808e2d-e714-4b98-938b-519bc3f367e7"
|
7
|
+
|
8
|
+
This is a multi-part message in MIME format.
|
9
|
+
|
10
|
+
----_=_NextPart1_e7808e2d-e714-4b98-938b-519bc3f367e7
|
11
|
+
Content-Type: text/plain; charset="us-ascii"
|
12
|
+
Content-Transfer-Encoding: quoted-printable
|
13
|
+
To: developer@aspose.com
|
14
|
+
From: sales@aspose.com
|
15
|
+
Date: 23 Jul 2015 11:46:09 +0000
|
16
|
+
MIME-Version: 1.0
|
17
|
+
|
18
|
+
This is the Body
|
19
|
+
----_=_NextPart1_e7808e2d-e714-4b98-938b-519bc3f367e7
|
20
|
+
Content-Transfer-Encoding: base64
|
21
|
+
Content-Type: application/octet-stream; name="README.md"
|
22
|
+
|
23
|
+
IyBBc3Bvc2UuRW1haWwgQ2xvdWQgU0RLIGZvciBKYXZhIEFQSXMgRXhhbXBsZXMK
|
24
|
+
----_=_NextPart1_e7808e2d-e714-4b98-938b-519bc3f367e7
|
25
|
+
Content-Transfer-Encoding: base64
|
26
|
+
Content-Type: application/octet-stream; name="README.md"
|
27
|
+
|
28
|
+
IyBBc3Bvc2UuRW1haWwgQ2xvdWQgU0RLIGZvciBKYXZhIEFQSXMgRXhhbXBsZXMK
|
29
|
+
----_=_NextPart1_e7808e2d-e714-4b98-938b-519bc3f367e7
|
30
|
+
Content-Transfer-Encoding: base64
|
31
|
+
Content-Type: application/octet-stream; name="README.md"
|
32
|
+
|
33
|
+
IyBBc3Bvc2UuRW1haWwgQ2xvdWQgU0RLIGZvciBKYXZhIEFQSXMgRXhhbXBsZXMK
|
34
|
+
----_=_NextPart1_e7808e2d-e714-4b98-938b-519bc3f367e7
|
35
|
+
Content-Transfer-Encoding: base64
|
36
|
+
Content-Type: application/octet-stream; name="README.TXT"
|
37
|
+
|
38
|
+
IyBBc3Bvc2UuRW1haWwgQ2xvdWQgU0RLIGZvciBKYXZhIEFQSXMgRXhhbXBsZXMK
|
39
|
+
----_=_NextPart1_e7808e2d-e714-4b98-938b-519bc3f367e7--
|
40
|
+
|
data/test/email_tests.rb
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "minitest/unit"
|
3
|
+
|
4
|
+
require_relative '../lib/aspose_email_cloud'
|
5
|
+
|
6
|
+
class EmailTests < Minitest::Test
|
7
|
+
include MiniTest::Assertions
|
8
|
+
include AsposeEmailCloud
|
9
|
+
include AsposeStorageCloud
|
10
|
+
|
11
|
+
def setup
|
12
|
+
#Get App key and App SID from https://cloud.aspose.com
|
13
|
+
AsposeApp.app_key_and_sid("", "")
|
14
|
+
@email_api = EmailApi.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def teardown
|
18
|
+
end
|
19
|
+
|
20
|
+
def upload_file(file_name)
|
21
|
+
@storage_api = StorageApi.new
|
22
|
+
response = @storage_api.put_create(file_name, File.open("data/" << file_name,"r") { |io| io.read } )
|
23
|
+
assert(response, message="Failed to upload {file_name} file.")
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_get_document
|
27
|
+
file_name = "email_test.eml"
|
28
|
+
upload_file(file_name)
|
29
|
+
|
30
|
+
response = @email_api.get_document(file_name)
|
31
|
+
assert(response, message="Failed to get mail common info.")
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_get_document_with_format
|
35
|
+
file_name = "email_test.eml"
|
36
|
+
upload_file(file_name)
|
37
|
+
|
38
|
+
response = @email_api.get_document_with_format(file_name, "msg")
|
39
|
+
assert(response, message="Failed to get mail in specified format")
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_put_create_new_email
|
43
|
+
file_name = "email_test2.eml"
|
44
|
+
upload_file(file_name)
|
45
|
+
|
46
|
+
email_document = EmailDocument.new
|
47
|
+
|
48
|
+
email_body = EmailProperty.new
|
49
|
+
email_to = EmailProperty.new
|
50
|
+
email_from = EmailProperty.new
|
51
|
+
|
52
|
+
email_body.name = "Body"
|
53
|
+
email_body.value = "This is body"
|
54
|
+
|
55
|
+
email_to.name = "To"
|
56
|
+
email_to.value = "developer@aspose.com"
|
57
|
+
|
58
|
+
email_from.name = "From"
|
59
|
+
email_from.value = "sales@aspose.com"
|
60
|
+
|
61
|
+
email_properties = EmailProperties.new
|
62
|
+
email_properties.list = [email_body, email_to, email_from]
|
63
|
+
|
64
|
+
email_document.document_properties = email_properties
|
65
|
+
email_document.format = "eml"
|
66
|
+
|
67
|
+
response = @email_api.put_create_new_email(file_name, email_document)
|
68
|
+
assert(response, message="Failed to add new email.")
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_get_email_attachment
|
72
|
+
file_name = "email_test2.eml"
|
73
|
+
upload_file(file_name)
|
74
|
+
attach_name = "README.TXT"
|
75
|
+
|
76
|
+
response = @email_api.get_email_attachment(file_name, attach_name)
|
77
|
+
assert(response, message="Failed to get email attachment by name.")
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_post_add_email_attachment
|
81
|
+
file_name = "email_test.eml"
|
82
|
+
upload_file(file_name)
|
83
|
+
attach_name = "README.TXT"
|
84
|
+
upload_file(attach_name)
|
85
|
+
|
86
|
+
response = @email_api.post_add_email_attachment(file_name, attach_name)
|
87
|
+
assert(response, message="Failed to add email attachment.")
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_get_email_property
|
91
|
+
file_name = "email_test.eml"
|
92
|
+
upload_file(file_name)
|
93
|
+
|
94
|
+
property_name = "Body"
|
95
|
+
response = @email_api.get_email_property(property_name, file_name)
|
96
|
+
assert(response, message="Failed to read document property by name.")
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_put_set_email_property
|
100
|
+
file_name = "email_test.eml"
|
101
|
+
upload_file(file_name)
|
102
|
+
property_name = "Subject"
|
103
|
+
email_property = EmailProperty.new
|
104
|
+
email_property.name = "Subject"
|
105
|
+
email_property.value = "This is a new subject"
|
106
|
+
|
107
|
+
response = @email_api.put_set_email_property(file_name, property_name, email_property)
|
108
|
+
assert(response, message="Failed to set document property.")
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
metadata
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aspose_email_cloud
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- M. Sohail Ismail
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: typhoeus
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.8'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: json
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.7'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: aspose_storage_cloud
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.0'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 1.0.0
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '1.0'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 1.0.0
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: minitest
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '5.8'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '5.8'
|
75
|
+
description: Aspose.Email for Cloud is a REST API for creating email archiving applications
|
76
|
+
that work with common email file formats. It lets developers manipulate message
|
77
|
+
formats such as MSG, EML, and MHT files. The API supports many common tasks, for
|
78
|
+
example accessing messages, reading message properties such as sender, receiver,
|
79
|
+
message sent date, and message details. It also supports converting messages back
|
80
|
+
and forth between EML, MSG and MHT formats. With Aspose.Email for Cloud, it is further
|
81
|
+
possible to access messages and retrieve attachments that can then be saved to a
|
82
|
+
local disc. The robust API saves developers time and effort when programming with
|
83
|
+
emails in the cloud.
|
84
|
+
email:
|
85
|
+
- muhammad.sohail@aspose.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- LICENSE
|
91
|
+
- README.md
|
92
|
+
- aspose_email_cloud.gemspec
|
93
|
+
- lib/aspose_email_cloud.rb
|
94
|
+
- lib/aspose_email_cloud/api/email_api.rb
|
95
|
+
- lib/aspose_email_cloud/api_client.rb
|
96
|
+
- lib/aspose_email_cloud/api_error.rb
|
97
|
+
- lib/aspose_email_cloud/configuration.rb
|
98
|
+
- lib/aspose_email_cloud/models/base_object.rb
|
99
|
+
- lib/aspose_email_cloud/models/email_document.rb
|
100
|
+
- lib/aspose_email_cloud/models/email_document_response.rb
|
101
|
+
- lib/aspose_email_cloud/models/email_properties.rb
|
102
|
+
- lib/aspose_email_cloud/models/email_property.rb
|
103
|
+
- lib/aspose_email_cloud/models/email_property_response.rb
|
104
|
+
- lib/aspose_email_cloud/models/link.rb
|
105
|
+
- lib/aspose_email_cloud/models/stream.rb
|
106
|
+
- lib/aspose_email_cloud/version.rb
|
107
|
+
- test/data/README.TXT
|
108
|
+
- test/data/email_test.eml
|
109
|
+
- test/data/email_test2.eml
|
110
|
+
- test/email_tests.rb
|
111
|
+
homepage: http://www.aspose.com/cloud/email-api.aspx
|
112
|
+
licenses:
|
113
|
+
- MIT
|
114
|
+
metadata: {}
|
115
|
+
post_install_message:
|
116
|
+
rdoc_options: []
|
117
|
+
require_paths:
|
118
|
+
- lib
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
requirements: []
|
130
|
+
rubyforge_project:
|
131
|
+
rubygems_version: 2.5.1
|
132
|
+
signing_key:
|
133
|
+
specification_version: 4
|
134
|
+
summary: Aspose.Email for Cloud
|
135
|
+
test_files:
|
136
|
+
- test/data/README.TXT
|
137
|
+
- test/data/email_test.eml
|
138
|
+
- test/data/email_test2.eml
|
139
|
+
- test/email_tests.rb
|