1
+ //go:build examples
1
2
// +build examples
2
3
3
4
/**
@@ -25,11 +26,10 @@ import (
25
26
26
27
"github.com/IBM/code-engine-go-sdk/codeenginev2"
27
28
"github.com/IBM/go-sdk-core/v5/core"
28
- . "github.com/onsi/ginkgo"
29
+ . "github.com/onsi/ginkgo/v2 "
29
30
. "github.com/onsi/gomega"
30
31
)
31
32
32
- //
33
33
// This file provides an example of how to use the Code Engine service.
34
34
//
35
35
// The following configuration properties are assumed to be defined:
@@ -41,14 +41,13 @@ import (
41
41
// These configuration properties can be exported as environment variables, or stored
42
42
// in a configuration file and then:
43
43
// export IBM_CREDENTIALS_FILE=<name of configuration file>
44
- //
45
44
var _ = Describe (`CodeEngineV2 Examples Tests` , func () {
46
45
47
46
const externalConfigFile = "../code_engine_v2.env"
48
47
49
48
var (
50
49
codeEngineService * codeenginev2.CodeEngineV2
51
- config map [string ]string
50
+ config map [string ]string
52
51
)
53
52
54
53
var shouldSkipTest = func () {
@@ -215,7 +214,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
215
214
// begin-list_apps
216
215
listAppsOptions := & codeenginev2.ListAppsOptions {
217
216
ProjectID : core .StringPtr ("15314cc3-85b4-4338-903f-c28cdee6d005" ),
218
- Limit : core .Int64Ptr (int64 (100 )),
217
+ Limit : core .Int64Ptr (int64 (100 )),
219
218
}
220
219
221
220
pager , err := codeEngineService .NewAppsPager (listAppsOptions )
@@ -284,8 +283,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
284
283
fmt .Println ("\n UpdateApp() result:" )
285
284
// begin-update_app
286
285
287
- appPatchModel := & codeenginev2.AppPatch {
288
- }
286
+ appPatchModel := & codeenginev2.AppPatch {}
289
287
appPatchModelAsPatch , asPatchErr := appPatchModel .AsPatch ()
290
288
Expect (asPatchErr ).To (BeNil ())
291
289
@@ -314,8 +312,8 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
314
312
// begin-list_app_revisions
315
313
listAppRevisionsOptions := & codeenginev2.ListAppRevisionsOptions {
316
314
ProjectID : core .StringPtr ("15314cc3-85b4-4338-903f-c28cdee6d005" ),
317
- AppName : core .StringPtr ("my-app" ),
318
- Limit : core .Int64Ptr (int64 (100 )),
315
+ AppName : core .StringPtr ("my-app" ),
316
+ Limit : core .Int64Ptr (int64 (100 )),
319
317
}
320
318
321
319
pager , err := codeEngineService .NewAppRevisionsPager (listAppRevisionsOptions )
@@ -363,7 +361,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
363
361
// begin-list_jobs
364
362
listJobsOptions := & codeenginev2.ListJobsOptions {
365
363
ProjectID : core .StringPtr ("15314cc3-85b4-4338-903f-c28cdee6d005" ),
366
- Limit : core .Int64Ptr (int64 (100 )),
364
+ Limit : core .Int64Ptr (int64 (100 )),
367
365
}
368
366
369
367
pager , err := codeEngineService .NewJobsPager (listJobsOptions )
@@ -432,8 +430,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
432
430
fmt .Println ("\n UpdateJob() result:" )
433
431
// begin-update_job
434
432
435
- jobPatchModel := & codeenginev2.JobPatch {
436
- }
433
+ jobPatchModel := & codeenginev2.JobPatch {}
437
434
jobPatchModelAsPatch , asPatchErr := jobPatchModel .AsPatch ()
438
435
Expect (asPatchErr ).To (BeNil ())
439
436
@@ -462,8 +459,8 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
462
459
// begin-list_job_runs
463
460
listJobRunsOptions := & codeenginev2.ListJobRunsOptions {
464
461
ProjectID : core .StringPtr ("15314cc3-85b4-4338-903f-c28cdee6d005" ),
465
- JobName : core .StringPtr ("my-job" ),
466
- Limit : core .Int64Ptr (int64 (100 )),
462
+ JobName : core .StringPtr ("my-job" ),
463
+ Limit : core .Int64Ptr (int64 (100 )),
467
464
}
468
465
469
466
pager , err := codeEngineService .NewJobRunsPager (listJobRunsOptions )
@@ -531,7 +528,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
531
528
// begin-list_bindings
532
529
listBindingsOptions := & codeenginev2.ListBindingsOptions {
533
530
ProjectID : core .StringPtr ("15314cc3-85b4-4338-903f-c28cdee6d005" ),
534
- Limit : core .Int64Ptr (int64 (100 )),
531
+ Limit : core .Int64Ptr (int64 (100 )),
535
532
}
536
533
537
534
pager , err := codeEngineService .NewBindingsPager (listBindingsOptions )
@@ -556,7 +553,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
556
553
// begin-create_binding
557
554
558
555
componentRefModel := & codeenginev2.ComponentRef {
559
- Name : core .StringPtr ("my-app-1" ),
556
+ Name : core .StringPtr ("my-app-1" ),
560
557
ResourceType : core .StringPtr ("app_v2" ),
561
558
}
562
559
@@ -607,7 +604,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
607
604
// begin-list_builds
608
605
listBuildsOptions := & codeenginev2.ListBuildsOptions {
609
606
ProjectID : core .StringPtr ("15314cc3-85b4-4338-903f-c28cdee6d005" ),
610
- Limit : core .Int64Ptr (int64 (100 )),
607
+ Limit : core .Int64Ptr (int64 (100 )),
611
608
}
612
609
613
610
pager , err := codeEngineService .NewBuildsPager (listBuildsOptions )
@@ -678,8 +675,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
678
675
fmt .Println ("\n UpdateBuild() result:" )
679
676
// begin-update_build
680
677
681
- buildPatchModel := & codeenginev2.BuildPatch {
682
- }
678
+ buildPatchModel := & codeenginev2.BuildPatch {}
683
679
buildPatchModelAsPatch , asPatchErr := buildPatchModel .AsPatch ()
684
680
Expect (asPatchErr ).To (BeNil ())
685
681
@@ -709,7 +705,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
709
705
listBuildRunsOptions := & codeenginev2.ListBuildRunsOptions {
710
706
ProjectID : core .StringPtr ("15314cc3-85b4-4338-903f-c28cdee6d005" ),
711
707
BuildName : core .StringPtr ("my-build" ),
712
- Limit : core .Int64Ptr (int64 (100 )),
708
+ Limit : core .Int64Ptr (int64 (100 )),
713
709
}
714
710
715
711
pager , err := codeEngineService .NewBuildRunsPager (listBuildRunsOptions )
@@ -777,7 +773,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
777
773
// begin-list_config_maps
778
774
listConfigMapsOptions := & codeenginev2.ListConfigMapsOptions {
779
775
ProjectID : core .StringPtr ("15314cc3-85b4-4338-903f-c28cdee6d005" ),
780
- Limit : core .Int64Ptr (int64 (100 )),
776
+ Limit : core .Int64Ptr (int64 (100 )),
781
777
}
782
778
783
779
pager , err := codeEngineService .NewConfigMapsPager (listConfigMapsOptions )
@@ -869,7 +865,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
869
865
// begin-list_secrets
870
866
listSecretsOptions := & codeenginev2.ListSecretsOptions {
871
867
ProjectID : core .StringPtr ("15314cc3-85b4-4338-903f-c28cdee6d005" ),
872
- Limit : core .Int64Ptr (int64 (100 )),
868
+ Limit : core .Int64Ptr (int64 (100 )),
873
869
}
874
870
875
871
pager , err := codeEngineService .NewSecretsPager (listSecretsOptions )
@@ -963,7 +959,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
963
959
// begin-list_domain_mappings
964
960
listDomainMappingsOptions := & codeenginev2.ListDomainMappingsOptions {
965
961
ProjectID : core .StringPtr ("15314cc3-85b4-4338-903f-c28cdee6d005" ),
966
- Limit : core .Int64Ptr (int64 (100 )),
962
+ Limit : core .Int64Ptr (int64 (100 )),
967
963
}
968
964
969
965
pager , err := codeEngineService .NewDomainMappingsPager (listDomainMappingsOptions )
@@ -988,7 +984,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
988
984
// begin-create_domain_mapping
989
985
990
986
componentRefModel := & codeenginev2.ComponentRef {
991
- Name : core .StringPtr ("my-app-1" ),
987
+ Name : core .StringPtr ("my-app-1" ),
992
988
ResourceType : core .StringPtr ("app_v2" ),
993
989
}
994
990
@@ -1038,8 +1034,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
1038
1034
fmt .Println ("\n UpdateDomainMapping() result:" )
1039
1035
// begin-update_domain_mapping
1040
1036
1041
- domainMappingPatchModel := & codeenginev2.DomainMappingPatch {
1042
- }
1037
+ domainMappingPatchModel := & codeenginev2.DomainMappingPatch {}
1043
1038
domainMappingPatchModelAsPatch , asPatchErr := domainMappingPatchModel .AsPatch ()
1044
1039
Expect (asPatchErr ).To (BeNil ())
1045
1040
0 commit comments