Skip to content

Commit

Permalink
fix(Catalog Management): Update examples
Browse files Browse the repository at this point in the history
Signed-off-by: dubeejw <[email protected]>
  • Loading branch information
dubee committed Sep 21, 2022
1 parent 6018093 commit 54e08eb
Showing 1 changed file with 3 additions and 142 deletions.
145 changes: 3 additions & 142 deletions catalogmanagementv1/catalog_management_v1_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() {
importOfferingOptions.Zipurl = core.StringPtr("https://github.com/rhm-samples/node-red-operator/blob/master/node-red-operator/bundle/0.0.2/node-red-operator.v0.0.2.clusterserviceversion.yaml")
importOfferingOptions.OfferingID = &offeringID
importOfferingOptions.TargetVersion = core.StringPtr("0.0.2")
importOfferingOptions.RepoType = core.StringPtr("git_public")
importOfferingOptions.Repotype = core.StringPtr("git_public")
importOfferingOptions.XAuthToken = &gitAuthTokenForPublicRepo

offering, response, err := catalogManagementService.ImportOffering(importOfferingOptions)
Expand Down Expand Up @@ -419,29 +419,6 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() {
objectID = *catalogObject.ID
})

It(`GetOfferingAudit request example`, func() {
fmt.Println("\nGetOfferingAudit() result:")
// begin-get_offering_audit

getOfferingAuditOptions := catalogManagementService.NewGetOfferingAuditOptions(
catalogID,
offeringID,
)

auditLog, response, err := catalogManagementService.GetOfferingAudit(getOfferingAuditOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(auditLog, "", " ")
fmt.Println(string(b))

// end-get_offering_audit

Expect(err).To(BeNil())
Expect(response.StatusCode).To(Equal(200))
Expect(auditLog).ToNot(BeNil())
})

It(`GetCatalogAccount request example`, func() {
fmt.Println("\nGetCatalogAccount() result:")
// begin-get_catalog_account
Expand Down Expand Up @@ -473,7 +450,7 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() {
updateCatalogAccountOptions.AccountFilters = includeAllFilter
updateCatalogAccountOptions.ID = &accountID

response, err := catalogManagementService.UpdateCatalogAccount(updateCatalogAccountOptions)
_, response, err := catalogManagementService.UpdateCatalogAccount(updateCatalogAccountOptions)
if err != nil {
panic(err)
}
Expand All @@ -485,26 +462,6 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() {
Expect(response.StatusCode).To(Equal(200))
})

It(`GetCatalogAccountAudit request example`, func() {
fmt.Println("\nGetCatalogAccountAudit() result:")
// begin-get_catalog_account_audit

getCatalogAccountAuditOptions := catalogManagementService.NewGetCatalogAccountAuditOptions()

auditLog, response, err := catalogManagementService.GetCatalogAccountAudit(getCatalogAccountAuditOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(auditLog, "", " ")
fmt.Println(string(b))

// end-get_catalog_account_audit

Expect(err).To(BeNil())
Expect(response.StatusCode).To(Equal(200))
Expect(auditLog).ToNot(BeNil())
})

It(`GetCatalogAccountFilters request example`, func() {
fmt.Println("\nGetCatalogAccountFilters() result:")
// begin-get_catalog_account_filters
Expand All @@ -525,28 +482,6 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() {
Expect(accumulatedFilters).ToNot(BeNil())
})

It(`GetCatalogAudit request example`, func() {
fmt.Println("\nGetCatalogAudit() result:")
// begin-get_catalog_audit

getCatalogAuditOptions := catalogManagementService.NewGetCatalogAuditOptions(
catalogID,
)

auditLog, response, err := catalogManagementService.GetCatalogAudit(getCatalogAuditOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(auditLog, "", " ")
fmt.Println(string(b))

// end-get_catalog_audit

Expect(err).To(BeNil())
Expect(response.StatusCode).To(Equal(200))
Expect(auditLog).ToNot(BeNil())
})

It(`GetConsumptionOfferings request example`, func() {
fmt.Println("\nGetConsumptionOfferings() result:")
// begin-get_consumption_offerings
Expand Down Expand Up @@ -578,7 +513,7 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() {
importOfferingVersionOptions.TargetKinds = []string{"roks"}
importOfferingVersionOptions.Zipurl = core.StringPtr("https://github.com/rhm-samples/node-red-operator/blob/master/node-red-operator/bundle/0.0.2/node-red-operator.v0.0.2.clusterserviceversion.yaml")
importOfferingVersionOptions.TargetVersion = core.StringPtr("0.0.3")
importOfferingVersionOptions.RepoType = core.StringPtr("git_public")
importOfferingVersionOptions.Repotype = core.StringPtr("git_public")

offering, response, err := catalogManagementService.ImportOfferingVersion(importOfferingVersionOptions)
if err != nil {
Expand All @@ -594,57 +529,6 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() {
Expect(offering).ToNot(BeNil())
})

It(`ReplaceOfferingIcon request example`, func() {
Skip("Skipped by desing.")
fmt.Println("\nReplaceOfferingIcon() result:")
// begin-replace_offering_icon

replaceOfferingIconOptions := catalogManagementService.NewReplaceOfferingIconOptions(
catalogID,
offeringID,
"offering_icon.png",
)

offering, response, err := catalogManagementService.ReplaceOfferingIcon(replaceOfferingIconOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(offering, "", " ")
fmt.Println(string(b))

// end-replace_offering_icon

Expect(err).To(BeNil())
Expect(response.StatusCode).To(Equal(200))
Expect(offering).ToNot(BeNil())
})

It(`UpdateOfferingIBM request example`, func() {
Skip("Skipped by desing.")
fmt.Println("\nUpdateOfferingIBM() result:")
// begin-update_offering_ibm

updateOfferingIBMOptions := catalogManagementService.NewUpdateOfferingIBMOptions(
catalogID,
offeringID,
"allow_request",
"true",
)

approvalResult, response, err := catalogManagementService.UpdateOfferingIBM(updateOfferingIBMOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(approvalResult, "", " ")
fmt.Println(string(b))

// end-update_offering_ibm

Expect(err).To(BeNil())
Expect(response.StatusCode).To(Equal(200))
Expect(approvalResult).ToNot(BeNil())
})

It(`GetOfferingUpdates request example`, func() {
Skip("Skipped by desing.")
fmt.Println("\nGetOfferingUpdates() result:")
Expand Down Expand Up @@ -1275,29 +1159,6 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() {
Expect(catalogObject).ToNot(BeNil())
})

It(`GetObjectAudit request example`, func() {
fmt.Println("\nGetObjectAudit() result:")
// begin-get_object_audit

getObjectAuditOptions := catalogManagementService.NewGetObjectAuditOptions(
catalogID,
objectID,
)

auditLog, response, err := catalogManagementService.GetObjectAudit(getObjectAuditOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(auditLog, "", " ")
fmt.Println(string(b))

// end-get_object_audit

Expect(err).To(BeNil())
Expect(response.StatusCode).To(Equal(200))
Expect(auditLog).ToNot(BeNil())
})

It(`AccountPublishObject request example`, func() {
// begin-account_publish_object

Expand Down

0 comments on commit 54e08eb

Please sign in to comment.