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
@@ -0,0 +1,199 @@
1
+ =begin
2
+ #Aspose.Email for Cloud API Reference
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module asposeemailcloud
16
+ # Email property.
17
+ class EmailProperty
18
+ # Gets or sets link that originate from this document.
19
+ attr_accessor :link
20
+
21
+ # Gets or sets name of email property.
22
+ attr_accessor :name
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'link' => :'Link',
29
+ :'name' => :'Name'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.swagger_types
35
+ {
36
+ :'link' => :'Link',
37
+ :'name' => :'String'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
+
49
+ if attributes.has_key?(:'Link')
50
+ self.link = attributes[:'Link']
51
+ end
52
+
53
+ if attributes.has_key?(:'Name')
54
+ self.name = attributes[:'Name']
55
+ end
56
+
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properies with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ return invalid_properties
64
+ end
65
+
66
+ # Check to see if the all the properties in the model are valid
67
+ # @return true if the model is valid
68
+ def valid?
69
+ return true
70
+ end
71
+
72
+ # Checks equality by comparing each attribute.
73
+ # @param [Object] Object to be compared
74
+ def ==(o)
75
+ return true if self.equal?(o)
76
+ self.class == o.class &&
77
+ link == o.link &&
78
+ name == o.name
79
+ end
80
+
81
+ # @see the `==` method
82
+ # @param [Object] Object to be compared
83
+ def eql?(o)
84
+ self == o
85
+ end
86
+
87
+ # Calculates hash code according to all attributes.
88
+ # @return [Fixnum] Hash code
89
+ def hash
90
+ [link, name].hash
91
+ end
92
+
93
+ # Builds the object from hash
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ # @return [Object] Returns the model itself
96
+ def build_from_hash(attributes)
97
+ return nil unless attributes.is_a?(Hash)
98
+ self.class.swagger_types.each_pair do |key, type|
99
+ if type =~ /\AArray<(.*)>/i
100
+ # check to ensure the input is an array given that the the attribute
101
+ # is documented as an array but the input is not
102
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
103
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
104
+ end
105
+ elsif !attributes[self.class.attribute_map[key]].nil?
106
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
107
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
108
+ end
109
+
110
+ self
111
+ end
112
+
113
+ # Deserializes the data based on type
114
+ # @param string type Data type
115
+ # @param string value Value to be deserialized
116
+ # @return [Object] Deserialized data
117
+ def _deserialize(type, value)
118
+ case type.to_sym
119
+ when :DateTime
120
+ DateTime.parse(value)
121
+ when :Date
122
+ Date.parse(value)
123
+ when :String
124
+ value.to_s
125
+ when :Integer
126
+ value.to_i
127
+ when :Float
128
+ value.to_f
129
+ when :BOOLEAN
130
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
131
+ true
132
+ else
133
+ false
134
+ end
135
+ when :Object
136
+ # generic object (usually a Hash), return directly
137
+ value
138
+ when /\AArray<(?<inner_type>.+)>\z/
139
+ inner_type = Regexp.last_match[:inner_type]
140
+ value.map { |v| _deserialize(inner_type, v) }
141
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
142
+ k_type = Regexp.last_match[:k_type]
143
+ v_type = Regexp.last_match[:v_type]
144
+ {}.tap do |hash|
145
+ value.each do |k, v|
146
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
147
+ end
148
+ end
149
+ else # model
150
+ temp_model = asposeemailcloud.const_get(type).new
151
+ temp_model.build_from_hash(value)
152
+ end
153
+ end
154
+
155
+ # Returns the string representation of the object
156
+ # @return [String] String presentation of the object
157
+ def to_s
158
+ to_hash.to_s
159
+ end
160
+
161
+ # to_body is an alias to to_hash (backward compatibility)
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_body
164
+ to_hash
165
+ end
166
+
167
+ # Returns the object in the form of hash
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_hash
170
+ hash = {}
171
+ self.class.attribute_map.each_pair do |attr, param|
172
+ value = self.send(attr)
173
+ next if value.nil?
174
+ hash[param] = _to_hash(value)
175
+ end
176
+ hash
177
+ end
178
+
179
+ # Outputs non-array value in the form of hash
180
+ # For object, use to_hash. Otherwise, just return the value
181
+ # @param [Object] value Any valid value
182
+ # @return [Hash] Returns the value in the form of hash
183
+ def _to_hash(value)
184
+ if value.is_a?(Array)
185
+ value.compact.map{ |v| _to_hash(v) }
186
+ elsif value.is_a?(Hash)
187
+ {}.tap do |hash|
188
+ value.each { |k, v| hash[k] = _to_hash(v) }
189
+ end
190
+ elsif value.respond_to? :to_hash
191
+ value.to_hash
192
+ else
193
+ value
194
+ end
195
+ end
196
+
197
+ end
198
+
199
+ end
@@ -0,0 +1,212 @@
1
+ =begin
2
+ #Aspose.Email for Cloud API Reference
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module asposeemailcloud
16
+ # Email property response.
17
+ class EmailPropertyResponse
18
+ attr_accessor :code
19
+
20
+ attr_accessor :status
21
+
22
+ # Gets or sets email property.
23
+ attr_accessor :email_property
24
+
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'code' => :'Code',
30
+ :'status' => :'Status',
31
+ :'email_property' => :'EmailProperty'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.swagger_types
37
+ {
38
+ :'code' => :'HttpStatusCode',
39
+ :'status' => :'String',
40
+ :'email_property' => :'EmailProperty'
41
+ }
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ return unless attributes.is_a?(Hash)
48
+
49
+ # convert string to symbol for hash key
50
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
51
+
52
+ if attributes.has_key?(:'Code')
53
+ self.code = attributes[:'Code']
54
+ end
55
+
56
+ if attributes.has_key?(:'Status')
57
+ self.status = attributes[:'Status']
58
+ end
59
+
60
+ if attributes.has_key?(:'EmailProperty')
61
+ self.email_property = attributes[:'EmailProperty']
62
+ end
63
+
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properies with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ if @code.nil?
71
+ invalid_properties.push("invalid value for 'code', code cannot be nil.")
72
+ end
73
+
74
+ return invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ return false if @code.nil?
81
+ return true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ code == o.code &&
90
+ status == o.status &&
91
+ email_property == o.email_property
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Fixnum] Hash code
102
+ def hash
103
+ [code, status, email_property].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.swagger_types.each_pair do |key, type|
112
+ if type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
116
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ # Deserializes the data based on type
127
+ # @param string type Data type
128
+ # @param string value Value to be deserialized
129
+ # @return [Object] Deserialized data
130
+ def _deserialize(type, value)
131
+ case type.to_sym
132
+ when :DateTime
133
+ DateTime.parse(value)
134
+ when :Date
135
+ Date.parse(value)
136
+ when :String
137
+ value.to_s
138
+ when :Integer
139
+ value.to_i
140
+ when :Float
141
+ value.to_f
142
+ when :BOOLEAN
143
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
144
+ true
145
+ else
146
+ false
147
+ end
148
+ when :Object
149
+ # generic object (usually a Hash), return directly
150
+ value
151
+ when /\AArray<(?<inner_type>.+)>\z/
152
+ inner_type = Regexp.last_match[:inner_type]
153
+ value.map { |v| _deserialize(inner_type, v) }
154
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
155
+ k_type = Regexp.last_match[:k_type]
156
+ v_type = Regexp.last_match[:v_type]
157
+ {}.tap do |hash|
158
+ value.each do |k, v|
159
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
+ end
161
+ end
162
+ else # model
163
+ temp_model = asposeemailcloud.const_get(type).new
164
+ temp_model.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.compact.map{ |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to? :to_hash
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+
210
+ end
211
+
212
+ end
@@ -0,0 +1,76 @@
1
+ =begin
2
+ #Aspose.Email for Cloud API Reference
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module asposeemailcloud
16
+ class HttpStatusCode
17
+
18
+ 100 = 100.freeze
19
+ 101 = 101.freeze
20
+ 200 = 200.freeze
21
+ 201 = 201.freeze
22
+ 202 = 202.freeze
23
+ 203 = 203.freeze
24
+ 204 = 204.freeze
25
+ 205 = 205.freeze
26
+ 206 = 206.freeze
27
+ 300 = 300.freeze
28
+ 300 = 300.freeze
29
+ 301 = 301.freeze
30
+ 301 = 301.freeze
31
+ 302 = 302.freeze
32
+ 302 = 302.freeze
33
+ 303 = 303.freeze
34
+ 303 = 303.freeze
35
+ 304 = 304.freeze
36
+ 305 = 305.freeze
37
+ 306 = 306.freeze
38
+ 307 = 307.freeze
39
+ 307 = 307.freeze
40
+ 400 = 400.freeze
41
+ 401 = 401.freeze
42
+ 402 = 402.freeze
43
+ 403 = 403.freeze
44
+ 404 = 404.freeze
45
+ 405 = 405.freeze
46
+ 406 = 406.freeze
47
+ 407 = 407.freeze
48
+ 408 = 408.freeze
49
+ 409 = 409.freeze
50
+ 410 = 410.freeze
51
+ 411 = 411.freeze
52
+ 412 = 412.freeze
53
+ 413 = 413.freeze
54
+ 414 = 414.freeze
55
+ 415 = 415.freeze
56
+ 416 = 416.freeze
57
+ 417 = 417.freeze
58
+ 426 = 426.freeze
59
+ 500 = 500.freeze
60
+ 501 = 501.freeze
61
+ 502 = 502.freeze
62
+ 503 = 503.freeze
63
+ 504 = 504.freeze
64
+ 505 = 505.freeze
65
+
66
+ # Builds the enum from string
67
+ # @param [String] The enum value in the form of the string
68
+ # @return [String] The enum value
69
+ def build_from_hash(value)
70
+ consantValues = HttpStatusCode.constants.select{|c| c.to_s == value}
71
+ raise "Invalid ENUM value #{value} for class #HttpStatusCode" if consantValues.empty?
72
+ value
73
+ end
74
+ end
75
+
76
+ end