aspose_storage_cloud 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,88 @@
1
+ require 'date'
2
+
3
+ module AsposeStorageCloud
4
+ # base class containing fundamental method such as to_hash, build_from_hash and more
5
+ class BaseObject
6
+
7
+ # build the object from hash
8
+ def build_from_hash(attributes)
9
+ return nil unless attributes.is_a?(Hash)
10
+ self.class.swagger_types.each_pair do |key, type|
11
+ if type =~ /^Array<(.*)>/i
12
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
13
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
14
+ else
15
+ #TODO show warning in debug mode
16
+ end
17
+ elsif !attributes[self.class.attribute_map[key]].nil?
18
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
19
+ else
20
+ # data not found in attributes(hash), not an issue as the data can be optional
21
+ end
22
+ end
23
+
24
+ self
25
+ end
26
+
27
+ def _deserialize(type, value)
28
+ case type.to_sym
29
+ when :DateTime
30
+ DateTime.parse(value)
31
+ when :Date
32
+ Date.parse(value)
33
+ when :String
34
+ value.to_s
35
+ when :Integer
36
+ value.to_i
37
+ when :Float
38
+ value.to_f
39
+ when :BOOLEAN
40
+ #Before applying regular expression, convert boolean value to String
41
+ value = String(value)
42
+ if value =~ /^(true|t|yes|y|1)$/i
43
+ true
44
+ else
45
+ false
46
+ end
47
+ else # model
48
+ _model = AsposeStorageCloud.const_get(type).new
49
+ _model.build_from_hash(value)
50
+ end
51
+ end
52
+
53
+ def to_s
54
+ to_hash.to_s
55
+ end
56
+
57
+ # to_body is an alias to to_body (backward compatibility))
58
+ def to_body
59
+ to_hash
60
+ end
61
+
62
+ # return the object in the form of hash
63
+ def to_hash
64
+ hash = {}
65
+ self.class.attribute_map.each_pair do |attr, param|
66
+ value = self.send(attr)
67
+ next if value.nil?
68
+ if value.is_a?(Array)
69
+ hash[param] = value.compact.map{ |v| _to_hash(v) }
70
+ else
71
+ hash[param] = _to_hash(value)
72
+ end
73
+ end
74
+ hash
75
+ end
76
+
77
+ # Method to output non-array value in the form of hash
78
+ # For object, use to_hash. Otherwise, just return the value
79
+ def _to_hash(value)
80
+ if value.respond_to? :to_hash
81
+ value.to_hash
82
+ else
83
+ value
84
+ end
85
+ end
86
+
87
+ end
88
+ end
@@ -0,0 +1,53 @@
1
+ module AsposeStorageCloud
2
+ #
3
+ class BaseResponse < BaseObject
4
+ attr_accessor :code, :status
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ #
10
+ :'code' => :'Code',
11
+
12
+ #
13
+ :'status' => :'Status'
14
+
15
+ }
16
+ end
17
+
18
+ # attribute type
19
+ def self.swagger_types
20
+ {
21
+ :'code' => :'String',
22
+ :'status' => :'String'
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[:'Code']
35
+ self.code = attributes[:'Code']
36
+ end
37
+
38
+ if attributes[:'Status']
39
+ self.status = attributes[:'Status']
40
+ end
41
+
42
+ end
43
+
44
+ def status=(status)
45
+ 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"]
46
+ if status && !allowed_values.include?(status)
47
+ fail "invalid value for 'status', must be one of #{allowed_values}"
48
+ end
49
+ @status = status
50
+ end
51
+
52
+ end
53
+ end
@@ -0,0 +1,45 @@
1
+ module AsposeStorageCloud
2
+ #
3
+ class DiscUsage < BaseObject
4
+ attr_accessor :used_size, :total_size
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ #
10
+ :'used_size' => :'UsedSize',
11
+
12
+ #
13
+ :'total_size' => :'TotalSize'
14
+
15
+ }
16
+ end
17
+
18
+ # attribute type
19
+ def self.swagger_types
20
+ {
21
+ :'used_size' => :'Integer',
22
+ :'total_size' => :'Integer'
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[:'UsedSize']
35
+ self.used_size = attributes[:'UsedSize']
36
+ end
37
+
38
+ if attributes[:'TotalSize']
39
+ self.total_size = attributes[:'TotalSize']
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+ end
@@ -0,0 +1,61 @@
1
+ module AsposeStorageCloud
2
+ #
3
+ class DiscUsageResponse < BaseObject
4
+ attr_accessor :disc_usage, :code, :status
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ #
10
+ :'disc_usage' => :'DiscUsage',
11
+
12
+ #
13
+ :'code' => :'Code',
14
+
15
+ #
16
+ :'status' => :'Status'
17
+
18
+ }
19
+ end
20
+
21
+ # attribute type
22
+ def self.swagger_types
23
+ {
24
+ :'disc_usage' => :'DiscUsage',
25
+ :'code' => :'String',
26
+ :'status' => :'String'
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[:'DiscUsage']
39
+ self.disc_usage = attributes[:'DiscUsage']
40
+ end
41
+
42
+ if attributes[:'Code']
43
+ self.code = attributes[:'Code']
44
+ end
45
+
46
+ if attributes[:'Status']
47
+ self.status = attributes[:'Status']
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
@@ -0,0 +1,44 @@
1
+ module AsposeStorageCloud
2
+ #
3
+ class FileExist < BaseObject
4
+ attr_accessor :is_exist, :is_folder
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ #
10
+ :'is_exist' => :'IsExist',
11
+
12
+ #
13
+ :'is_folder' => :'IsFolder'
14
+
15
+ }
16
+ end
17
+
18
+ # attribute type
19
+ def self.swagger_types
20
+ {
21
+ :'is_exist' => :'BOOLEAN',
22
+ :'is_folder' => :'BOOLEAN'
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
+ if attributes[:'IsExist']
34
+ self.is_exist = attributes[:'IsExist']
35
+ end
36
+
37
+ if attributes[:'IsFolder']
38
+ self.is_folder = attributes[:'IsFolder']
39
+ end
40
+
41
+ end
42
+
43
+ end
44
+ end
@@ -0,0 +1,62 @@
1
+ module AsposeStorageCloud
2
+ #
3
+ class FileExistResponse < BaseObject
4
+ attr_accessor :file_exist, :code, :status
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ #
10
+ :'file_exist' => :'FileExist',
11
+
12
+ #
13
+ :'code' => :'Code',
14
+
15
+ #
16
+ :'status' => :'Status'
17
+
18
+ }
19
+ end
20
+
21
+ # attribute type
22
+ def self.swagger_types
23
+ {
24
+ :'file_exist' => :'FileExist',
25
+ :'code' => :'String',
26
+ :'status' => :'String'
27
+
28
+ }
29
+ end
30
+
31
+ def initialize(attributes = {})
32
+
33
+ return if !attributes.is_a?(Hash) || attributes.empty?
34
+
35
+ # convert string to symbol for hash key
36
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
37
+
38
+
39
+ if attributes[:'FileExist']
40
+ self.file_exist = attributes[:'FileExist']
41
+ end
42
+
43
+ if attributes[:'Code']
44
+ self.code = attributes[:'Code']
45
+ end
46
+
47
+ if attributes[:'Status']
48
+ self.status = attributes[:'Status']
49
+ end
50
+
51
+ end
52
+
53
+ def status=(status)
54
+ 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"]
55
+ if status && !allowed_values.include?(status)
56
+ fail "invalid value for 'status', must be one of #{allowed_values}"
57
+ end
58
+ @status = status
59
+ end
60
+
61
+ end
62
+ end
@@ -0,0 +1,69 @@
1
+ module AsposeStorageCloud
2
+ #
3
+ class FileResponse < BaseObject
4
+ attr_accessor :name, :path, :modified_date, :is_folder, :size
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ #
10
+ :'name' => :'Name',
11
+
12
+ #
13
+ :'path' => :'Path',
14
+
15
+ #
16
+ :'modified_date' => :'ModifiedDate',
17
+
18
+ #
19
+ :'is_folder' => :'IsFolder',
20
+
21
+ #
22
+ :'size' => :'Size'
23
+
24
+ }
25
+ end
26
+
27
+ # attribute type
28
+ def self.swagger_types
29
+ {
30
+ :'name' => :'String',
31
+ :'path' => :'String',
32
+ :'modified_date' => :'String',
33
+ :'is_folder' => :'BOOLEAN',
34
+ :'size' => :'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[:'Name']
47
+ self.name = attributes[:'Name']
48
+ end
49
+
50
+ if attributes[:'Path']
51
+ self.path = attributes[:'Path']
52
+ end
53
+
54
+ if attributes[:'ModifiedDate']
55
+ self.modified_date = attributes[:'ModifiedDate']
56
+ end
57
+
58
+ if attributes[:'IsFolder']
59
+ self.is_folder = attributes[:'IsFolder']
60
+ end
61
+
62
+ if attributes[:'Size']
63
+ self.size = attributes[:'Size']
64
+ end
65
+
66
+ end
67
+
68
+ end
69
+ end
@@ -0,0 +1,85 @@
1
+ module AsposeStorageCloud
2
+ #
3
+ class FileVersion < BaseObject
4
+ attr_accessor :version_id, :is_latest, :name, :is_folder, :modified_date, :size, :path
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ #
10
+ :'version_id' => :'VersionId',
11
+
12
+ #
13
+ :'is_latest' => :'IsLatest',
14
+
15
+ #
16
+ :'name' => :'Name',
17
+
18
+ #
19
+ :'is_folder' => :'IsFolder',
20
+
21
+ #
22
+ :'modified_date' => :'ModifiedDate',
23
+
24
+ #
25
+ :'size' => :'Size',
26
+
27
+ #
28
+ :'path' => :'Path'
29
+
30
+ }
31
+ end
32
+
33
+ # attribute type
34
+ def self.swagger_types
35
+ {
36
+ :'version_id' => :'String',
37
+ :'is_latest' => :'BOOLEAN',
38
+ :'name' => :'String',
39
+ :'is_folder' => :'BOOLEAN',
40
+ :'modified_date' => :'String',
41
+ :'size' => :'Integer',
42
+ :'path' => :'String'
43
+
44
+ }
45
+ end
46
+
47
+ def initialize(attributes = {})
48
+ return if !attributes.is_a?(Hash) || attributes.empty?
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
52
+
53
+
54
+ if attributes[:'VersionId']
55
+ self.version_id = attributes[:'VersionId']
56
+ end
57
+
58
+ if attributes[:'IsLatest']
59
+ self.is_latest = attributes[:'IsLatest']
60
+ end
61
+
62
+ if attributes[:'Name']
63
+ self.name = attributes[:'Name']
64
+ end
65
+
66
+ if attributes[:'IsFolder']
67
+ self.is_folder = attributes[:'IsFolder']
68
+ end
69
+
70
+ if attributes[:'ModifiedDate']
71
+ self.modified_date = attributes[:'ModifiedDate']
72
+ end
73
+
74
+ if attributes[:'Size']
75
+ self.size = attributes[:'Size']
76
+ end
77
+
78
+ if attributes[:'Path']
79
+ self.path = attributes[:'Path']
80
+ end
81
+
82
+ end
83
+
84
+ end
85
+ end