comet_backup_ruby_sdk 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +1 -1
- data/comet_backup_ruby_sdk.gemspec +1 -1
- data/lib/comet/comet_server.rb +10 -2
- data/lib/comet/definitions.rb +5 -2
- data/lib/comet/models/authentication_role_options.rb +10 -0
- data/lib/comet/models/bucket_usage_info.rb +9 -0
- data/lib/comet/models/destination_config.rb +9 -0
- data/lib/comet/models/destination_location.rb +9 -0
- data/lib/comet/models/global_override_options.rb +75 -0
- data/lib/comet/models/office_365mixed_virtual_account.rb +11 -0
- data/lib/comet/models/restore_job_advanced_options.rb +6 -0
- data/lib/comet/models/s3destination_location.rb +9 -0
- data/lib/comet/models/user_policy.rb +11 -0
- data/lib/comet/models/user_profile_config.rb +10 -0
- data/lib/comet/models/user_server_config.rb +75 -0
- data/lib/comet_backup_ruby_sdk.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1541c88beaa1b7b97887d18d1ba96cf31c271f509d3f379affe65e6c6d3ab48
|
4
|
+
data.tar.gz: cab918f37bf9e129add1555a8f39a88e32495335c70a72aee8e0f1c660573722
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae6df3cc659a753e6f3638e17988af6e0e8b5bf4ea2b88be4150b05a421b9bdfaebbcd3d6cbe4e9284f1bd2d14d5e56bd4b9c8dff83fdf66a435f1c84c7773ab
|
7
|
+
data.tar.gz: cdbf3a20dc309b0285f3b08b5668e6e556becbd064fa2c8b0815c5df158490db582ce4018bf3e09e7270a5da290dd70af90d49d4934bd0711065a3a4015c3371
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 2022-07-27 v2.1.0
|
4
|
+
- Based on 22.6.7
|
5
|
+
- Add support enforcing the `RandomDelaySecs` for both whole-server and in policies
|
6
|
+
- Add support for username filter parameter in `AdminDispatcherListActive`
|
7
|
+
- Add custom region parameters for S3-compatible storage
|
8
|
+
- Add IDrive e2 as a Storage Template provider and in Constellation, including access-key cleanup
|
9
|
+
- Add `OverwriteIfNewer` to `RestoreJobAdvancedOptions`
|
10
|
+
- Add Office365 User Principal names
|
11
|
+
|
3
12
|
## 2022-06-28 v2.0.0
|
4
13
|
- Based on 22.6.2
|
5
14
|
- **BREAKING:** The `Organization.Email` class member is now declared as `EmailOptions` type instead of `AdminEmailOptions`. This change is fully backward-compatible on the HTTP/JSON level, but may cause issues if your application code checked this type explicitly
|
data/Gemfile.lock
CHANGED
@@ -12,7 +12,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
12
12
|
|
13
13
|
Gem::Specification.new do |spec|
|
14
14
|
spec.name = 'comet_backup_ruby_sdk'
|
15
|
-
spec.version = '2.
|
15
|
+
spec.version = '2.1.0'
|
16
16
|
spec.authors = ['Comet Licensing Ltd.']
|
17
17
|
spec.email = ['hello@cometbackup.com']
|
18
18
|
|
data/lib/comet/comet_server.rb
CHANGED
@@ -1212,9 +1212,17 @@ module Comet
|
|
1212
1212
|
# You must supply administrator authentication credentials to use this API.
|
1213
1213
|
# This API requires the Auth Role to be enabled.
|
1214
1214
|
#
|
1215
|
+
# @param [String] user_name_filter (Optional) User name filter string
|
1215
1216
|
# @return [Hash{String => Comet::LiveUserConnection}]
|
1216
|
-
def admin_dispatcher_list_active
|
1217
|
-
|
1217
|
+
def admin_dispatcher_list_active(user_name_filter = nil)
|
1218
|
+
submit_params = {}
|
1219
|
+
unless user_name_filter.nil?
|
1220
|
+
raise TypeError, "'user_name_filter' expected String, got #{user_name_filter.class}" unless user_name_filter.is_a? String
|
1221
|
+
|
1222
|
+
submit_params['UserNameFilter'] = user_name_filter
|
1223
|
+
end
|
1224
|
+
|
1225
|
+
body = perform_request('api/v1/admin/dispatcher/list-active', submit_params)
|
1218
1226
|
json_body = JSON.parse body
|
1219
1227
|
check_status json_body
|
1220
1228
|
ret = {}
|
data/lib/comet/definitions.rb
CHANGED
@@ -469,13 +469,13 @@ module Comet
|
|
469
469
|
|
470
470
|
DEFAULT_TIMEZONE = 'UTC'
|
471
471
|
|
472
|
-
APPLICATION_VERSION = '22.6.
|
472
|
+
APPLICATION_VERSION = '22.6.7'
|
473
473
|
|
474
474
|
APPLICATION_VERSION_MAJOR = 22
|
475
475
|
|
476
476
|
APPLICATION_VERSION_MINOR = 6
|
477
477
|
|
478
|
-
APPLICATION_VERSION_REVISION =
|
478
|
+
APPLICATION_VERSION_REVISION = 7
|
479
479
|
|
480
480
|
RELEASE_CODENAME = 'Voyager'
|
481
481
|
|
@@ -662,6 +662,9 @@ module Comet
|
|
662
662
|
# RemoteServerType:
|
663
663
|
REMOTESERVER_AWS = 'aws'
|
664
664
|
|
665
|
+
# RemoteServerType:
|
666
|
+
REMOTESERVER_IDRIVEE2 = 'idrivee2'
|
667
|
+
|
665
668
|
# LDAPSecurityMethod:
|
666
669
|
LDAPSECURITYMETHOD_PLAIN = 'plain'
|
667
670
|
|
@@ -36,6 +36,9 @@ module Comet
|
|
36
36
|
# @type [Array<Comet::ReplicaServer>] replicate_to
|
37
37
|
attr_accessor :replicate_to
|
38
38
|
|
39
|
+
# @type [Comet::GlobalOverrideOptions] global_overrides
|
40
|
+
attr_accessor :global_overrides
|
41
|
+
|
39
42
|
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
40
43
|
attr_accessor :unknown_json_fields
|
41
44
|
|
@@ -49,6 +52,7 @@ module Comet
|
|
49
52
|
@prune_logs_after_days = 0
|
50
53
|
@remote_storage = []
|
51
54
|
@replicate_to = []
|
55
|
+
@global_overrides = Comet::GlobalOverrideOptions.new
|
52
56
|
@unknown_json_fields = {}
|
53
57
|
end
|
54
58
|
|
@@ -103,6 +107,9 @@ module Comet
|
|
103
107
|
@replicate_to[i1].from_hash(v1)
|
104
108
|
end
|
105
109
|
end
|
110
|
+
when 'GlobalOverrides'
|
111
|
+
@global_overrides = Comet::GlobalOverrideOptions.new
|
112
|
+
@global_overrides.from_hash(v)
|
106
113
|
else
|
107
114
|
@unknown_json_fields[k] = v
|
108
115
|
end
|
@@ -120,6 +127,9 @@ module Comet
|
|
120
127
|
ret['PruneLogsAfterDays'] = @prune_logs_after_days
|
121
128
|
ret['RemoteStorage'] = @remote_storage
|
122
129
|
ret['ReplicateTo'] = @replicate_to
|
130
|
+
unless @global_overrides.nil?
|
131
|
+
ret['GlobalOverrides'] = @global_overrides
|
132
|
+
end
|
123
133
|
@unknown_json_fields.each do |k, v|
|
124
134
|
ret[k] = v
|
125
135
|
end
|
@@ -12,6 +12,9 @@ module Comet
|
|
12
12
|
# BucketUsageInfo is a typed class wrapper around the underlying Comet Server API data structure.
|
13
13
|
class BucketUsageInfo
|
14
14
|
|
15
|
+
# @type [String] access_key
|
16
|
+
attr_accessor :access_key
|
17
|
+
|
15
18
|
# @type [Array<Number>] exists_on_servers
|
16
19
|
attr_accessor :exists_on_servers
|
17
20
|
|
@@ -26,6 +29,7 @@ module Comet
|
|
26
29
|
end
|
27
30
|
|
28
31
|
def clear
|
32
|
+
@access_key = ''
|
29
33
|
@exists_on_servers = []
|
30
34
|
@in_use_by = []
|
31
35
|
@unknown_json_fields = {}
|
@@ -44,6 +48,10 @@ module Comet
|
|
44
48
|
|
45
49
|
obj.each do |k, v|
|
46
50
|
case k
|
51
|
+
when 'AccessKey'
|
52
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
53
|
+
|
54
|
+
@access_key = v
|
47
55
|
when 'ExistsOnServers'
|
48
56
|
if v.nil?
|
49
57
|
@exists_on_servers = []
|
@@ -74,6 +82,7 @@ module Comet
|
|
74
82
|
# @return [Hash] The complete object as a Ruby hash
|
75
83
|
def to_hash
|
76
84
|
ret = {}
|
85
|
+
ret['AccessKey'] = @access_key
|
77
86
|
ret['ExistsOnServers'] = @exists_on_servers
|
78
87
|
ret['InUseBy'] = @in_use_by
|
79
88
|
@unknown_json_fields.each do |k, v|
|
@@ -60,6 +60,9 @@ module Comet
|
|
60
60
|
# @type [String] s3subdir
|
61
61
|
attr_accessor :s3subdir
|
62
62
|
|
63
|
+
# @type [String] s3custom_region
|
64
|
+
attr_accessor :s3custom_region
|
65
|
+
|
63
66
|
# @type [Boolean] s3uses_v2signing
|
64
67
|
attr_accessor :s3uses_v2signing
|
65
68
|
|
@@ -200,6 +203,7 @@ module Comet
|
|
200
203
|
@s3secret_key = ''
|
201
204
|
@s3bucket_name = ''
|
202
205
|
@s3subdir = ''
|
206
|
+
@s3custom_region = ''
|
203
207
|
@sftpserver = ''
|
204
208
|
@sftpusername = ''
|
205
209
|
@sftpremote_path = ''
|
@@ -331,6 +335,10 @@ module Comet
|
|
331
335
|
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
332
336
|
|
333
337
|
@s3subdir = v
|
338
|
+
when 'S3CustomRegion'
|
339
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
340
|
+
|
341
|
+
@s3custom_region = v
|
334
342
|
when 'S3UsesV2Signing'
|
335
343
|
@s3uses_v2signing = v
|
336
344
|
when 'SFTPServer'
|
@@ -500,6 +508,7 @@ module Comet
|
|
500
508
|
ret['S3SecretKey'] = @s3secret_key
|
501
509
|
ret['S3BucketName'] = @s3bucket_name
|
502
510
|
ret['S3Subdir'] = @s3subdir
|
511
|
+
ret['S3CustomRegion'] = @s3custom_region
|
503
512
|
ret['S3UsesV2Signing'] = @s3uses_v2signing
|
504
513
|
ret['SFTPServer'] = @sftpserver
|
505
514
|
ret['SFTPUsername'] = @sftpusername
|
@@ -42,6 +42,9 @@ module Comet
|
|
42
42
|
# @type [String] s3subdir
|
43
43
|
attr_accessor :s3subdir
|
44
44
|
|
45
|
+
# @type [String] s3custom_region
|
46
|
+
attr_accessor :s3custom_region
|
47
|
+
|
45
48
|
# @type [Boolean] s3uses_v2signing
|
46
49
|
attr_accessor :s3uses_v2signing
|
47
50
|
|
@@ -152,6 +155,7 @@ module Comet
|
|
152
155
|
@s3secret_key = ''
|
153
156
|
@s3bucket_name = ''
|
154
157
|
@s3subdir = ''
|
158
|
+
@s3custom_region = ''
|
155
159
|
@sftpserver = ''
|
156
160
|
@sftpusername = ''
|
157
161
|
@sftpremote_path = ''
|
@@ -232,6 +236,10 @@ module Comet
|
|
232
236
|
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
233
237
|
|
234
238
|
@s3subdir = v
|
239
|
+
when 'S3CustomRegion'
|
240
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
241
|
+
|
242
|
+
@s3custom_region = v
|
235
243
|
when 'S3UsesV2Signing'
|
236
244
|
@s3uses_v2signing = v
|
237
245
|
when 'SFTPServer'
|
@@ -369,6 +377,7 @@ module Comet
|
|
369
377
|
ret['S3SecretKey'] = @s3secret_key
|
370
378
|
ret['S3BucketName'] = @s3bucket_name
|
371
379
|
ret['S3Subdir'] = @s3subdir
|
380
|
+
ret['S3CustomRegion'] = @s3custom_region
|
372
381
|
ret['S3UsesV2Signing'] = @s3uses_v2signing
|
373
382
|
ret['SFTPServer'] = @sftpserver
|
374
383
|
ret['SFTPUsername'] = @sftpusername
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2020-2022 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
|
8
|
+
require 'json'
|
9
|
+
|
10
|
+
module Comet
|
11
|
+
|
12
|
+
# GlobalOverrideOptions is a typed class wrapper around the underlying Comet Server API data structure.
|
13
|
+
class GlobalOverrideOptions
|
14
|
+
|
15
|
+
# @type [Number] random_delay_secs
|
16
|
+
attr_accessor :random_delay_secs
|
17
|
+
|
18
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
19
|
+
attr_accessor :unknown_json_fields
|
20
|
+
|
21
|
+
def initialize
|
22
|
+
clear
|
23
|
+
end
|
24
|
+
|
25
|
+
def clear
|
26
|
+
@random_delay_secs = 0
|
27
|
+
@unknown_json_fields = {}
|
28
|
+
end
|
29
|
+
|
30
|
+
# @param [String] json_string The complete object in JSON format
|
31
|
+
def from_json(json_string)
|
32
|
+
raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
33
|
+
|
34
|
+
from_hash(JSON.parse(json_string))
|
35
|
+
end
|
36
|
+
|
37
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
38
|
+
def from_hash(obj)
|
39
|
+
raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
40
|
+
|
41
|
+
obj.each do |k, v|
|
42
|
+
case k
|
43
|
+
when 'RandomDelaySecs'
|
44
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
45
|
+
|
46
|
+
@random_delay_secs = v
|
47
|
+
else
|
48
|
+
@unknown_json_fields[k] = v
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# @return [Hash] The complete object as a Ruby hash
|
54
|
+
def to_hash
|
55
|
+
ret = {}
|
56
|
+
unless @random_delay_secs.nil?
|
57
|
+
ret['RandomDelaySecs'] = @random_delay_secs
|
58
|
+
end
|
59
|
+
@unknown_json_fields.each do |k, v|
|
60
|
+
ret[k] = v
|
61
|
+
end
|
62
|
+
ret
|
63
|
+
end
|
64
|
+
|
65
|
+
# @return [Hash] The complete object as a Ruby hash
|
66
|
+
def to_h
|
67
|
+
to_hash
|
68
|
+
end
|
69
|
+
|
70
|
+
# @return [String] The complete object as a JSON string
|
71
|
+
def to_json(options = {})
|
72
|
+
to_hash.to_json(options)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -36,6 +36,9 @@ module Comet
|
|
36
36
|
# @type [String] web_url
|
37
37
|
attr_accessor :web_url
|
38
38
|
|
39
|
+
# @type [String] user_principal_name
|
40
|
+
attr_accessor :user_principal_name
|
41
|
+
|
39
42
|
# @type [Number] enabled_service_option
|
40
43
|
attr_accessor :enabled_service_option
|
41
44
|
|
@@ -67,6 +70,7 @@ module Comet
|
|
67
70
|
@site_id = ''
|
68
71
|
@web_id = ''
|
69
72
|
@web_url = ''
|
73
|
+
@user_principal_name = ''
|
70
74
|
@enabled_service_option = 0
|
71
75
|
@members = []
|
72
76
|
@service_options = 0
|
@@ -119,6 +123,10 @@ module Comet
|
|
119
123
|
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
120
124
|
|
121
125
|
@web_url = v
|
126
|
+
when 'UserPrincipalName'
|
127
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
128
|
+
|
129
|
+
@user_principal_name = v
|
122
130
|
when 'EnabledServiceOption'
|
123
131
|
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
124
132
|
|
@@ -175,6 +183,9 @@ module Comet
|
|
175
183
|
unless @web_url.nil?
|
176
184
|
ret['WebURL'] = @web_url
|
177
185
|
end
|
186
|
+
unless @user_principal_name.nil?
|
187
|
+
ret['UserPrincipalName'] = @user_principal_name
|
188
|
+
end
|
178
189
|
unless @enabled_service_option.nil?
|
179
190
|
ret['EnabledServiceOption'] = @enabled_service_option
|
180
191
|
end
|
@@ -18,6 +18,9 @@ module Comet
|
|
18
18
|
# @type [Boolean] overwrite_existing_files
|
19
19
|
attr_accessor :overwrite_existing_files
|
20
20
|
|
21
|
+
# @type [Boolean] overwrite_if_newer
|
22
|
+
attr_accessor :overwrite_if_newer
|
23
|
+
|
21
24
|
# @type [Boolean] dest_is_original_location
|
22
25
|
attr_accessor :dest_is_original_location
|
23
26
|
|
@@ -68,6 +71,8 @@ module Comet
|
|
68
71
|
@type = v
|
69
72
|
when 'OverwriteExistingFiles'
|
70
73
|
@overwrite_existing_files = v
|
74
|
+
when 'OverwriteIfNewer'
|
75
|
+
@overwrite_if_newer = v
|
71
76
|
when 'DestIsOriginalLocation'
|
72
77
|
@dest_is_original_location = v
|
73
78
|
when 'DestPath'
|
@@ -103,6 +108,7 @@ module Comet
|
|
103
108
|
ret = {}
|
104
109
|
ret['Type'] = @type
|
105
110
|
ret['OverwriteExistingFiles'] = @overwrite_existing_files
|
111
|
+
ret['OverwriteIfNewer'] = @overwrite_if_newer
|
106
112
|
ret['DestIsOriginalLocation'] = @dest_is_original_location
|
107
113
|
ret['DestPath'] = @dest_path
|
108
114
|
ret['ExactDestPaths'] = @exact_dest_paths
|
@@ -30,6 +30,9 @@ module Comet
|
|
30
30
|
# @type [String] s3subdir
|
31
31
|
attr_accessor :s3subdir
|
32
32
|
|
33
|
+
# @type [String] s3custom_region
|
34
|
+
attr_accessor :s3custom_region
|
35
|
+
|
33
36
|
# @type [Boolean] s3uses_v2signing
|
34
37
|
attr_accessor :s3uses_v2signing
|
35
38
|
|
@@ -46,6 +49,7 @@ module Comet
|
|
46
49
|
@s3secret_key = ''
|
47
50
|
@s3bucket_name = ''
|
48
51
|
@s3subdir = ''
|
52
|
+
@s3custom_region = ''
|
49
53
|
@unknown_json_fields = {}
|
50
54
|
end
|
51
55
|
|
@@ -84,6 +88,10 @@ module Comet
|
|
84
88
|
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
85
89
|
|
86
90
|
@s3subdir = v
|
91
|
+
when 'S3CustomRegion'
|
92
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
93
|
+
|
94
|
+
@s3custom_region = v
|
87
95
|
when 'S3UsesV2Signing'
|
88
96
|
@s3uses_v2signing = v
|
89
97
|
else
|
@@ -101,6 +109,7 @@ module Comet
|
|
101
109
|
ret['S3SecretKey'] = @s3secret_key
|
102
110
|
ret['S3BucketName'] = @s3bucket_name
|
103
111
|
ret['S3Subdir'] = @s3subdir
|
112
|
+
ret['S3CustomRegion'] = @s3custom_region
|
104
113
|
ret['S3UsesV2Signing'] = @s3uses_v2signing
|
105
114
|
@unknown_json_fields.each do |k, v|
|
106
115
|
ret[k] = v
|
@@ -111,6 +111,9 @@ module Comet
|
|
111
111
|
# @type [Hash{String => Comet::BackupRuleConfig}] default_backup_rules
|
112
112
|
attr_accessor :default_backup_rules
|
113
113
|
|
114
|
+
# @type [Number] random_delay_secs
|
115
|
+
attr_accessor :random_delay_secs
|
116
|
+
|
114
117
|
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
115
118
|
attr_accessor :unknown_json_fields
|
116
119
|
|
@@ -132,6 +135,7 @@ module Comet
|
|
132
135
|
@default_sources_backup_rules = {}
|
133
136
|
@default_sources_with_osrestriction = {}
|
134
137
|
@default_backup_rules = {}
|
138
|
+
@random_delay_secs = 0
|
135
139
|
@unknown_json_fields = {}
|
136
140
|
end
|
137
141
|
|
@@ -266,6 +270,10 @@ module Comet
|
|
266
270
|
@default_backup_rules[k1].from_hash(v1)
|
267
271
|
end
|
268
272
|
end
|
273
|
+
when 'RandomDelaySecs'
|
274
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
275
|
+
|
276
|
+
@random_delay_secs = v
|
269
277
|
else
|
270
278
|
@unknown_json_fields[k] = v
|
271
279
|
end
|
@@ -318,6 +326,9 @@ module Comet
|
|
318
326
|
ret['DefaultSourcesBackupRules'] = @default_sources_backup_rules
|
319
327
|
ret['DefaultSourcesWithOSRestriction'] = @default_sources_with_osrestriction
|
320
328
|
ret['DefaultBackupRules'] = @default_backup_rules
|
329
|
+
unless @random_delay_secs.nil?
|
330
|
+
ret['RandomDelaySecs'] = @random_delay_secs
|
331
|
+
end
|
321
332
|
@unknown_json_fields.each do |k, v|
|
322
333
|
ret[k] = v
|
323
334
|
end
|
@@ -105,6 +105,9 @@ module Comet
|
|
105
105
|
# @type [String] creation_guid
|
106
106
|
attr_accessor :creation_guid
|
107
107
|
|
108
|
+
# @type [Comet::UserServerConfig] server_config
|
109
|
+
attr_accessor :server_config
|
110
|
+
|
108
111
|
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
109
112
|
attr_accessor :unknown_json_fields
|
110
113
|
|
@@ -135,6 +138,7 @@ module Comet
|
|
135
138
|
@totpkey = ''
|
136
139
|
@create_time = 0
|
137
140
|
@creation_guid = ''
|
141
|
+
@server_config = Comet::UserServerConfig.new
|
138
142
|
@unknown_json_fields = {}
|
139
143
|
end
|
140
144
|
|
@@ -287,6 +291,9 @@ module Comet
|
|
287
291
|
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
288
292
|
|
289
293
|
@creation_guid = v
|
294
|
+
when 'ServerConfig'
|
295
|
+
@server_config = Comet::UserServerConfig.new
|
296
|
+
@server_config.from_hash(v)
|
290
297
|
else
|
291
298
|
@unknown_json_fields[k] = v
|
292
299
|
end
|
@@ -328,6 +335,9 @@ module Comet
|
|
328
335
|
ret['RequirePasswordChange'] = @require_password_change
|
329
336
|
ret['CreateTime'] = @create_time
|
330
337
|
ret['CreationGUID'] = @creation_guid
|
338
|
+
unless @server_config.nil?
|
339
|
+
ret['ServerConfig'] = @server_config
|
340
|
+
end
|
331
341
|
@unknown_json_fields.each do |k, v|
|
332
342
|
ret[k] = v
|
333
343
|
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2020-2022 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
|
8
|
+
require 'json'
|
9
|
+
|
10
|
+
module Comet
|
11
|
+
|
12
|
+
# UserServerConfig is a typed class wrapper around the underlying Comet Server API data structure.
|
13
|
+
class UserServerConfig
|
14
|
+
|
15
|
+
# @type [Number] random_delay_secs
|
16
|
+
attr_accessor :random_delay_secs
|
17
|
+
|
18
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
19
|
+
attr_accessor :unknown_json_fields
|
20
|
+
|
21
|
+
def initialize
|
22
|
+
clear
|
23
|
+
end
|
24
|
+
|
25
|
+
def clear
|
26
|
+
@random_delay_secs = 0
|
27
|
+
@unknown_json_fields = {}
|
28
|
+
end
|
29
|
+
|
30
|
+
# @param [String] json_string The complete object in JSON format
|
31
|
+
def from_json(json_string)
|
32
|
+
raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
33
|
+
|
34
|
+
from_hash(JSON.parse(json_string))
|
35
|
+
end
|
36
|
+
|
37
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
38
|
+
def from_hash(obj)
|
39
|
+
raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
40
|
+
|
41
|
+
obj.each do |k, v|
|
42
|
+
case k
|
43
|
+
when 'RandomDelaySecs'
|
44
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
45
|
+
|
46
|
+
@random_delay_secs = v
|
47
|
+
else
|
48
|
+
@unknown_json_fields[k] = v
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# @return [Hash] The complete object as a Ruby hash
|
54
|
+
def to_hash
|
55
|
+
ret = {}
|
56
|
+
unless @random_delay_secs.nil?
|
57
|
+
ret['RandomDelaySecs'] = @random_delay_secs
|
58
|
+
end
|
59
|
+
@unknown_json_fields.each do |k, v|
|
60
|
+
ret[k] = v
|
61
|
+
end
|
62
|
+
ret
|
63
|
+
end
|
64
|
+
|
65
|
+
# @return [Hash] The complete object as a Ruby hash
|
66
|
+
def to_h
|
67
|
+
to_hash
|
68
|
+
end
|
69
|
+
|
70
|
+
# @return [String] The complete object as a JSON string
|
71
|
+
def to_json(options = {})
|
72
|
+
to_hash.to_json(options)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -75,6 +75,7 @@ require_relative 'comet/models/ftpdestination_location'
|
|
75
75
|
require_relative 'comet/models/get_group_policy_response'
|
76
76
|
require_relative 'comet/models/get_profile_and_hash_response_message'
|
77
77
|
require_relative 'comet/models/get_profile_hash_response_message'
|
78
|
+
require_relative 'comet/models/global_override_options'
|
78
79
|
require_relative 'comet/models/group_policy'
|
79
80
|
require_relative 'comet/models/hour_sched_config'
|
80
81
|
require_relative 'comet/models/httpconnector_options'
|
@@ -168,6 +169,7 @@ require_relative 'comet/models/user_on_server'
|
|
168
169
|
require_relative 'comet/models/user_policy'
|
169
170
|
require_relative 'comet/models/user_profile_config'
|
170
171
|
require_relative 'comet/models/user_profile_fragment'
|
172
|
+
require_relative 'comet/models/user_server_config'
|
171
173
|
require_relative 'comet/models/vault_snapshot'
|
172
174
|
require_relative 'comet/models/vmdksnapshot_view_options'
|
173
175
|
require_relative 'comet/models/vsscomponent'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comet_backup_ruby_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Comet Licensing Ltd.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- lib/comet/models/get_group_policy_response.rb
|
154
154
|
- lib/comet/models/get_profile_and_hash_response_message.rb
|
155
155
|
- lib/comet/models/get_profile_hash_response_message.rb
|
156
|
+
- lib/comet/models/global_override_options.rb
|
156
157
|
- lib/comet/models/group_policy.rb
|
157
158
|
- lib/comet/models/hour_sched_config.rb
|
158
159
|
- lib/comet/models/httpconnector_options.rb
|
@@ -246,6 +247,7 @@ files:
|
|
246
247
|
- lib/comet/models/user_policy.rb
|
247
248
|
- lib/comet/models/user_profile_config.rb
|
248
249
|
- lib/comet/models/user_profile_fragment.rb
|
250
|
+
- lib/comet/models/user_server_config.rb
|
249
251
|
- lib/comet/models/vault_snapshot.rb
|
250
252
|
- lib/comet/models/vmdksnapshot_view_options.rb
|
251
253
|
- lib/comet/models/vsscomponent.rb
|