comet_backup_ruby_sdk 0.4.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/RELEASING.md +1 -1
- data/comet_backup_ruby_sdk.gemspec +1 -1
- data/lib/comet/comet_server.rb +227 -2
- data/lib/comet/definitions.rb +5 -5
- data/lib/comet/models/admin_account_properties_response.rb +9 -0
- data/lib/comet/models/admin_email_options.rb +84 -0
- data/lib/comet/models/bucket_properties.rb +9 -0
- data/lib/comet/models/destination_config.rb +6 -0
- data/lib/comet/models/group_policy.rb +9 -0
- data/lib/comet/models/install_creds.rb +99 -0
- data/lib/comet/models/install_token.rb +117 -0
- data/lib/comet/models/install_token_response.rb +92 -0
- data/lib/comet/models/news_entry.rb +9 -0
- data/lib/comet/models/organization.rb +145 -0
- data/lib/comet/models/organization_response.rb +101 -0
- data/lib/comet/models/remote_storage_option.rb +6 -0
- data/lib/comet/models/streamable_event.rb +9 -0
- data/lib/comet/models/user_profile_config.rb +11 -0
- data/lib/comet_backup_ruby_sdk.rb +6 -0
- metadata +8 -2
@@ -14,6 +14,9 @@ module Comet
|
|
14
14
|
# AdminAccountPropertiesResponse is a typed class wrapper around the underlying Comet Server API data structure.
|
15
15
|
class AdminAccountPropertiesResponse
|
16
16
|
|
17
|
+
# @type [String] organization_id
|
18
|
+
attr_accessor :organization_id
|
19
|
+
|
17
20
|
# @type [Comet::AdminUserPermissions] permissions
|
18
21
|
attr_accessor :permissions
|
19
22
|
|
@@ -28,6 +31,7 @@ module Comet
|
|
28
31
|
end
|
29
32
|
|
30
33
|
def clear
|
34
|
+
@organization_id = ''
|
31
35
|
@permissions = Comet::AdminUserPermissions.new
|
32
36
|
@security = Comet::AdminSecurityOptions.new
|
33
37
|
@unknown_json_fields = {}
|
@@ -46,6 +50,10 @@ module Comet
|
|
46
50
|
|
47
51
|
obj.each do |k, v|
|
48
52
|
case k
|
53
|
+
when 'OrganizationID'
|
54
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
55
|
+
|
56
|
+
@organization_id = v
|
49
57
|
when 'Permissions'
|
50
58
|
@permissions = Comet::AdminUserPermissions.new
|
51
59
|
@permissions.from_hash(v)
|
@@ -61,6 +69,7 @@ module Comet
|
|
61
69
|
# @return [Hash] The complete object as a Ruby hash
|
62
70
|
def to_hash
|
63
71
|
ret = {}
|
72
|
+
ret['OrganizationID'] = @organization_id
|
64
73
|
ret['Permissions'] = @permissions
|
65
74
|
ret['Security'] = @security
|
66
75
|
@unknown_json_fields.each do |k, v|
|
@@ -0,0 +1,84 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# AdminEmailOptions is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class AdminEmailOptions
|
16
|
+
|
17
|
+
# @type [String] from_email
|
18
|
+
attr_accessor :from_email
|
19
|
+
|
20
|
+
# @type [String] from_name
|
21
|
+
attr_accessor :from_name
|
22
|
+
|
23
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
24
|
+
attr_accessor :unknown_json_fields
|
25
|
+
|
26
|
+
def initialize
|
27
|
+
clear
|
28
|
+
end
|
29
|
+
|
30
|
+
def clear
|
31
|
+
@from_email = ''
|
32
|
+
@from_name = ''
|
33
|
+
@unknown_json_fields = {}
|
34
|
+
end
|
35
|
+
|
36
|
+
# @param [String] json_string The complete object in JSON format
|
37
|
+
def from_json(json_string)
|
38
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
39
|
+
|
40
|
+
from_hash(JSON.parse(json_string))
|
41
|
+
end
|
42
|
+
|
43
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
44
|
+
def from_hash(obj)
|
45
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
46
|
+
|
47
|
+
obj.each do |k, v|
|
48
|
+
case k
|
49
|
+
when 'FromEmail'
|
50
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
51
|
+
|
52
|
+
@from_email = v
|
53
|
+
when 'FromName'
|
54
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
55
|
+
|
56
|
+
@from_name = v
|
57
|
+
else
|
58
|
+
@unknown_json_fields[k] = v
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# @return [Hash] The complete object as a Ruby hash
|
64
|
+
def to_hash
|
65
|
+
ret = {}
|
66
|
+
ret['FromEmail'] = @from_email
|
67
|
+
ret['FromName'] = @from_name
|
68
|
+
@unknown_json_fields.each do |k, v|
|
69
|
+
ret[k] = v
|
70
|
+
end
|
71
|
+
ret
|
72
|
+
end
|
73
|
+
|
74
|
+
# @return [Hash] The complete object as a Ruby hash
|
75
|
+
def to_h
|
76
|
+
to_hash
|
77
|
+
end
|
78
|
+
|
79
|
+
# @return [String] The complete object as a JSON string
|
80
|
+
def to_json(options = {})
|
81
|
+
to_hash.to_json(options)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -14,6 +14,9 @@ module Comet
|
|
14
14
|
# BucketProperties is a typed class wrapper around the underlying Comet Server API data structure.
|
15
15
|
class BucketProperties
|
16
16
|
|
17
|
+
# @type [String] organization_id
|
18
|
+
attr_accessor :organization_id
|
19
|
+
|
17
20
|
# @type [Number] create_time
|
18
21
|
attr_accessor :create_time
|
19
22
|
|
@@ -34,6 +37,7 @@ module Comet
|
|
34
37
|
end
|
35
38
|
|
36
39
|
def clear
|
40
|
+
@organization_id = ''
|
37
41
|
@create_time = 0
|
38
42
|
@read_write_key_format = 0
|
39
43
|
@read_write_key = ''
|
@@ -54,6 +58,10 @@ module Comet
|
|
54
58
|
|
55
59
|
obj.each do |k, v|
|
56
60
|
case k
|
61
|
+
when 'OrganizationID'
|
62
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
63
|
+
|
64
|
+
@organization_id = v
|
57
65
|
when 'CreateTime'
|
58
66
|
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
59
67
|
|
@@ -78,6 +86,7 @@ module Comet
|
|
78
86
|
# @return [Hash] The complete object as a Ruby hash
|
79
87
|
def to_hash
|
80
88
|
ret = {}
|
89
|
+
ret['OrganizationID'] = @organization_id
|
81
90
|
ret['CreateTime'] = @create_time
|
82
91
|
ret['ReadWriteKeyFormat'] = @read_write_key_format
|
83
92
|
ret['ReadWriteKey'] = @read_write_key
|
@@ -170,6 +170,9 @@ module Comet
|
|
170
170
|
# @type [Comet::RetentionPolicy] default_retention
|
171
171
|
attr_accessor :default_retention
|
172
172
|
|
173
|
+
# @type [Boolean] rebrand_storage
|
174
|
+
attr_accessor :rebrand_storage
|
175
|
+
|
173
176
|
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
174
177
|
attr_accessor :unknown_json_fields
|
175
178
|
|
@@ -452,6 +455,8 @@ module Comet
|
|
452
455
|
when 'DefaultRetention'
|
453
456
|
@default_retention = Comet::RetentionPolicy.new
|
454
457
|
@default_retention.from_hash(v)
|
458
|
+
when 'RebrandStorage'
|
459
|
+
@rebrand_storage = v
|
455
460
|
else
|
456
461
|
@unknown_json_fields[k] = v
|
457
462
|
end
|
@@ -515,6 +520,7 @@ module Comet
|
|
515
520
|
ret['Statistics'] = @statistics
|
516
521
|
end
|
517
522
|
ret['DefaultRetention'] = @default_retention
|
523
|
+
ret['RebrandStorage'] = @rebrand_storage
|
518
524
|
@unknown_json_fields.each do |k, v|
|
519
525
|
ret[k] = v
|
520
526
|
end
|
@@ -17,6 +17,9 @@ module Comet
|
|
17
17
|
# @type [String] description
|
18
18
|
attr_accessor :description
|
19
19
|
|
20
|
+
# @type [String] organization_id
|
21
|
+
attr_accessor :organization_id
|
22
|
+
|
20
23
|
# @type [Comet::UserPolicy] policy
|
21
24
|
attr_accessor :policy
|
22
25
|
|
@@ -32,6 +35,7 @@ module Comet
|
|
32
35
|
|
33
36
|
def clear
|
34
37
|
@description = ''
|
38
|
+
@organization_id = ''
|
35
39
|
@policy = Comet::UserPolicy.new
|
36
40
|
@unknown_json_fields = {}
|
37
41
|
end
|
@@ -53,6 +57,10 @@ module Comet
|
|
53
57
|
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
54
58
|
|
55
59
|
@description = v
|
60
|
+
when 'OrganizationID'
|
61
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
62
|
+
|
63
|
+
@organization_id = v
|
56
64
|
when 'Policy'
|
57
65
|
@policy = Comet::UserPolicy.new
|
58
66
|
@policy.from_hash(v)
|
@@ -68,6 +76,7 @@ module Comet
|
|
68
76
|
def to_hash
|
69
77
|
ret = {}
|
70
78
|
ret['Description'] = @description
|
79
|
+
ret['OrganizationID'] = @organization_id
|
71
80
|
ret['Policy'] = @policy
|
72
81
|
ret['DefaultUserPolicy'] = @default_user_policy
|
73
82
|
@unknown_json_fields.each do |k, v|
|
@@ -0,0 +1,99 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# InstallCreds is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class InstallCreds
|
16
|
+
|
17
|
+
# @type [String] username
|
18
|
+
attr_accessor :username
|
19
|
+
|
20
|
+
# @type [String] password
|
21
|
+
attr_accessor :password
|
22
|
+
|
23
|
+
# @type [String] server
|
24
|
+
attr_accessor :server
|
25
|
+
|
26
|
+
# @type [Boolean] auto_login
|
27
|
+
attr_accessor :auto_login
|
28
|
+
|
29
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
30
|
+
attr_accessor :unknown_json_fields
|
31
|
+
|
32
|
+
def initialize
|
33
|
+
clear
|
34
|
+
end
|
35
|
+
|
36
|
+
def clear
|
37
|
+
@username = ''
|
38
|
+
@password = ''
|
39
|
+
@server = ''
|
40
|
+
@unknown_json_fields = {}
|
41
|
+
end
|
42
|
+
|
43
|
+
# @param [String] json_string The complete object in JSON format
|
44
|
+
def from_json(json_string)
|
45
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
46
|
+
|
47
|
+
from_hash(JSON.parse(json_string))
|
48
|
+
end
|
49
|
+
|
50
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
51
|
+
def from_hash(obj)
|
52
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
53
|
+
|
54
|
+
obj.each do |k, v|
|
55
|
+
case k
|
56
|
+
when 'Username'
|
57
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
58
|
+
|
59
|
+
@username = v
|
60
|
+
when 'Password'
|
61
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
62
|
+
|
63
|
+
@password = v
|
64
|
+
when 'Server'
|
65
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
66
|
+
|
67
|
+
@server = v
|
68
|
+
when 'AutoLogin'
|
69
|
+
@auto_login = v
|
70
|
+
else
|
71
|
+
@unknown_json_fields[k] = v
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# @return [Hash] The complete object as a Ruby hash
|
77
|
+
def to_hash
|
78
|
+
ret = {}
|
79
|
+
ret['Username'] = @username
|
80
|
+
ret['Password'] = @password
|
81
|
+
ret['Server'] = @server
|
82
|
+
ret['AutoLogin'] = @auto_login
|
83
|
+
@unknown_json_fields.each do |k, v|
|
84
|
+
ret[k] = v
|
85
|
+
end
|
86
|
+
ret
|
87
|
+
end
|
88
|
+
|
89
|
+
# @return [Hash] The complete object as a Ruby hash
|
90
|
+
def to_h
|
91
|
+
to_hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# @return [String] The complete object as a JSON string
|
95
|
+
def to_json(options = {})
|
96
|
+
to_hash.to_json(options)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# InstallToken is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class InstallToken
|
16
|
+
|
17
|
+
# @type [String] username
|
18
|
+
attr_accessor :username
|
19
|
+
|
20
|
+
# @type [String] server
|
21
|
+
attr_accessor :server
|
22
|
+
|
23
|
+
# @type [String] token
|
24
|
+
attr_accessor :token
|
25
|
+
|
26
|
+
# @type [Number] create_time
|
27
|
+
attr_accessor :create_time
|
28
|
+
|
29
|
+
# @type [Boolean] used
|
30
|
+
attr_accessor :used
|
31
|
+
|
32
|
+
# @type [Number] expire_time
|
33
|
+
attr_accessor :expire_time
|
34
|
+
|
35
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
36
|
+
attr_accessor :unknown_json_fields
|
37
|
+
|
38
|
+
def initialize
|
39
|
+
clear
|
40
|
+
end
|
41
|
+
|
42
|
+
def clear
|
43
|
+
@username = ''
|
44
|
+
@server = ''
|
45
|
+
@token = ''
|
46
|
+
@create_time = 0
|
47
|
+
@expire_time = 0
|
48
|
+
@unknown_json_fields = {}
|
49
|
+
end
|
50
|
+
|
51
|
+
# @param [String] json_string The complete object in JSON format
|
52
|
+
def from_json(json_string)
|
53
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
54
|
+
|
55
|
+
from_hash(JSON.parse(json_string))
|
56
|
+
end
|
57
|
+
|
58
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
59
|
+
def from_hash(obj)
|
60
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
61
|
+
|
62
|
+
obj.each do |k, v|
|
63
|
+
case k
|
64
|
+
when 'Username'
|
65
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
66
|
+
|
67
|
+
@username = v
|
68
|
+
when 'Server'
|
69
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
70
|
+
|
71
|
+
@server = v
|
72
|
+
when 'Token'
|
73
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
74
|
+
|
75
|
+
@token = v
|
76
|
+
when 'CreateTime'
|
77
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
78
|
+
|
79
|
+
@create_time = v
|
80
|
+
when 'Used'
|
81
|
+
@used = v
|
82
|
+
when 'ExpireTime'
|
83
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
84
|
+
|
85
|
+
@expire_time = v
|
86
|
+
else
|
87
|
+
@unknown_json_fields[k] = v
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# @return [Hash] The complete object as a Ruby hash
|
93
|
+
def to_hash
|
94
|
+
ret = {}
|
95
|
+
ret['Username'] = @username
|
96
|
+
ret['Server'] = @server
|
97
|
+
ret['Token'] = @token
|
98
|
+
ret['CreateTime'] = @create_time
|
99
|
+
ret['Used'] = @used
|
100
|
+
ret['ExpireTime'] = @expire_time
|
101
|
+
@unknown_json_fields.each do |k, v|
|
102
|
+
ret[k] = v
|
103
|
+
end
|
104
|
+
ret
|
105
|
+
end
|
106
|
+
|
107
|
+
# @return [Hash] The complete object as a Ruby hash
|
108
|
+
def to_h
|
109
|
+
to_hash
|
110
|
+
end
|
111
|
+
|
112
|
+
# @return [String] The complete object as a JSON string
|
113
|
+
def to_json(options = {})
|
114
|
+
to_hash.to_json(options)
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# InstallTokenResponse is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class InstallTokenResponse
|
16
|
+
|
17
|
+
# @type [Number] status
|
18
|
+
attr_accessor :status
|
19
|
+
|
20
|
+
# @type [String] message
|
21
|
+
attr_accessor :message
|
22
|
+
|
23
|
+
# @type [Comet::InstallToken] install_token
|
24
|
+
attr_accessor :install_token
|
25
|
+
|
26
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
27
|
+
attr_accessor :unknown_json_fields
|
28
|
+
|
29
|
+
def initialize
|
30
|
+
clear
|
31
|
+
end
|
32
|
+
|
33
|
+
def clear
|
34
|
+
@status = 0
|
35
|
+
@message = ''
|
36
|
+
@install_token = Comet::InstallToken.new
|
37
|
+
@unknown_json_fields = {}
|
38
|
+
end
|
39
|
+
|
40
|
+
# @param [String] json_string The complete object in JSON format
|
41
|
+
def from_json(json_string)
|
42
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
43
|
+
|
44
|
+
from_hash(JSON.parse(json_string))
|
45
|
+
end
|
46
|
+
|
47
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
48
|
+
def from_hash(obj)
|
49
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
50
|
+
|
51
|
+
obj.each do |k, v|
|
52
|
+
case k
|
53
|
+
when 'Status'
|
54
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
55
|
+
|
56
|
+
@status = v
|
57
|
+
when 'Message'
|
58
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
59
|
+
|
60
|
+
@message = v
|
61
|
+
when 'InstallToken'
|
62
|
+
@install_token = Comet::InstallToken.new
|
63
|
+
@install_token.from_hash(v)
|
64
|
+
else
|
65
|
+
@unknown_json_fields[k] = v
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# @return [Hash] The complete object as a Ruby hash
|
71
|
+
def to_hash
|
72
|
+
ret = {}
|
73
|
+
ret['Status'] = @status
|
74
|
+
ret['Message'] = @message
|
75
|
+
ret['InstallToken'] = @install_token
|
76
|
+
@unknown_json_fields.each do |k, v|
|
77
|
+
ret[k] = v
|
78
|
+
end
|
79
|
+
ret
|
80
|
+
end
|
81
|
+
|
82
|
+
# @return [Hash] The complete object as a Ruby hash
|
83
|
+
def to_h
|
84
|
+
to_hash
|
85
|
+
end
|
86
|
+
|
87
|
+
# @return [String] The complete object as a JSON string
|
88
|
+
def to_json(options = {})
|
89
|
+
to_hash.to_json(options)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|