Skip to content

Commit da397b9

Browse files
Jason PetersonGitHub Enterprise
authored andcommitted
fix(readme): add readme for example_v2 (#120)
1 parent 174d0dc commit da397b9

11 files changed

+481
-441
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ to your `Gopkg.toml` file. Here is an example:
9292
then run `dep ensure`.
9393

9494
## Using the SDK
95-
Examples and a demo are available in the [example](/example) folder.
95+
Examples and a demo are available [here](https://github.ibm.com/coligo/go-sdk/blob/main/example/v2/README.md).
9696

9797
For general SDK usage information, please see [this link](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md)
9898

codeenginev2/code_engine_v2_examples_test.go

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build examples
12
// +build examples
23

34
/**
@@ -25,11 +26,10 @@ import (
2526

2627
"github.com/IBM/code-engine-go-sdk/codeenginev2"
2728
"github.com/IBM/go-sdk-core/v5/core"
28-
. "github.com/onsi/ginkgo"
29+
. "github.com/onsi/ginkgo/v2"
2930
. "github.com/onsi/gomega"
3031
)
3132

32-
//
3333
// This file provides an example of how to use the Code Engine service.
3434
//
3535
// The following configuration properties are assumed to be defined:
@@ -41,14 +41,13 @@ import (
4141
// These configuration properties can be exported as environment variables, or stored
4242
// in a configuration file and then:
4343
// export IBM_CREDENTIALS_FILE=<name of configuration file>
44-
//
4544
var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
4645

4746
const externalConfigFile = "../code_engine_v2.env"
4847

4948
var (
5049
codeEngineService *codeenginev2.CodeEngineV2
51-
config map[string]string
50+
config map[string]string
5251
)
5352

5453
var shouldSkipTest = func() {
@@ -215,7 +214,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
215214
// begin-list_apps
216215
listAppsOptions := &codeenginev2.ListAppsOptions{
217216
ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"),
218-
Limit: core.Int64Ptr(int64(100)),
217+
Limit: core.Int64Ptr(int64(100)),
219218
}
220219

221220
pager, err := codeEngineService.NewAppsPager(listAppsOptions)
@@ -284,8 +283,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
284283
fmt.Println("\nUpdateApp() result:")
285284
// begin-update_app
286285

287-
appPatchModel := &codeenginev2.AppPatch{
288-
}
286+
appPatchModel := &codeenginev2.AppPatch{}
289287
appPatchModelAsPatch, asPatchErr := appPatchModel.AsPatch()
290288
Expect(asPatchErr).To(BeNil())
291289

@@ -314,8 +312,8 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
314312
// begin-list_app_revisions
315313
listAppRevisionsOptions := &codeenginev2.ListAppRevisionsOptions{
316314
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)),
319317
}
320318

321319
pager, err := codeEngineService.NewAppRevisionsPager(listAppRevisionsOptions)
@@ -363,7 +361,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
363361
// begin-list_jobs
364362
listJobsOptions := &codeenginev2.ListJobsOptions{
365363
ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"),
366-
Limit: core.Int64Ptr(int64(100)),
364+
Limit: core.Int64Ptr(int64(100)),
367365
}
368366

369367
pager, err := codeEngineService.NewJobsPager(listJobsOptions)
@@ -432,8 +430,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
432430
fmt.Println("\nUpdateJob() result:")
433431
// begin-update_job
434432

435-
jobPatchModel := &codeenginev2.JobPatch{
436-
}
433+
jobPatchModel := &codeenginev2.JobPatch{}
437434
jobPatchModelAsPatch, asPatchErr := jobPatchModel.AsPatch()
438435
Expect(asPatchErr).To(BeNil())
439436

@@ -462,8 +459,8 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
462459
// begin-list_job_runs
463460
listJobRunsOptions := &codeenginev2.ListJobRunsOptions{
464461
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)),
467464
}
468465

469466
pager, err := codeEngineService.NewJobRunsPager(listJobRunsOptions)
@@ -531,7 +528,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
531528
// begin-list_bindings
532529
listBindingsOptions := &codeenginev2.ListBindingsOptions{
533530
ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"),
534-
Limit: core.Int64Ptr(int64(100)),
531+
Limit: core.Int64Ptr(int64(100)),
535532
}
536533

537534
pager, err := codeEngineService.NewBindingsPager(listBindingsOptions)
@@ -556,7 +553,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
556553
// begin-create_binding
557554

558555
componentRefModel := &codeenginev2.ComponentRef{
559-
Name: core.StringPtr("my-app-1"),
556+
Name: core.StringPtr("my-app-1"),
560557
ResourceType: core.StringPtr("app_v2"),
561558
}
562559

@@ -607,7 +604,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
607604
// begin-list_builds
608605
listBuildsOptions := &codeenginev2.ListBuildsOptions{
609606
ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"),
610-
Limit: core.Int64Ptr(int64(100)),
607+
Limit: core.Int64Ptr(int64(100)),
611608
}
612609

613610
pager, err := codeEngineService.NewBuildsPager(listBuildsOptions)
@@ -678,8 +675,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
678675
fmt.Println("\nUpdateBuild() result:")
679676
// begin-update_build
680677

681-
buildPatchModel := &codeenginev2.BuildPatch{
682-
}
678+
buildPatchModel := &codeenginev2.BuildPatch{}
683679
buildPatchModelAsPatch, asPatchErr := buildPatchModel.AsPatch()
684680
Expect(asPatchErr).To(BeNil())
685681

@@ -709,7 +705,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
709705
listBuildRunsOptions := &codeenginev2.ListBuildRunsOptions{
710706
ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"),
711707
BuildName: core.StringPtr("my-build"),
712-
Limit: core.Int64Ptr(int64(100)),
708+
Limit: core.Int64Ptr(int64(100)),
713709
}
714710

715711
pager, err := codeEngineService.NewBuildRunsPager(listBuildRunsOptions)
@@ -777,7 +773,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
777773
// begin-list_config_maps
778774
listConfigMapsOptions := &codeenginev2.ListConfigMapsOptions{
779775
ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"),
780-
Limit: core.Int64Ptr(int64(100)),
776+
Limit: core.Int64Ptr(int64(100)),
781777
}
782778

783779
pager, err := codeEngineService.NewConfigMapsPager(listConfigMapsOptions)
@@ -869,7 +865,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
869865
// begin-list_secrets
870866
listSecretsOptions := &codeenginev2.ListSecretsOptions{
871867
ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"),
872-
Limit: core.Int64Ptr(int64(100)),
868+
Limit: core.Int64Ptr(int64(100)),
873869
}
874870

875871
pager, err := codeEngineService.NewSecretsPager(listSecretsOptions)
@@ -963,7 +959,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
963959
// begin-list_domain_mappings
964960
listDomainMappingsOptions := &codeenginev2.ListDomainMappingsOptions{
965961
ProjectID: core.StringPtr("15314cc3-85b4-4338-903f-c28cdee6d005"),
966-
Limit: core.Int64Ptr(int64(100)),
962+
Limit: core.Int64Ptr(int64(100)),
967963
}
968964

969965
pager, err := codeEngineService.NewDomainMappingsPager(listDomainMappingsOptions)
@@ -988,7 +984,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
988984
// begin-create_domain_mapping
989985

990986
componentRefModel := &codeenginev2.ComponentRef{
991-
Name: core.StringPtr("my-app-1"),
987+
Name: core.StringPtr("my-app-1"),
992988
ResourceType: core.StringPtr("app_v2"),
993989
}
994990

@@ -1038,8 +1034,7 @@ var _ = Describe(`CodeEngineV2 Examples Tests`, func() {
10381034
fmt.Println("\nUpdateDomainMapping() result:")
10391035
// begin-update_domain_mapping
10401036

1041-
domainMappingPatchModel := &codeenginev2.DomainMappingPatch{
1042-
}
1037+
domainMappingPatchModel := &codeenginev2.DomainMappingPatch{}
10431038
domainMappingPatchModelAsPatch, asPatchErr := domainMappingPatchModel.AsPatch()
10441039
Expect(asPatchErr).To(BeNil())
10451040

0 commit comments

Comments
 (0)