Skip to content

Commit

Permalink
fix: add labels to examples (#97)
Browse files Browse the repository at this point in the history
* fix(activity tracker): add labels to example output

* fix(case management): add labels to example output

* fix(configuration governance): add spaces between "\n" and "%s" in printf methods for easier readability

* fix(enterprise billing units): add labels to example output

* fix(enterprise usage report): add labels to example output

* fix(global catalog): add labels to example output

* fix(global search): add labels to example output

* fix(global tagging): add labels to example output

* fix(iam access groups): add labels to example output

* fix(iam identity): add labels to example output

* fix(iam policy management): add labels to example output

* fix(open service broker): add labels to example output

* fix(resource controller): add labels to example output

* fix(resource manager): add labels to example output

* fix(usage metering): add labels to example output

* fix(usage reports): add labels to example output

* fix(user management): add labels to example output

* fix(attracker): fix labels in example output

* fix(case management): fix labels in example output

* fix(configuration governance): fix labels in example output

* fix(enterprise billing units): fix labels in example output

* fix(enterprise usage reports): fix labels in example output

* fix(global catalog): fix labels in example output

* fix(global search): fix labels in example output

* fix(global tagging): fix labels in example output

* fix(iam access groups): fix labels in example output

* fix(iam identity): fix labels in example output

* fix(iam policy management): fix labels in example output

* fix(open service broker): fix labels in example output

* fix(resource controller): fix labels in example output

* fix(resource manager): fix labels in example output

* fix(usage metering): fix labels in example output

* fix(usage reports): fix labels in example output

* fix(user management): fix labels in example output

* fix(configuration governance): fix build fail
  • Loading branch information
Andras-Csanyi authored Mar 25, 2021
1 parent af50700 commit 35e8342
Show file tree
Hide file tree
Showing 16 changed files with 130 additions and 109 deletions.
20 changes: 10 additions & 10 deletions atrackerv1/atracker_v1_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(target, "", " ")
fmt.Println(string(b))
fmt.Printf("\nCreateTarget() result:\n%s\n", string(b))

// end-create_target

Expand All @@ -136,7 +136,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(targetList, "", " ")
fmt.Println(string(b))
fmt.Printf("\nListTargets() result:\n%s\n", string(b))

// end-list_targets

Expand All @@ -157,7 +157,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(target, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetTarget() result:\n%s\n", string(b))

// end-get_target

Expand Down Expand Up @@ -188,7 +188,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(target, "", " ")
fmt.Println(string(b))
fmt.Printf("\nReplaceTarget() result:\n%s\n", string(b))

// end-replace_target

Expand All @@ -215,7 +215,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(route, "", " ")
fmt.Println(string(b))
fmt.Printf("\nCreateRoute() result:\n%s\n", string(b))

// end-create_route

Expand All @@ -236,7 +236,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(routeList, "", " ")
fmt.Println(string(b))
fmt.Printf("\nListRoutes() result:\n%s\n", string(b))

// end-list_routes

Expand All @@ -257,7 +257,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(route, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetRoute() result:\n%s\n", string(b))

// end-get_route

Expand Down Expand Up @@ -285,7 +285,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(route, "", " ")
fmt.Println(string(b))
fmt.Printf("\nReplaceRoute() result:\n%s\n", string(b))

// end-replace_route

Expand All @@ -305,7 +305,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
if err != nil {
panic(err)
}

fmt.Printf("\nDeleteRoute() response status code: %d\n", response.StatusCode)
// end-delete_route

Expect(err).To(BeNil())
Expand All @@ -323,7 +323,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
if err != nil {
panic(err)
}

fmt.Printf("\nDeleteTarget() result status code: %d\n", response.StatusCode)
// end-delete_target

Expect(err).To(BeNil())
Expand Down
21 changes: 11 additions & 10 deletions casemanagementv1/case_management_v1_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(caseVar, "", " ")
fmt.Println(string(b))
fmt.Printf("\nCreateCase() result:\n%s\n", string(b))

// end-createCase

Expand Down Expand Up @@ -172,7 +172,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(caseVar, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetCase() result:\n%s\n", string(b))

// end-getCase

Expand All @@ -195,7 +195,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(caseList, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetCases() result:\n%s\n", string(b))

// end-getCases

Expand All @@ -219,7 +219,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(comment, "", " ")
fmt.Println(string(b))
fmt.Printf("\nAddComment() result:\n%s\n", string(b))

// end-addComment

Expand All @@ -245,7 +245,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(watchlistAddResponse, "", " ")
fmt.Println(string(b))
fmt.Printf("\nAddWatchlist() result:\n%s\n", string(b))

// end-addWatchlist

Expand All @@ -271,7 +271,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(watchlist, "", " ")
fmt.Println(string(b))
fmt.Printf("\nRemoveWatchlist() result:\n%s\n", string(b))

// end-removeWatchlist

Expand All @@ -296,7 +296,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(resource, "", " ")
fmt.Println(string(b))
fmt.Printf("\nAddResource() result:\n%s\n", string(b))

// end-addResource

Expand Down Expand Up @@ -328,7 +328,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(attachment, "", " ")
fmt.Println(string(b))
fmt.Printf("\nUploadFile() result:\n%s\n", string(b))

// end-uploadFile

Expand Down Expand Up @@ -359,6 +359,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
buf := new(bytes.Buffer)
buf.ReadFrom(result)

fmt.Println("\nDownloadFile() result:")
fmt.Println("Attachment content-type: ", response.GetHeaders().Get("Content-Type"))
fmt.Println("Attachment contents: ", buf.String())
}
Expand Down Expand Up @@ -386,7 +387,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(attachmentList, "", " ")
fmt.Println(string(b))
fmt.Printf("\nDeleteFile() result:\n%s\n", string(b))

// end-deleteFile

Expand Down Expand Up @@ -416,7 +417,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(caseVar, "", " ")
fmt.Println(string(b))
fmt.Printf("\nUpdateCaseStatus() result:\n%s\n", string(b))

// end-updateCaseStatus

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,7 @@ var _ = Describe(`ConfigurationGovernanceV1 Examples Tests`, func() {
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(response, "", " ")
fmt.Printf("DeleteAttachment() response body:\n%s\n", string(b))
fmt.Printf("DeleteAttachment() response status code: %d\n", response.StatusCode)

// end-delete_attachment

Expand All @@ -459,8 +458,7 @@ var _ = Describe(`ConfigurationGovernanceV1 Examples Tests`, func() {
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(response, "", " ")
fmt.Printf("DeleteRule() response body:\n%s\n", string(b))
fmt.Printf("DeleteRule() response status code: %d\n", response.StatusCode)

// end-delete_rule

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ var _ = Describe(`EnterpriseBillingUnitsV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(billingUnit, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetBillingUnit() result:\n%s\n", string(b))

// end-get_billing_unit

Expand All @@ -146,7 +146,7 @@ var _ = Describe(`EnterpriseBillingUnitsV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(billingUnitsList, "", " ")
fmt.Println(string(b))
fmt.Printf("\nListBillingUnits() result:\n%s\n", string(b))

// end-list_billing_units

Expand All @@ -167,7 +167,7 @@ var _ = Describe(`EnterpriseBillingUnitsV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(billingOption, "", " ")
fmt.Println(string(b))
fmt.Printf("\nListBillingOptions() result:\n%s\n", string(b))

// end-list_billing_options

Expand All @@ -188,7 +188,7 @@ var _ = Describe(`EnterpriseBillingUnitsV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(creditPoolsList, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetCreditPools() result:\n%s\n", string(b))

// end-get_credit_pools

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ var _ = Describe(`EnterpriseUsageReportsV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(reports, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetResourceUsageReport() result:\n%s\n", string(b))

// end-get_resource_usage_report

Expand Down
29 changes: 17 additions & 12 deletions globalcatalogv1/global_catalog_v1_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(catalogEntry, "", " ")
fmt.Println(string(b))
fmt.Printf("\nCreateCatalogEntry() result:\n%s\n", string(b))

// end-create_catalog_entry

Expand All @@ -193,7 +193,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(catalogEntry, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetCatalogEntry() result:\n%s\n", string(b))

// end-get_catalog_entry

Expand Down Expand Up @@ -258,7 +258,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(catalogEntry, "", " ")
fmt.Println(string(b))
fmt.Printf("\nUpdateCatalogEntry() result:\n%s\n", string(b))

// end-update_catalog_entry

Expand All @@ -281,7 +281,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(entrySearchResult, "", " ")
fmt.Println(string(b))
fmt.Printf("\nListCatalogEntries() result:\n%s\n", string(b))

// end-list_catalog_entries

Expand All @@ -308,7 +308,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(entrySearchResult, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetChildObjects() result:\n%s\n", string(b))

// end-get_child_objects

Expand All @@ -329,6 +329,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
if err != nil {
panic(err)
}
fmt.Printf("\nRestoreCatalogEntry() response status code: %d\n", response.StatusCode)

// end-restore_catalog_entry

Expand All @@ -350,7 +351,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(visibility, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetVisibility() result:\n%s\n", string(b))

// end-get_visibility

Expand All @@ -373,6 +374,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
if err != nil {
fmt.Println("UpdateVisibility() returned the following error: ", err.Error())
}
fmt.Printf("\nUpdateVisibility() response status code: %d\n: ", response.StatusCode)

// end-update_visibility

Expand All @@ -393,7 +395,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(pricingGet, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetPricing() result:\n%s\n", string(b))

// end-get_pricing

Expand All @@ -418,7 +420,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(auditSearchResult, "", " ")
fmt.Println(string(b))
fmt.Printf("\nGetAuditLogs() result:\n%s\n", string(b))

// end-get_audit_logs

Expand All @@ -444,6 +446,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
if err != nil {
panic(err)
}
fmt.Printf("\nUploadArtifact() response status code: %d\n", response.StatusCode)

// end-upload_artifact

Expand All @@ -468,8 +471,9 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
defer result.Close()
buf := new(bytes.Buffer)
buf.ReadFrom(result)
fmt.Println("Artifact content-type: ", response.GetHeaders().Get("Content-Type"))
fmt.Println("Artifact contents: ", buf.String())
fmt.Println("\nGetArtifact() result:")
fmt.Printf("Artifact content-type: %s \n", response.GetHeaders().Get("Content-Type"))
fmt.Printf("Artifact contents: %s \n", buf.String())
}

// end-get_artifact
Expand All @@ -492,7 +496,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
panic(err)
}
b, _ := json.MarshalIndent(artifacts, "", " ")
fmt.Println(string(b))
fmt.Printf("\nListArtifacts() result:\n%s\n", string(b))

// end-list_artifacts

Expand All @@ -515,7 +519,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
if err != nil {
panic(err)
}

fmt.Printf("\nDeleteArtifact() response status code: %d\n", response.StatusCode)
// end-delete_artifact

Expect(err).To(BeNil())
Expand All @@ -535,6 +539,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
if err != nil {
panic(err)
}
fmt.Printf("\nDeleteCatalogEntry() response status code: %d\n", response.StatusCode)

// end-delete_catalog_entry

Expand Down
Loading

0 comments on commit 35e8342

Please sign in to comment.