@@ -423,11 +423,13 @@ func TestDatasetsService_Get(t *testing.T) {
423
423
424
424
func TestDatasetsService_Create (t * testing.T ) {
425
425
exp := & Dataset {
426
- ID : "test" ,
427
- Name : "test" ,
428
- Description : "This is a test description" ,
429
- CreatedBy : "f83e245a-afdc-47ad-a765-4addd1994321" ,
430
- CreatedAt : testhelper .MustTimeParse (t , time .RFC3339Nano , "2020-11-18T21:30:20.623322799Z" ),
426
+ ID : "test" ,
427
+ Name : "test" ,
428
+ Description : "This is a test description" ,
429
+ UseRetentionPeriod : true ,
430
+ RetentionDays : 30 ,
431
+ CreatedBy : "f83e245a-afdc-47ad-a765-4addd1994321" ,
432
+ CreatedAt : testhelper .MustTimeParse (t , time .RFC3339Nano , "2020-11-18T21:30:20.623322799Z" ),
431
433
}
432
434
433
435
hf := func (w http.ResponseWriter , r * http.Request ) {
@@ -439,6 +441,8 @@ func TestDatasetsService_Create(t *testing.T) {
439
441
"id": "test",
440
442
"name": "test",
441
443
"description": "This is a test description",
444
+ "useRetentionPeriod": true,
445
+ "retentionDays": 30,
442
446
"who": "f83e245a-afdc-47ad-a765-4addd1994321",
443
447
"created": "2020-11-18T21:30:20.623322799Z"
444
448
}` )
@@ -448,8 +452,10 @@ func TestDatasetsService_Create(t *testing.T) {
448
452
client := setup (t , "POST /v2/datasets" , hf )
449
453
450
454
res , err := client .Datasets .Create (context .Background (), DatasetCreateRequest {
451
- Name : "test" ,
452
- Description : "This is a test description" ,
455
+ Name : "test" ,
456
+ Description : "This is a test description" ,
457
+ UseRetentionPeriod : true ,
458
+ RetentionDays : 30 ,
453
459
})
454
460
require .NoError (t , err )
455
461
@@ -458,11 +464,13 @@ func TestDatasetsService_Create(t *testing.T) {
458
464
459
465
func TestDatasetsService_Update (t * testing.T ) {
460
466
exp := & Dataset {
461
- ID : "test" ,
462
- Name : "test" ,
463
- Description : "This is the new description" ,
464
- CreatedBy : "f83e245a-afdc-47ad-a765-4addd1994321" ,
465
- CreatedAt : testhelper .MustTimeParse (t , time .RFC3339Nano , "2020-11-18T21:30:20.623322799Z" ),
467
+ ID : "test" ,
468
+ Name : "test" ,
469
+ Description : "This is the new description" ,
470
+ UseRetentionPeriod : false , // This should be set to false after setting RetentionDays to 0.
471
+ RetentionDays : 0 ,
472
+ CreatedBy : "f83e245a-afdc-47ad-a765-4addd1994321" ,
473
+ CreatedAt : testhelper .MustTimeParse (t , time .RFC3339Nano , "2020-11-18T21:30:20.623322799Z" ),
466
474
}
467
475
468
476
hf := func (w http.ResponseWriter , r * http.Request ) {
@@ -474,6 +482,7 @@ func TestDatasetsService_Update(t *testing.T) {
474
482
"id": "test",
475
483
"name": "test",
476
484
"description": "This is the new description",
485
+ "retentionDays": 0,
477
486
"who": "f83e245a-afdc-47ad-a765-4addd1994321",
478
487
"created": "2020-11-18T21:30:20.623322799Z"
479
488
}` )
@@ -483,7 +492,8 @@ func TestDatasetsService_Update(t *testing.T) {
483
492
client := setup (t , "PUT /v2/datasets/test" , hf )
484
493
485
494
res , err := client .Datasets .Update (context .Background (), "test" , DatasetUpdateRequest {
486
- Description : "This is the new description" ,
495
+ Description : "This is the new description" ,
496
+ RetentionDays : 0 ,
487
497
})
488
498
require .NoError (t , err )
489
499
0 commit comments