@@ -11,6 +11,7 @@ import { ACL as OACL } from './ObjectMD';
11
11
import { areTagsValid , BucketTag } from '../s3middleware/tagging' ;
12
12
import { VeeamCapability , VeeamSOSApiSchema , VeeamSOSApiSerializable } from './Veeam' ;
13
13
import { AzureInfoMetadata } from './BucketAzureInfo' ;
14
+ import BucketLoggingStatus from './BucketLoggingStatus' ;
14
15
15
16
// WHEN UPDATING THIS NUMBER, UPDATE BucketInfoModelVersion.md CHANGELOG
16
17
// BucketInfoModelVersion.md can be found in documentation/ at the root
@@ -78,6 +79,7 @@ export type BucketMetadata = {
78
79
tags : Array < BucketTag > ,
79
80
capabilities ?: Capabilities ,
80
81
quotaMax : bigint | number ,
82
+ bucketLoggingStatus ?: BucketLoggingStatus ,
81
83
} ;
82
84
83
85
export type BucketMetadataJSON = Omit < BucketMetadata , 'quotaMax' | 'capabilities' > & {
@@ -115,6 +117,7 @@ export default class BucketInfo implements BucketMetadata {
115
117
private _ingestion ?: { status : 'enabled' | 'disabled' } ;
116
118
private _capabilities ?: Capabilities ;
117
119
private _quotaMax : bigint ;
120
+ private _bucketLoggingStatus ?: BucketLoggingStatus ;
118
121
119
122
/**
120
123
* Represents all bucket information.
@@ -201,6 +204,7 @@ export default class BucketInfo implements BucketMetadata {
201
204
tags ?: Array < BucketTag > | [ ] ,
202
205
capabilities ?: Capabilities ,
203
206
quotaMax ?: bigint | number ,
207
+ bucketLoggingStatus ?: BucketLoggingStatus ,
204
208
) {
205
209
assert . strictEqual ( typeof name , 'string' ) ;
206
210
assert . strictEqual ( typeof owner , 'string' ) ;
@@ -327,6 +331,10 @@ export default class BucketInfo implements BucketMetadata {
327
331
}
328
332
assert . strictEqual ( areTagsValid ( tags ) , true ) ;
329
333
334
+ if ( bucketLoggingStatus ) {
335
+ assert ( bucketLoggingStatus instanceof BucketLoggingStatus ) ;
336
+ }
337
+
330
338
// IF UPDATING PROPERTIES, INCREMENT MODELVERSION NUMBER ABOVE
331
339
this . _acl = aclInstance ;
332
340
this . _name = name ;
@@ -353,6 +361,7 @@ export default class BucketInfo implements BucketMetadata {
353
361
this . _objectLockConfiguration = objectLockConfiguration ;
354
362
this . _notificationConfiguration = notificationConfiguration ;
355
363
this . _tags = tags ;
364
+ this . _bucketLoggingStatus = bucketLoggingStatus ;
356
365
357
366
this . _capabilities = capabilities && {
358
367
...capabilities ,
@@ -401,6 +410,7 @@ export default class BucketInfo implements BucketMetadata {
401
410
VeeamCapability . serialize ( this . _capabilities . VeeamSOSApi ) ,
402
411
} ,
403
412
quotaMax : this . _quotaMax . toString ( ) ,
413
+ bucketLoggingStatus : this . _bucketLoggingStatus ,
404
414
} ;
405
415
const final = this . _websiteConfiguration
406
416
? {
@@ -441,7 +451,7 @@ export default class BucketInfo implements BucketMetadata {
441
451
obj . bucketPolicy , obj . uid , obj . readLocationConstraint , obj . isNFS ,
442
452
obj . ingestion , obj . azureInfo , obj . objectLockEnabled ,
443
453
obj . objectLockConfiguration , obj . notificationConfiguration , obj . tags ,
444
- capabilities , BigInt ( obj . quotaMax || 0n ) ) ;
454
+ capabilities , BigInt ( obj . quotaMax || 0n ) , obj . bucketLoggingStatus ) ;
445
455
}
446
456
447
457
/**
@@ -474,7 +484,7 @@ export default class BucketInfo implements BucketMetadata {
474
484
data . _isNFS , data . _ingestion , data . _azureInfo ,
475
485
data . _objectLockEnabled , data . _objectLockConfiguration ,
476
486
data . _notificationConfiguration , data . _tags , capabilities ,
477
- BigInt ( data . _quotaMax || 0n ) ) ;
487
+ BigInt ( data . _quotaMax || 0n ) , data . _bucketLoggingStatus ) ;
478
488
}
479
489
480
490
/**
@@ -497,7 +507,7 @@ export default class BucketInfo implements BucketMetadata {
497
507
...data . capabilities ,
498
508
VeeamSOSApi : data . capabilities ?. VeeamSOSApi &&
499
509
VeeamCapability . parse ( data . capabilities ?. VeeamSOSApi ) ,
500
- } , BigInt ( data . quotaMax || 0n ) ) ;
510
+ } , BigInt ( data . quotaMax || 0n ) , data . bucketLoggingStatus ) ;
501
511
}
502
512
503
513
/**
@@ -1070,4 +1080,22 @@ export default class BucketInfo implements BucketMetadata {
1070
1080
this . _quotaMax = BigInt ( quota || 0n ) ;
1071
1081
return this ;
1072
1082
}
1083
+
1084
+ /**
1085
+ * Get bucket logging status
1086
+ * @returns - bucket logging status
1087
+ */
1088
+ getBucketLoggingStatus ( ) : BucketLoggingStatus | undefined {
1089
+ return this . _bucketLoggingStatus ;
1090
+ }
1091
+
1092
+ /**
1093
+ * Set bucket logging status
1094
+ * @param bucketLoggingStatus - bucket logging status
1095
+ * @returns - this
1096
+ */
1097
+ setBucketLoggingStatus ( bucketLoggingStatus : BucketLoggingStatus ) {
1098
+ this . _bucketLoggingStatus = bucketLoggingStatus ;
1099
+ return this ;
1100
+ }
1073
1101
}
0 commit comments