@@ -179,7 +179,7 @@ func TestLoadBalancerCreate(t *testing.T) {
179
179
Algorithm : & schema.LoadBalancerCreateRequestAlgorithm {
180
180
Type : "round_robin" ,
181
181
},
182
- Location : String ("fsn1" ),
182
+ Location : Ptr ("fsn1" ),
183
183
}
184
184
if ! cmp .Equal (expectedReqBody , reqBody ) {
185
185
t .Log (cmp .Diff (expectedReqBody , reqBody ))
@@ -246,7 +246,7 @@ func TestLoadBalancerClientUpdate(t *testing.T) {
246
246
t .Fatal (err )
247
247
}
248
248
expectedReqBody := schema.LoadBalancerUpdateRequest {
249
- Name : String ("test" ),
249
+ Name : Ptr ("test" ),
250
250
}
251
251
if ! cmp .Equal (expectedReqBody , reqBody ) {
252
252
t .Log (cmp .Diff (expectedReqBody , reqBody ))
@@ -289,7 +289,7 @@ func TestLoadBalancerClientChangeProtection(t *testing.T) {
289
289
t .Fatal (err )
290
290
}
291
291
expectedReqBody := schema.LoadBalancerActionChangeProtectionRequest {
292
- Delete : Bool (true ),
292
+ Delete : Ptr (true ),
293
293
}
294
294
if ! cmp .Equal (expectedReqBody , reqBody ) {
295
295
t .Log (cmp .Diff (expectedReqBody , reqBody ))
@@ -308,7 +308,7 @@ func TestLoadBalancerClientChangeProtection(t *testing.T) {
308
308
)
309
309
310
310
opts := LoadBalancerChangeProtectionOpts {
311
- Delete : Bool (true ),
311
+ Delete : Ptr (true ),
312
312
}
313
313
action , _ , err := env .Client .LoadBalancer .ChangeProtection (ctx , loadBalancer , opts )
314
314
if err != nil {
@@ -336,7 +336,7 @@ func TestLoadBalancerClientAddServerTarget(t *testing.T) {
336
336
Server : & schema.LoadBalancerActionAddTargetRequestServer {
337
337
ID : 1 ,
338
338
},
339
- UsePrivateIP : Bool (true ),
339
+ UsePrivateIP : Ptr (true ),
340
340
}
341
341
if ! cmp .Equal (expectedReqBody , reqBody ) {
342
342
t .Log (cmp .Diff (expectedReqBody , reqBody ))
@@ -357,7 +357,7 @@ func TestLoadBalancerClientAddServerTarget(t *testing.T) {
357
357
358
358
opts := LoadBalancerAddServerTargetOpts {
359
359
Server : server ,
360
- UsePrivateIP : Bool (true ),
360
+ UsePrivateIP : Ptr (true ),
361
361
}
362
362
action , _ , err := env .Client .LoadBalancer .AddServerTarget (ctx , loadBalancer , opts )
363
363
if err != nil {
@@ -426,23 +426,23 @@ func TestLoadBalancerAddService(t *testing.T) {
426
426
}
427
427
expectedReqBody := schema.LoadBalancerActionAddServiceRequest {
428
428
Protocol : string (LoadBalancerServiceProtocolHTTP ),
429
- ListenPort : Int (4711 ),
430
- DestinationPort : Int (80 ),
429
+ ListenPort : Ptr (4711 ),
430
+ DestinationPort : Ptr (80 ),
431
431
HTTP : & schema.LoadBalancerActionAddServiceRequestHTTP {
432
- CookieName : String ("HCLBSTICKY" ),
433
- CookieLifetime : Int (5 * 60 ),
434
- RedirectHTTP : Bool (false ),
435
- StickySessions : Bool (true ),
432
+ CookieName : Ptr ("HCLBSTICKY" ),
433
+ CookieLifetime : Ptr (5 * 60 ),
434
+ RedirectHTTP : Ptr (false ),
435
+ StickySessions : Ptr (true ),
436
436
},
437
437
HealthCheck : & schema.LoadBalancerActionAddServiceRequestHealthCheck {
438
438
Protocol : "http" ,
439
- Port : Int (4711 ),
440
- Interval : Int (15 ),
441
- Timeout : Int (10 ),
442
- Retries : Int (3 ),
439
+ Port : Ptr (4711 ),
440
+ Interval : Ptr (15 ),
441
+ Timeout : Ptr (10 ),
442
+ Retries : Ptr (3 ),
443
443
HTTP : & schema.LoadBalancerActionAddServiceRequestHealthCheckHTTP {
444
- Domain : String ("example.com" ),
445
- Path : String ("/" ),
444
+ Domain : Ptr ("example.com" ),
445
+ Path : Ptr ("/" ),
446
446
},
447
447
},
448
448
}
@@ -464,23 +464,23 @@ func TestLoadBalancerAddService(t *testing.T) {
464
464
465
465
opts := LoadBalancerAddServiceOpts {
466
466
Protocol : LoadBalancerServiceProtocolHTTP ,
467
- ListenPort : Int (4711 ),
468
- DestinationPort : Int (80 ),
467
+ ListenPort : Ptr (4711 ),
468
+ DestinationPort : Ptr (80 ),
469
469
HTTP : & LoadBalancerAddServiceOptsHTTP {
470
- CookieName : String ("HCLBSTICKY" ),
471
- CookieLifetime : Duration (5 * time .Minute ),
472
- RedirectHTTP : Bool (false ),
473
- StickySessions : Bool (true ),
470
+ CookieName : Ptr ("HCLBSTICKY" ),
471
+ CookieLifetime : Ptr (5 * time .Minute ),
472
+ RedirectHTTP : Ptr (false ),
473
+ StickySessions : Ptr (true ),
474
474
},
475
475
HealthCheck : & LoadBalancerAddServiceOptsHealthCheck {
476
476
Protocol : "http" ,
477
- Port : Int (4711 ),
478
- Interval : Duration (15 * time .Second ),
479
- Timeout : Duration (10 * time .Second ),
480
- Retries : Int (3 ),
477
+ Port : Ptr (4711 ),
478
+ Interval : Ptr (15 * time .Second ),
479
+ Timeout : Ptr (10 * time .Second ),
480
+ Retries : Ptr (3 ),
481
481
HTTP : & LoadBalancerAddServiceOptsHealthCheckHTTP {
482
- Domain : String ("example.com" ),
483
- Path : String ("/" ),
482
+ Domain : Ptr ("example.com" ),
483
+ Path : Ptr ("/" ),
484
484
},
485
485
},
486
486
}
@@ -506,24 +506,24 @@ func TestLoadBalancerUpdateService(t *testing.T) {
506
506
t .Fatal (err )
507
507
}
508
508
expectedReqBody := schema.LoadBalancerActionUpdateServiceRequest {
509
- Protocol : String (string (LoadBalancerServiceProtocolHTTP )),
509
+ Protocol : Ptr (string (LoadBalancerServiceProtocolHTTP )),
510
510
ListenPort : 4711 ,
511
- DestinationPort : Int (80 ),
511
+ DestinationPort : Ptr (80 ),
512
512
HTTP : & schema.LoadBalancerActionUpdateServiceRequestHTTP {
513
- CookieName : String ("HCLBSTICKY" ),
514
- CookieLifetime : Int (5 * 60 ),
515
- RedirectHTTP : Bool (false ),
516
- StickySessions : Bool (true ),
513
+ CookieName : Ptr ("HCLBSTICKY" ),
514
+ CookieLifetime : Ptr (5 * 60 ),
515
+ RedirectHTTP : Ptr (false ),
516
+ StickySessions : Ptr (true ),
517
517
},
518
518
HealthCheck : & schema.LoadBalancerActionUpdateServiceRequestHealthCheck {
519
- Protocol : String (string (LoadBalancerServiceProtocolHTTP )),
520
- Port : Int (4711 ),
521
- Interval : Int (15 ),
522
- Timeout : Int (10 ),
523
- Retries : Int (3 ),
519
+ Protocol : Ptr (string (LoadBalancerServiceProtocolHTTP )),
520
+ Port : Ptr (4711 ),
521
+ Interval : Ptr (15 ),
522
+ Timeout : Ptr (10 ),
523
+ Retries : Ptr (3 ),
524
524
HTTP : & schema.LoadBalancerActionUpdateServiceRequestHealthCheckHTTP {
525
- Domain : String ("example.com" ),
526
- Path : String ("/" ),
525
+ Domain : Ptr ("example.com" ),
526
+ Path : Ptr ("/" ),
527
527
},
528
528
},
529
529
}
@@ -545,22 +545,22 @@ func TestLoadBalancerUpdateService(t *testing.T) {
545
545
546
546
opts := LoadBalancerUpdateServiceOpts {
547
547
Protocol : LoadBalancerServiceProtocolHTTP ,
548
- DestinationPort : Int (80 ),
548
+ DestinationPort : Ptr (80 ),
549
549
HTTP : & LoadBalancerUpdateServiceOptsHTTP {
550
- CookieName : String ("HCLBSTICKY" ),
551
- CookieLifetime : Duration (5 * time .Minute ),
552
- RedirectHTTP : Bool (false ),
553
- StickySessions : Bool (true ),
550
+ CookieName : Ptr ("HCLBSTICKY" ),
551
+ CookieLifetime : Ptr (5 * time .Minute ),
552
+ RedirectHTTP : Ptr (false ),
553
+ StickySessions : Ptr (true ),
554
554
},
555
555
HealthCheck : & LoadBalancerUpdateServiceOptsHealthCheck {
556
556
Protocol : LoadBalancerServiceProtocolHTTP ,
557
- Port : Int (4711 ),
558
- Interval : Duration (15 * time .Second ),
559
- Timeout : Duration (10 * time .Second ),
560
- Retries : Int (3 ),
557
+ Port : Ptr (4711 ),
558
+ Interval : Ptr (15 * time .Second ),
559
+ Timeout : Ptr (10 * time .Second ),
560
+ Retries : Ptr (3 ),
561
561
HTTP : & LoadBalancerUpdateServiceOptsHealthCheckHTTP {
562
- Domain : String ("example.com" ),
563
- Path : String ("/" ),
562
+ Domain : Ptr ("example.com" ),
563
+ Path : Ptr ("/" ),
564
564
},
565
565
},
566
566
}
@@ -670,7 +670,7 @@ func TestLoadBalancerClientAttachToNetwork(t *testing.T) {
670
670
}
671
671
expectedReqBody := schema.LoadBalancerActionAttachToNetworkRequest {
672
672
Network : 1 ,
673
- IP : String ("10.0.1.1" ),
673
+ IP : Ptr ("10.0.1.1" ),
674
674
}
675
675
if ! cmp .Equal (expectedReqBody , reqBody ) {
676
676
t .Log (cmp .Diff (expectedReqBody , reqBody ))
@@ -898,7 +898,7 @@ func TestLoadBalancerClientAddLabelSelectorTarget(t *testing.T) {
898
898
ctx := context .Background ()
899
899
action , _ , err := env .Client .LoadBalancer .AddLabelSelectorTarget (ctx , & LoadBalancer {ID : 1 }, LoadBalancerAddLabelSelectorTargetOpts {
900
900
Selector : "key=value" ,
901
- UsePrivateIP : Bool (false ),
901
+ UsePrivateIP : Ptr (false ),
902
902
})
903
903
if err != nil {
904
904
t .Fatal (err )
0 commit comments