aspose_email_cloud 1.0.2 → 18.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +5 -5
  2. data/src/asposeemailcloud.rb +55 -0
  3. data/src/asposeemailcloud/api/email_api.rb +418 -0
  4. data/src/asposeemailcloud/api/email_client_api.rb +960 -0
  5. data/src/asposeemailcloud/api_client.rb +389 -0
  6. data/src/asposeemailcloud/api_error.rb +38 -0
  7. data/{lib/aspose_email_cloud → src/asposeemailcloud}/configuration.rb +223 -166
  8. data/src/asposeemailcloud/models/email_document.rb +201 -0
  9. data/src/asposeemailcloud/models/email_document_response.rb +212 -0
  10. data/src/asposeemailcloud/models/email_properties.rb +200 -0
  11. data/src/asposeemailcloud/models/email_property.rb +199 -0
  12. data/src/asposeemailcloud/models/email_property_response.rb +212 -0
  13. data/src/asposeemailcloud/models/http_status_code.rb +76 -0
  14. data/src/asposeemailcloud/models/link.rb +219 -0
  15. data/src/asposeemailcloud/models/list_folders_response.rb +214 -0
  16. data/src/asposeemailcloud/models/list_response.rb +214 -0
  17. data/src/asposeemailcloud/models/mail_server_folder.rb +199 -0
  18. data/src/asposeemailcloud/models/mime_response.rb +212 -0
  19. data/src/asposeemailcloud/models/protocol_type.rb +34 -0
  20. data/src/asposeemailcloud/models/saa_spose_response.rb +202 -0
  21. data/src/asposeemailcloud/models/security_options.rb +33 -0
  22. data/src/asposeemailcloud/version.rb +15 -0
  23. metadata +173 -53
  24. data/LICENSE +0 -22
  25. data/README.md +0 -49
  26. data/aspose_email_cloud.gemspec +0 -26
  27. data/lib/aspose_email_cloud.rb +0 -38
  28. data/lib/aspose_email_cloud/api/email_api.rb +0 -431
  29. data/lib/aspose_email_cloud/api_client.rb +0 -335
  30. data/lib/aspose_email_cloud/api_error.rb +0 -24
  31. data/lib/aspose_email_cloud/models/base_object.rb +0 -88
  32. data/lib/aspose_email_cloud/models/email_document.rb +0 -63
  33. data/lib/aspose_email_cloud/models/email_document_response.rb +0 -79
  34. data/lib/aspose_email_cloud/models/email_properties.rb +0 -47
  35. data/lib/aspose_email_cloud/models/email_property.rb +0 -53
  36. data/lib/aspose_email_cloud/models/email_property_response.rb +0 -61
  37. data/lib/aspose_email_cloud/models/link.rb +0 -61
  38. data/lib/aspose_email_cloud/models/stream.rb +0 -37
  39. data/lib/aspose_email_cloud/version.rb +0 -3
  40. data/test/email_tests.rb +0 -111
@@ -1,79 +0,0 @@
1
- module AsposeEmailCloud
2
- #
3
- class EmailDocumentResponse < BaseObject
4
- attr_accessor :link, :properties, :document, :status, :code
5
- # attribute mapping from ruby-style variable name to JSON key
6
- def self.attribute_map
7
- {
8
-
9
- #
10
- :'link' => :'Link',
11
-
12
- #
13
- :'properties' => :'Properties',
14
-
15
- #
16
- :'document' => :'Document',
17
-
18
- #
19
- :'status' => :'Status',
20
-
21
- #
22
- :'code' => :'Code'
23
-
24
- }
25
- end
26
-
27
- # attribute type
28
- def self.swagger_types
29
- {
30
- :'link' => :'Link',
31
- :'properties' => :'Array<EmailProperty>',
32
- :'document' => :'EmailDocument',
33
- :'status' => :'String',
34
- :'code' => :'Integer'
35
-
36
- }
37
- end
38
-
39
- def initialize(attributes = {})
40
- return if !attributes.is_a?(Hash) || attributes.empty?
41
-
42
- # convert string to symbol for hash key
43
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
44
-
45
-
46
- if attributes[:'Link']
47
- self.link = attributes[:'Link']
48
- end
49
-
50
- if attributes[:'Properties']
51
- if (value = attributes[:'Properties']).is_a?(Array)
52
- self.properties = value
53
- end
54
- end
55
-
56
- if attributes[:'Document']
57
- self.document = attributes[:'Document']
58
- end
59
-
60
- if attributes[:'Status']
61
- self.status = attributes[:'Status']
62
- end
63
-
64
- if attributes[:'Code']
65
- self.code = attributes[:'Code']
66
- end
67
-
68
- end
69
-
70
- def status=(status)
71
- allowed_values = ["Continue", "SwitchingProtocols", "OK", "Created", "Accepted", "NonAuthoritativeInformation", "NoContent", "ResetContent", "PartialContent", "MultipleChoices", "Ambiguous", "MovedPermanently", "Moved", "Found", "Redirect", "SeeOther", "RedirectMethod", "NotModified", "UseProxy", "Unused", "TemporaryRedirect", "RedirectKeepVerb", "BadRequest", "Unauthorized", "PaymentRequired", "Forbidden", "NotFound", "MethodNotAllowed", "NotAcceptable", "ProxyAuthenticationRequired", "RequestTimeout", "Conflict", "Gone", "LengthRequired", "PreconditionFailed", "RequestEntityTooLarge", "RequestUriTooLong", "UnsupportedMediaType", "RequestedRangeNotSatisfiable", "ExpectationFailed", "UpgradeRequired", "InternalServerError", "NotImplemented", "BadGateway", "ServiceUnavailable", "GatewayTimeout", "HttpVersionNotSupported"]
72
- if status && !allowed_values.include?(status)
73
- fail "invalid value for 'status', must be one of #{allowed_values}"
74
- end
75
- @status = status
76
- end
77
-
78
- end
79
- end
@@ -1,47 +0,0 @@
1
- module AsposeEmailCloud
2
- #
3
- class EmailProperties < BaseObject
4
- attr_accessor :link, :list
5
- # attribute mapping from ruby-style variable name to JSON key
6
- def self.attribute_map
7
- {
8
-
9
- #
10
- :'link' => :'Link',
11
-
12
- #
13
- :'list' => :'List'
14
-
15
- }
16
- end
17
-
18
- # attribute type
19
- def self.swagger_types
20
- {
21
- :'link' => :'Link',
22
- :'list' => :'Array<EmailProperty>'
23
-
24
- }
25
- end
26
-
27
- def initialize(attributes = {})
28
- return if !attributes.is_a?(Hash) || attributes.empty?
29
-
30
- # convert string to symbol for hash key
31
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
32
-
33
-
34
- if attributes[:'Link']
35
- self.link = attributes[:'Link']
36
- end
37
-
38
- if attributes[:'List']
39
- if (value = attributes[:'List']).is_a?(Array)
40
- self.list = value
41
- end
42
- end
43
-
44
- end
45
-
46
- end
47
- end
@@ -1,53 +0,0 @@
1
- module AsposeEmailCloud
2
- #
3
- class EmailProperty < BaseObject
4
- attr_accessor :link, :name, :value
5
- # attribute mapping from ruby-style variable name to JSON key
6
- def self.attribute_map
7
- {
8
-
9
- #
10
- :'link' => :'Link',
11
-
12
- #
13
- :'name' => :'Name',
14
-
15
- #
16
- :'value' => :'Value'
17
-
18
- }
19
- end
20
-
21
- # attribute type
22
- def self.swagger_types
23
- {
24
- :'link' => :'Link',
25
- :'name' => :'String',
26
- :'value' => :'Object'
27
-
28
- }
29
- end
30
-
31
- def initialize(attributes = {})
32
- return if !attributes.is_a?(Hash) || attributes.empty?
33
-
34
- # convert string to symbol for hash key
35
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
36
-
37
-
38
- if attributes[:'Link']
39
- self.link = attributes[:'Link']
40
- end
41
-
42
- if attributes[:'Name']
43
- self.name = attributes[:'Name']
44
- end
45
-
46
- if attributes[:'Value']
47
- self.value = attributes[:'Value']
48
- end
49
-
50
- end
51
-
52
- end
53
- end
@@ -1,61 +0,0 @@
1
- module AsposeEmailCloud
2
- #
3
- class EmailPropertyResponse < BaseObject
4
- attr_accessor :email_property, :status, :code
5
- # attribute mapping from ruby-style variable name to JSON key
6
- def self.attribute_map
7
- {
8
-
9
- #
10
- :'email_property' => :'EmailProperty',
11
-
12
- #
13
- :'status' => :'Status',
14
-
15
- #
16
- :'code' => :'Code'
17
-
18
- }
19
- end
20
-
21
- # attribute type
22
- def self.swagger_types
23
- {
24
- :'email_property' => :'EmailProperty',
25
- :'status' => :'String',
26
- :'code' => :'Integer'
27
-
28
- }
29
- end
30
-
31
- def initialize(attributes = {})
32
- return if !attributes.is_a?(Hash) || attributes.empty?
33
-
34
- # convert string to symbol for hash key
35
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
36
-
37
-
38
- if attributes[:'EmailProperty']
39
- self.email_property = attributes[:'EmailProperty']
40
- end
41
-
42
- if attributes[:'Status']
43
- self.status = attributes[:'Status']
44
- end
45
-
46
- if attributes[:'Code']
47
- self.code = attributes[:'Code']
48
- end
49
-
50
- end
51
-
52
- def status=(status)
53
- allowed_values = ["Continue", "SwitchingProtocols", "OK", "Created", "Accepted", "NonAuthoritativeInformation", "NoContent", "ResetContent", "PartialContent", "MultipleChoices", "Ambiguous", "MovedPermanently", "Moved", "Found", "Redirect", "SeeOther", "RedirectMethod", "NotModified", "UseProxy", "Unused", "TemporaryRedirect", "RedirectKeepVerb", "BadRequest", "Unauthorized", "PaymentRequired", "Forbidden", "NotFound", "MethodNotAllowed", "NotAcceptable", "ProxyAuthenticationRequired", "RequestTimeout", "Conflict", "Gone", "LengthRequired", "PreconditionFailed", "RequestEntityTooLarge", "RequestUriTooLong", "UnsupportedMediaType", "RequestedRangeNotSatisfiable", "ExpectationFailed", "UpgradeRequired", "InternalServerError", "NotImplemented", "BadGateway", "ServiceUnavailable", "GatewayTimeout", "HttpVersionNotSupported"]
54
- if status && !allowed_values.include?(status)
55
- fail "invalid value for 'status', must be one of #{allowed_values}"
56
- end
57
- @status = status
58
- end
59
-
60
- end
61
- end
@@ -1,61 +0,0 @@
1
- module AsposeEmailCloud
2
- #
3
- class Link < BaseObject
4
- attr_accessor :href, :rel, :type, :title
5
- # attribute mapping from ruby-style variable name to JSON key
6
- def self.attribute_map
7
- {
8
-
9
- #
10
- :'href' => :'Href',
11
-
12
- #
13
- :'rel' => :'Rel',
14
-
15
- #
16
- :'type' => :'Type',
17
-
18
- #
19
- :'title' => :'Title'
20
-
21
- }
22
- end
23
-
24
- # attribute type
25
- def self.swagger_types
26
- {
27
- :'href' => :'String',
28
- :'rel' => :'String',
29
- :'type' => :'String',
30
- :'title' => :'String'
31
-
32
- }
33
- end
34
-
35
- def initialize(attributes = {})
36
- return if !attributes.is_a?(Hash) || attributes.empty?
37
-
38
- # convert string to symbol for hash key
39
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
40
-
41
-
42
- if attributes[:'Href']
43
- self.href = attributes[:'Href']
44
- end
45
-
46
- if attributes[:'Rel']
47
- self.rel = attributes[:'Rel']
48
- end
49
-
50
- if attributes[:'Type']
51
- self.type = attributes[:'Type']
52
- end
53
-
54
- if attributes[:'Title']
55
- self.title = attributes[:'Title']
56
- end
57
-
58
- end
59
-
60
- end
61
- end
@@ -1,37 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- module AsposeEmailCloud
2
- VERSION = "1.0.2"
3
- end
data/test/email_tests.rb DELETED
@@ -1,111 +0,0 @@
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