comet_backup_ruby_sdk 2.26.0 → 2.28.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14ddc4c8af2799ff5572ea1d4699207be21648f4a0b21f391becbef7bf644c92
4
- data.tar.gz: 93f2d18fdace95d41e6761f5cdfea4717aa277fe22fd5d628d3821b54a8fb341
3
+ metadata.gz: 53738547ff60dcbe3a712a5c3c40c0b352e16a929ba9a89eec0c70dfb8198e89
4
+ data.tar.gz: cb227d89fa7af1f8922459f79731672043fe218c832049b816c95f1e8e8999e0
5
5
  SHA512:
6
- metadata.gz: 6e05c8e10916770ca48ac4a53d7e66109c8697bbff3da77efbf91a0634ba74162fbd49bf9fca6145a7b2b23f1f404315998025ea1c32b73a4936765ea0d532c3
7
- data.tar.gz: 80cdbfb3e92be12f5de9df118bdda20fc00fda83ab58ffef1ce9a9f00cc0fed02c3054b42a9af970dc3d927d9beb502e3cfd694ce9fb0b4ee4890156508ce86c
6
+ metadata.gz: 4fedea7d6a7205cb39ca517f45d854d2d56603d237dbac9cb8e95557221a842385cb3024b3c621e6e4e32005b9720071dfff0c3d8b7b762bb5d130254c2ae951
7
+ data.tar.gz: 28d2d0c72aacb5a3b3ec9c7d8c713e82fbcde52cdda79fcc981ef018fa1208d9388a1b0718288e4c41d40bb582e91da252c8ee98c1188706cd80ccb717366aa7
data/.gitignore CHANGED
File without changes
data/.rubocop.yml CHANGED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2024-05-02 v2.28.0
4
+
5
+ - Based on Comet 24.3.6
6
+ - Testing new release process
7
+
8
+ ## 2024-04-12 v2.27.0
9
+
10
+ - Based on Comet 24.3.5
11
+
3
12
  ## 2024-01-23 v2.26.0
4
13
 
5
14
  - Based on Comet 23.12.3
data/Gemfile CHANGED
File without changes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- comet_backup_ruby_sdk (2.26.0)
4
+ comet_backup_ruby_sdk (2.28.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
@@ -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.26.0'
15
+ spec.version = '2.28.0'
16
16
  spec.authors = ['Comet Licensing Ltd.']
17
17
  spec.email = ['hello@cometbackup.com']
18
18
 
@@ -3145,6 +3145,26 @@ module Comet
3145
3145
  perform_request('api/v1/admin/meta/read-logs', submit_params)
3146
3146
  end
3147
3147
 
3148
+ # AdminMetaReadSelectLogs
3149
+ #
3150
+ # Get logs file content.
3151
+ # On non-Windows platforms, log content uses LF line endings. On Windows, Comet changed from LF to CRLF line endings in 18.3.2.
3152
+ # This API does not automatically convert line endings; around the 18.3.2 timeframe, log content may even contain mixed line-endings.
3153
+ #
3154
+ # You must supply administrator authentication credentials to use this API.
3155
+ # This API is only available for top-level administrator accounts, not for Tenant administrator accounts.
3156
+ #
3157
+ # @param [Array<Number>] logs An array of log days, selected from the options returned by the Get Log Files API
3158
+ # @return [String]
3159
+ def admin_meta_read_select_logs(logs)
3160
+ submit_params = {}
3161
+ raise TypeError, "'logs' expected Array, got #{logs.class}" unless logs.is_a? Array
3162
+
3163
+ submit_params['Logs'] = logs.to_json
3164
+
3165
+ perform_request('api/v1/admin/meta/read-select-logs', submit_params)
3166
+ end
3167
+
3148
3168
  # AdminMetaRemoteStorageVaultGet
3149
3169
  #
3150
3170
  # Get Requesting Remote Storage Vault Config.
@@ -3316,12 +3336,18 @@ module Comet
3316
3336
  # Access to this API may be prevented on a per-administrator basis.
3317
3337
  #
3318
3338
  # @param [Comet::EmailReportingOption] email_reporting_option Test email reporting option for sending
3339
+ # @param [String] target_organization (Optional) If present, Testing email with a target organization. Only allowed for top-level admins. (>= 24.3.0)
3319
3340
  # @return [Comet::CometAPIResponseMessage]
3320
- def admin_meta_send_test_report(email_reporting_option)
3341
+ def admin_meta_send_test_report(email_reporting_option, target_organization = nil)
3321
3342
  submit_params = {}
3322
3343
  raise TypeError, "'email_reporting_option' expected Comet::EmailReportingOption, got #{email_reporting_option.class}" unless email_reporting_option.is_a? Comet::EmailReportingOption
3323
3344
 
3324
3345
  submit_params['EmailReportingOption'] = email_reporting_option.to_json
3346
+ unless target_organization.nil?
3347
+ raise TypeError, "'target_organization' expected String, got #{target_organization.class}" unless target_organization.is_a? String
3348
+
3349
+ submit_params['TargetOrganization'] = target_organization
3350
+ end
3325
3351
 
3326
3352
  body = perform_request('api/v1/admin/meta/send-test-report', submit_params)
3327
3353
  json_body = JSON.parse body
@@ -7,13 +7,13 @@
7
7
 
8
8
  module Comet
9
9
 
10
- APPLICATION_VERSION = '23.12.3'
10
+ APPLICATION_VERSION = '24.3.6'
11
11
 
12
- APPLICATION_VERSION_MAJOR = 23
12
+ APPLICATION_VERSION_MAJOR = 24
13
13
 
14
- APPLICATION_VERSION_MINOR = 12
14
+ APPLICATION_VERSION_MINOR = 3
15
15
 
16
- APPLICATION_VERSION_REVISION = 3
16
+ APPLICATION_VERSION_REVISION = 6
17
17
 
18
18
  # AutoRetentionLevel: The system will automatically choose how often to run an automatic Retention Pass after each backup job.
19
19
  BACKUPJOBAUTORETENTION_AUTOMATIC = 0
@@ -117,6 +117,9 @@ module Comet
117
117
 
118
118
  DESTINATIONTYPE_WEBDAV = 1010
119
119
 
120
+ # SMB Path
121
+ DESTINATIONTYPE_SMB = 1011
122
+
120
123
  # When defining a schedule via policy, use this option to dynamically select the Storage Vault that was created most recently.
121
124
  DESTINATIONTYPE_LATEST = 1100
122
125
 
@@ -375,6 +378,9 @@ module Comet
375
378
  # MSSQLRestoreOpt
376
379
  MSSQL_RESTORE_NORECOVERY = 'NO_RECOVERY'
377
380
 
381
+ # Enable Object Lock capability if the corresponding Days field is greater than zero.
382
+ New code should explicitly use OBJECT_LOCK_ON / OBJECT_LOCK_OFF instead.
383
+ # @deprecated This const has been deprecated since Comet version 23.x.x
378
384
  OBJECT_LOCK_LEGACY = 0
379
385
 
380
386
  OBJECT_LOCK_ON = 1
@@ -435,39 +441,45 @@ module Comet
435
441
 
436
442
  RELEASE_CODENAME = 'Voyager'
437
443
 
438
- # RemoteServerType
444
+ # RemoteServerType: Comet Server
439
445
  REMOTESERVER_COMET = 'comet'
440
446
 
441
- # RemoteServerType
447
+ # RemoteServerType: Comet Storage powered by Wasabi
442
448
  REMOTESERVER_COMET_STORAGE = 'cometstorage'
443
449
 
444
- # RemoteServerType
450
+ # RemoteServerType: LDAP (Lightweight Directory Access Protocol)
445
451
  REMOTESERVER_LDAP = 'ldap'
446
452
 
447
- # RemoteServerType
453
+ # RemoteServerType: OpenID Connect
448
454
  REMOTESERVER_OIDC = 'oidc'
449
455
 
450
- # RemoteServerType
456
+ # RemoteServerType: Backblaze B2
451
457
  REMOTESERVER_B2 = 'b2'
452
458
 
453
- # RemoteServerType
459
+ # RemoteServerType: Wasabi Cloud Storage
454
460
  REMOTESERVER_WASABI = 'wasabi'
455
461
 
456
- # RemoteServerType
462
+ # RemoteServerType: Custom Remote Bucket HTTP protocol
457
463
  REMOTESERVER_CUSTOM = 'custom'
458
464
 
459
- # RemoteServerType
465
+ # RemoteServerType: Custom IAM-Compatible
460
466
  REMOTESERVER_S3_GENERIC = 's3'
461
467
 
462
- # RemoteServerType
468
+ # RemoteServerType: Amazon Web Services
463
469
  REMOTESERVER_AWS = 'aws'
464
470
 
465
- # RemoteServerType
471
+ # RemoteServerType: Storj DCS
466
472
  REMOTESERVER_STORJ = 'storj'
467
473
 
468
- # RemoteServerType
474
+ # RemoteServerType: IDrive e2
469
475
  REMOTESERVER_IDRIVEE2 = 'idrivee2'
470
476
 
477
+ # RemoteServerType: Impossible Cloud (Partner API)
478
+ REMOTESERVER_IMPOSSIBLECLOUD_PARTNER = 'impossiblecloud-partner'
479
+
480
+ # RemoteServerType: Impossible Cloud
481
+ REMOTESERVER_IMPOSSIBLECLOUD_IAM = 'impossiblecloud-iam'
482
+
471
483
  # ReplicatorState
472
484
  REPLICATOR_STATE_NONE = 0
473
485
 
@@ -744,6 +756,9 @@ module Comet
744
756
  # DefaultSettingMode
745
757
  SETTING_ENFORCED_OFF = 4
746
758
 
759
+ # Severity
760
+ SEVERITY_DEBUG = 'D'
761
+
747
762
  # Severity
748
763
  SEVERITY_INFO = 'I'
749
764
 
@@ -903,6 +918,12 @@ module Comet
903
918
  # StoredObjectType
904
919
  STOREDOBJECTTYPE_WINEFS = 'winefs'
905
920
 
921
+ # StoredObjectType
922
+ STOREDOBJECTTYPE_WINDOWSFILE = 'winfile'
923
+
924
+ # StoredObjectType
925
+ STOREDOBJECTTYPE_WINDOWSDIR = 'windir'
926
+
906
927
  # StoredObjectType
907
928
  STOREDOBJECTTYPE_EMAILMESSAGE = 'emailmessage'
908
929
 
@@ -47,6 +47,10 @@ module Comet
47
47
  # @type [Boolean] deny_view_server_info
48
48
  attr_accessor :deny_view_server_info
49
49
 
50
+ # This field is available in Comet 24.3.2 and later.
51
+ # @type [Boolean] prevent_delete_storage_vault
52
+ attr_accessor :prevent_delete_storage_vault
53
+
50
54
  # This field is available in Comet 23.6.0 and later.
51
55
  # @type [Boolean] prevent_request_storage_vault
52
56
  attr_accessor :prevent_request_storage_vault
@@ -119,6 +123,8 @@ module Comet
119
123
  @deny_view_server_history = v
120
124
  when 'DenyViewServerInfo'
121
125
  @deny_view_server_info = v
126
+ when 'PreventDeleteStorageVault'
127
+ @prevent_delete_storage_vault = v
122
128
  when 'PreventRequestStorageVault'
123
129
  @prevent_request_storage_vault = v
124
130
  when 'PreventAddCustomStorageVault'
@@ -191,6 +197,9 @@ module Comet
191
197
  unless @deny_view_server_info.nil?
192
198
  ret['DenyViewServerInfo'] = @deny_view_server_info
193
199
  end
200
+ unless @prevent_delete_storage_vault.nil?
201
+ ret['PreventDeleteStorageVault'] = @prevent_delete_storage_vault
202
+ end
194
203
  unless @prevent_request_storage_vault.nil?
195
204
  ret['PreventRequestStorageVault'] = @prevent_request_storage_vault
196
205
  end
@@ -12,6 +12,13 @@ module Comet
12
12
  # AmazonAWSVirtualStorageRoleSettings is a typed class wrapper around the underlying Comet Server API data structure.
13
13
  class AmazonAWSVirtualStorageRoleSettings
14
14
 
15
+ # If set, the Storage Template will generate Storage Vaults pointing to a subdirectory within this
16
+ # bucket. A single dynamic IAM policy will cover all created Storage Vaults.
17
+ # This is preferable for platforms that have limits on the total number of IAM policies. However, it
18
+ # requires a high level of IAM compatibility.
19
+ # If left blank, the Storage Template will generate Storage Vaults pointing to new, separate S3
20
+ # buckets each time. An additional IAM policy is created for each new Storage Vault.
21
+ # This is preferable for platforms that have a lower level of IAM compatibility.
15
22
  # @type [String] master_bucket
16
23
  attr_accessor :master_bucket
17
24
 
@@ -22,14 +29,21 @@ module Comet
22
29
  attr_accessor :secret_key
23
30
 
24
31
  # @type [Boolean] use_object_lock__legacy__do_not_use
32
+ # @deprecated This member has been deprecated since Comet version 23.x.x
25
33
  attr_accessor :use_object_lock__legacy__do_not_use
26
34
 
35
+ # Control whether the resulting Storage Vaults are configured for Object Lock. One of the
36
+ # OBJECT_LOCK_ constants
27
37
  # @type [Number] object_lock_mode
28
38
  attr_accessor :object_lock_mode
29
39
 
30
40
  # @type [Number] object_lock_days
31
41
  attr_accessor :object_lock_days
32
42
 
43
+ # Control whether the "Allow removal of deleted files" checkbox is enabled for Storage Vaults
44
+ # generated from this Storage Template.
45
+ # When configuring a Storage Template from the Comet Server web interface, this field is set
46
+ # automatically for Storage Templates using Object Lock.
33
47
  # @type [Boolean] remove_deleted
34
48
  attr_accessor :remove_deleted
35
49
 
@@ -193,6 +193,9 @@ module Comet
193
193
  # @type [Comet::StorjDestinationLocation] storj
194
194
  attr_accessor :storj
195
195
 
196
+ # @type [Comet::SMBDestinationLocation] smb
197
+ attr_accessor :smb
198
+
196
199
  # A list of underlying destinations, that will be combined and presented as one.
197
200
  # @type [Array<Comet::DestinationLocation>] span_targets
198
201
  attr_accessor :span_targets
@@ -246,6 +249,10 @@ module Comet
246
249
  # @type [Boolean] rebrand_storage
247
250
  attr_accessor :rebrand_storage
248
251
 
252
+ # If not empty, an error occured during a retention pass. Describes the error.
253
+ # @type [String] retention_error
254
+ attr_accessor :retention_error
255
+
249
256
  # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
250
257
  attr_accessor :unknown_json_fields
251
258
 
@@ -299,6 +306,7 @@ module Comet
299
306
  @b2 = Comet::B2DestinationLocation.new
300
307
  @web_dav = Comet::WebDavDestinationLocation.new
301
308
  @storj = Comet::StorjDestinationLocation.new
309
+ @smb = Comet::SMBDestinationLocation.new
302
310
  @span_targets = []
303
311
  @tag = ''
304
312
  @encryption_key_encryption_method = 0
@@ -307,6 +315,7 @@ module Comet
307
315
  @storage_limit_bytes = 0
308
316
  @statistics = Comet::DestinationStatistics.new
309
317
  @default_retention = Comet::RetentionPolicy.new
318
+ @retention_error = ''
310
319
  @unknown_json_fields = {}
311
320
  end
312
321
 
@@ -532,6 +541,9 @@ module Comet
532
541
  when 'Storj'
533
542
  @storj = Comet::StorjDestinationLocation.new
534
543
  @storj.from_hash(v)
544
+ when 'SMB'
545
+ @smb = Comet::SMBDestinationLocation.new
546
+ @smb.from_hash(v)
535
547
  when 'SpanTargets'
536
548
  if v.nil?
537
549
  @span_targets = []
@@ -574,6 +586,10 @@ module Comet
574
586
  @default_retention.from_hash(v)
575
587
  when 'RebrandStorage'
576
588
  @rebrand_storage = v
589
+ when 'RetentionError'
590
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
591
+
592
+ @retention_error = v
577
593
  else
578
594
  @unknown_json_fields[k] = v
579
595
  end
@@ -634,6 +650,7 @@ module Comet
634
650
  ret['B2'] = @b2
635
651
  ret['WebDav'] = @web_dav
636
652
  ret['Storj'] = @storj
653
+ ret['SMB'] = @smb
637
654
  ret['SpanTargets'] = @span_targets
638
655
  ret['SpanUseStaticSlots'] = @span_use_static_slots
639
656
  ret['Tag'] = @tag
@@ -647,6 +664,7 @@ module Comet
647
664
  end
648
665
  ret['DefaultRetention'] = @default_retention
649
666
  ret['RebrandStorage'] = @rebrand_storage
667
+ ret['RetentionError'] = @retention_error
650
668
  @unknown_json_fields.each do |k, v|
651
669
  ret[k] = v
652
670
  end
@@ -173,6 +173,9 @@ module Comet
173
173
  # @type [Comet::StorjDestinationLocation] storj
174
174
  attr_accessor :storj
175
175
 
176
+ # @type [Comet::SMBDestinationLocation] smb
177
+ attr_accessor :smb
178
+
176
179
  # A list of underlying destinations, that will be combined and presented as one.
177
180
  # @type [Array<Comet::DestinationLocation>] span_targets
178
181
  attr_accessor :span_targets
@@ -240,6 +243,7 @@ module Comet
240
243
  @b2 = Comet::B2DestinationLocation.new
241
244
  @web_dav = Comet::WebDavDestinationLocation.new
242
245
  @storj = Comet::StorjDestinationLocation.new
246
+ @smb = Comet::SMBDestinationLocation.new
243
247
  @span_targets = []
244
248
  @tag = ''
245
249
  @unknown_json_fields = {}
@@ -422,6 +426,9 @@ module Comet
422
426
  when 'Storj'
423
427
  @storj = Comet::StorjDestinationLocation.new
424
428
  @storj.from_hash(v)
429
+ when 'SMB'
430
+ @smb = Comet::SMBDestinationLocation.new
431
+ @smb.from_hash(v)
425
432
  when 'SpanTargets'
426
433
  if v.nil?
427
434
  @span_targets = []
@@ -492,6 +499,7 @@ module Comet
492
499
  ret['B2'] = @b2
493
500
  ret['WebDav'] = @web_dav
494
501
  ret['Storj'] = @storj
502
+ ret['SMB'] = @smb
495
503
  ret['SpanTargets'] = @span_targets
496
504
  ret['SpanUseStaticSlots'] = @span_use_static_slots
497
505
  ret['Tag'] = @tag
@@ -18,12 +18,15 @@ module Comet
18
18
  # @type [String] description
19
19
  attr_accessor :description
20
20
 
21
+ # For use with Comet Server (Storage Role / Auth Role)
21
22
  # @type [String] remote_address
22
23
  attr_accessor :remote_address
23
24
 
25
+ # For use with Comet Server (Storage Role / Auth Role)
24
26
  # @type [String] username
25
27
  attr_accessor :username
26
28
 
29
+ # For use with Comet Server (Storage Role / Auth Role)
27
30
  # @type [String] password
28
31
  attr_accessor :password
29
32
 
@@ -33,25 +36,38 @@ module Comet
33
36
  # @type [Comet::OidcConfig] oidc
34
37
  attr_accessor :oidc
35
38
 
39
+ # Backblaze B2 (Storage Template / Constellation)
36
40
  # @type [Comet::B2VirtualStorageRoleSettings] b2
37
41
  attr_accessor :b2
38
42
 
43
+ # Wasabi, or Comet Storage powered by Wasabi (Storage Template / Constellation)
39
44
  # @type [Comet::WasabiVirtualStorageRoleSettings] wasabi
40
45
  attr_accessor :wasabi
41
46
 
47
+ # Custom Remote Bucket HTTP protocol (Storage Template)
42
48
  # @type [Comet::CustomRemoteBucketSettings] custom
43
49
  attr_accessor :custom
44
50
 
51
+ # IDrive e2, or Custom IAM-compatible (Storage Template / Constellation)
45
52
  # @type [Comet::S3GenericVirtualStorageRole] s3
46
53
  attr_accessor :s3
47
54
 
48
- # Amazon AWS - Virtual Storage Role
55
+ # Amazon AWS (Storage Template / Constellation)
49
56
  # @type [Comet::AmazonAWSVirtualStorageRoleSettings] aws
50
57
  attr_accessor :aws
51
58
 
59
+ # Storj (Storage Template / Constellation)
52
60
  # @type [Comet::StorjVirtualStorageRoleSetting] storj
53
61
  attr_accessor :storj
54
62
 
63
+ # Impossible Cloud Partner API (Storage Template / Constellation)
64
+ # @type [Comet::ImpossibleCloudPartnerTemplateSettings] imp_partner
65
+ attr_accessor :imp_partner
66
+
67
+ # Impossible Cloud IAM API (Storage Template / Constellation)
68
+ # @type [Comet::ImpossibleCloudIAMTemplateSettings] imp_user
69
+ attr_accessor :imp_user
70
+
55
71
  # @type [Comet::AdminUserPermissions] new_user_permissions
56
72
  attr_accessor :new_user_permissions
57
73
 
@@ -76,6 +92,8 @@ module Comet
76
92
  @s3 = Comet::S3GenericVirtualStorageRole.new
77
93
  @aws = Comet::AmazonAWSVirtualStorageRoleSettings.new
78
94
  @storj = Comet::StorjVirtualStorageRoleSetting.new
95
+ @imp_partner = Comet::ImpossibleCloudPartnerTemplateSettings.new
96
+ @imp_user = Comet::ImpossibleCloudIAMTemplateSettings.new
79
97
  @new_user_permissions = Comet::AdminUserPermissions.new
80
98
  @unknown_json_fields = {}
81
99
  end
@@ -137,6 +155,12 @@ module Comet
137
155
  when 'Storj'
138
156
  @storj = Comet::StorjVirtualStorageRoleSetting.new
139
157
  @storj.from_hash(v)
158
+ when 'ImpPartner'
159
+ @imp_partner = Comet::ImpossibleCloudPartnerTemplateSettings.new
160
+ @imp_partner.from_hash(v)
161
+ when 'ImpUser'
162
+ @imp_user = Comet::ImpossibleCloudIAMTemplateSettings.new
163
+ @imp_user.from_hash(v)
140
164
  when 'NewUserPermissions'
141
165
  @new_user_permissions = Comet::AdminUserPermissions.new
142
166
  @new_user_permissions.from_hash(v)
@@ -184,6 +208,12 @@ module Comet
184
208
  unless @storj.nil?
185
209
  ret['Storj'] = @storj
186
210
  end
211
+ unless @imp_partner.nil?
212
+ ret['ImpPartner'] = @imp_partner
213
+ end
214
+ unless @imp_user.nil?
215
+ ret['ImpUser'] = @imp_user
216
+ end
187
217
  ret['NewUserPermissions'] = @new_user_permissions
188
218
  @unknown_json_fields.each do |k, v|
189
219
  ret[k] = v
@@ -0,0 +1,131 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2020-2024 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
+ # ImpossibleCloudIAMTemplateSettings is a typed class wrapper around the underlying Comet Server API data structure.
13
+ # This type is available in Comet 24.3.1 and later.
14
+ class ImpossibleCloudIAMTemplateSettings
15
+
16
+ # @type [String] access_key
17
+ attr_accessor :access_key
18
+
19
+ # @type [String] secret_key
20
+ attr_accessor :secret_key
21
+
22
+ # Optional. The region for both IAM communication and for provisioning new buckets. If blank, uses
23
+ # the default region for Impossible Cloud (eu-central-2).
24
+ # @type [String] region
25
+ attr_accessor :region
26
+
27
+ # @type [Boolean] use_object_lock__legacy__do_not_use
28
+ # @deprecated This member has been deprecated since Comet version 23.x.x
29
+ attr_accessor :use_object_lock__legacy__do_not_use
30
+
31
+ # Control whether the resulting Storage Vaults are configured for Object Lock. One of the
32
+ # OBJECT_LOCK_ constants
33
+ # @type [Number] object_lock_mode
34
+ attr_accessor :object_lock_mode
35
+
36
+ # @type [Number] object_lock_days
37
+ attr_accessor :object_lock_days
38
+
39
+ # Control whether the "Allow removal of deleted files" checkbox is enabled for Storage Vaults
40
+ # generated from this Storage Template.
41
+ # When configuring a Storage Template from the Comet Server web interface, this field is set
42
+ # automatically for Storage Templates using Object Lock.
43
+ # @type [Boolean] remove_deleted
44
+ attr_accessor :remove_deleted
45
+
46
+ # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
47
+ attr_accessor :unknown_json_fields
48
+
49
+ def initialize
50
+ clear
51
+ end
52
+
53
+ def clear
54
+ @access_key = ''
55
+ @secret_key = ''
56
+ @region = ''
57
+ @object_lock_mode = 0
58
+ @object_lock_days = 0
59
+ @unknown_json_fields = {}
60
+ end
61
+
62
+ # @param [String] json_string The complete object in JSON format
63
+ def from_json(json_string)
64
+ raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
65
+
66
+ from_hash(JSON.parse(json_string))
67
+ end
68
+
69
+ # @param [Hash] obj The complete object as a Ruby hash
70
+ def from_hash(obj)
71
+ raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
72
+
73
+ obj.each do |k, v|
74
+ case k
75
+ when 'AccessKey'
76
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
77
+
78
+ @access_key = v
79
+ when 'SecretKey'
80
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
81
+
82
+ @secret_key = v
83
+ when 'Region'
84
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
85
+
86
+ @region = v
87
+ when 'UseObjectLock'
88
+ @use_object_lock__legacy__do_not_use = v
89
+ when 'ObjectLockMode'
90
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
91
+
92
+ @object_lock_mode = v
93
+ when 'ObjectLockDays'
94
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
95
+
96
+ @object_lock_days = v
97
+ when 'RemoveDeleted'
98
+ @remove_deleted = v
99
+ else
100
+ @unknown_json_fields[k] = v
101
+ end
102
+ end
103
+ end
104
+
105
+ # @return [Hash] The complete object as a Ruby hash
106
+ def to_hash
107
+ ret = {}
108
+ ret['AccessKey'] = @access_key
109
+ ret['SecretKey'] = @secret_key
110
+ ret['Region'] = @region
111
+ ret['UseObjectLock'] = @use_object_lock__legacy__do_not_use
112
+ ret['ObjectLockMode'] = @object_lock_mode
113
+ ret['ObjectLockDays'] = @object_lock_days
114
+ ret['RemoveDeleted'] = @remove_deleted
115
+ @unknown_json_fields.each do |k, v|
116
+ ret[k] = v
117
+ end
118
+ ret
119
+ end
120
+
121
+ # @return [Hash] The complete object as a Ruby hash
122
+ def to_h
123
+ to_hash
124
+ end
125
+
126
+ # @return [String] The complete object as a JSON string
127
+ def to_json(options = {})
128
+ to_hash.to_json(options)
129
+ end
130
+ end
131
+ end