Skip to content

Commit

Permalink
fix(Catalog Management): re-gen SDK code after recent API changes (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
padamstx committed Apr 27, 2021
1 parent 25953d0 commit 941ece8
Show file tree
Hide file tree
Showing 3 changed files with 190 additions and 38 deletions.
107 changes: 103 additions & 4 deletions catalogmanagementv1/catalog_management_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-212f8afa-20210222-123519
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-3dfbf8b1-20210427-155443
*/

// Package catalogmanagementv1 : Operations and models for the CatalogManagementV1 service
Expand All @@ -25,12 +25,13 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/IBM/go-sdk-core/v5/core"
common "github.com/IBM/platform-services-go-sdk/common"
"github.com/go-openapi/strfmt"
"net/http"
"reflect"
"time"

"github.com/IBM/go-sdk-core/v5/core"
common "github.com/IBM/platform-services-go-sdk/common"
"github.com/go-openapi/strfmt"
)

// CatalogManagementV1 : This is the API to use for managing private catalogs for IBM Cloud. Private catalogs provide a
Expand Down Expand Up @@ -490,6 +491,9 @@ func (catalogManagement *CatalogManagementV1) CreateCatalogWithContext(ctx conte
if createCatalogOptions.SyndicationSettings != nil {
body["syndication_settings"] = createCatalogOptions.SyndicationSettings
}
if createCatalogOptions.Kind != nil {
body["kind"] = createCatalogOptions.Kind
}
_, err = builder.SetBodyContentJSON(body)
if err != nil {
return
Expand Down Expand Up @@ -649,6 +653,9 @@ func (catalogManagement *CatalogManagementV1) ReplaceCatalogWithContext(ctx cont
if replaceCatalogOptions.SyndicationSettings != nil {
body["syndication_settings"] = replaceCatalogOptions.SyndicationSettings
}
if replaceCatalogOptions.Kind != nil {
body["kind"] = replaceCatalogOptions.Kind
}
_, err = builder.SetBodyContentJSON(body)
if err != nil {
return
Expand Down Expand Up @@ -1179,6 +1186,9 @@ func (catalogManagement *CatalogManagementV1) CreateOfferingWithContext(ctx cont
if createOfferingOptions.Tags != nil {
body["tags"] = createOfferingOptions.Tags
}
if createOfferingOptions.Keywords != nil {
body["keywords"] = createOfferingOptions.Keywords
}
if createOfferingOptions.Rating != nil {
body["rating"] = createOfferingOptions.Rating
}
Expand Down Expand Up @@ -1316,6 +1326,9 @@ func (catalogManagement *CatalogManagementV1) ImportOfferingVersionWithContext(c
if importOfferingVersionOptions.IncludeConfig != nil {
builder.AddQuery("includeConfig", fmt.Sprint(*importOfferingVersionOptions.IncludeConfig))
}
if importOfferingVersionOptions.IsVsi != nil {
builder.AddQuery("isVSI", fmt.Sprint(*importOfferingVersionOptions.IsVsi))
}
if importOfferingVersionOptions.RepoType != nil {
builder.AddQuery("repoType", fmt.Sprint(*importOfferingVersionOptions.RepoType))
}
Expand Down Expand Up @@ -1409,6 +1422,9 @@ func (catalogManagement *CatalogManagementV1) ImportOfferingWithContext(ctx cont
if importOfferingOptions.IncludeConfig != nil {
builder.AddQuery("includeConfig", fmt.Sprint(*importOfferingOptions.IncludeConfig))
}
if importOfferingOptions.IsVsi != nil {
builder.AddQuery("isVSI", fmt.Sprint(*importOfferingOptions.IsVsi))
}
if importOfferingOptions.RepoType != nil {
builder.AddQuery("repoType", fmt.Sprint(*importOfferingOptions.RepoType))
}
Expand Down Expand Up @@ -1661,6 +1677,9 @@ func (catalogManagement *CatalogManagementV1) ReplaceOfferingWithContext(ctx con
if replaceOfferingOptions.Tags != nil {
body["tags"] = replaceOfferingOptions.Tags
}
if replaceOfferingOptions.Keywords != nil {
body["keywords"] = replaceOfferingOptions.Keywords
}
if replaceOfferingOptions.Rating != nil {
body["rating"] = replaceOfferingOptions.Rating
}
Expand Down Expand Up @@ -3876,6 +3895,9 @@ func (catalogManagement *CatalogManagementV1) SearchObjectsWithContext(ctx conte
if searchObjectsOptions.Collapse != nil {
builder.AddQuery("collapse", fmt.Sprint(*searchObjectsOptions.Collapse))
}
if searchObjectsOptions.Digest != nil {
builder.AddQuery("digest", fmt.Sprint(*searchObjectsOptions.Digest))
}

request, err := builder.Build()
if err != nil {
Expand Down Expand Up @@ -5669,6 +5691,9 @@ type Catalog struct {

// Feature information.
SyndicationSettings *SyndicationResource `json:"syndication_settings,omitempty"`

// Kind of catalog. Supported kinds are offering and vpe.
Kind *string `json:"kind,omitempty"`
}

// UnmarshalCatalog unmarshals an instance of Catalog from the specified map of raw messages.
Expand Down Expand Up @@ -5742,6 +5767,10 @@ func UnmarshalCatalog(m map[string]json.RawMessage, result interface{}) (err err
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "kind", &obj.Kind)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}
Expand Down Expand Up @@ -6170,6 +6199,9 @@ type CreateCatalogOptions struct {
// Feature information.
SyndicationSettings *SyndicationResource

// Kind of catalog. Supported kinds are offering and vpe.
Kind *string

// Allows users to set headers on API requests
Headers map[string]string
}
Expand Down Expand Up @@ -6251,6 +6283,12 @@ func (options *CreateCatalogOptions) SetSyndicationSettings(syndicationSettings
return options
}

// SetKind : Allow user to set Kind
func (options *CreateCatalogOptions) SetKind(kind string) *CreateCatalogOptions {
options.Kind = core.StringPtr(kind)
return options
}

// SetHeaders : Allow user to set Headers
func (options *CreateCatalogOptions) SetHeaders(param map[string]string) *CreateCatalogOptions {
options.Headers = param
Expand Down Expand Up @@ -6773,6 +6811,9 @@ type CreateOfferingOptions struct {
// List of tags associated with this catalog.
Tags []string

// List of keywords associated with offering, typically used to search for it.
Keywords []string

// Repository info for offerings.
Rating *Rating

Expand Down Expand Up @@ -6913,6 +6954,12 @@ func (options *CreateOfferingOptions) SetTags(tags []string) *CreateOfferingOpti
return options
}

// SetKeywords : Allow user to set Keywords
func (options *CreateOfferingOptions) SetKeywords(keywords []string) *CreateOfferingOptions {
options.Keywords = keywords
return options
}

// SetRating : Allow user to set Rating
func (options *CreateOfferingOptions) SetRating(rating *Rating) *CreateOfferingOptions {
options.Rating = rating
Expand Down Expand Up @@ -9251,6 +9298,9 @@ type ImportOfferingOptions struct {
// Add all possible configuration items when creating this version.
IncludeConfig *bool

// Indicates that the current terraform template is used to install a VSI Image.
IsVsi *bool

// The type of repository containing this version. Valid values are 'public_git' or 'enterprise_git'.
RepoType *string

Expand Down Expand Up @@ -9316,6 +9366,12 @@ func (options *ImportOfferingOptions) SetIncludeConfig(includeConfig bool) *Impo
return options
}

// SetIsVsi : Allow user to set IsVsi
func (options *ImportOfferingOptions) SetIsVsi(isVsi bool) *ImportOfferingOptions {
options.IsVsi = core.BoolPtr(isVsi)
return options
}

// SetRepoType : Allow user to set RepoType
func (options *ImportOfferingOptions) SetRepoType(repoType string) *ImportOfferingOptions {
options.RepoType = core.StringPtr(repoType)
Expand Down Expand Up @@ -9360,6 +9416,9 @@ type ImportOfferingVersionOptions struct {
// Add all possible configuration values to this version when importing.
IncludeConfig *bool

// Indicates that the current terraform template is used to install a VSI Image.
IsVsi *bool

// The type of repository containing this version. Valid values are 'public_git' or 'enterprise_git'.
RepoType *string

Expand Down Expand Up @@ -9423,6 +9482,12 @@ func (options *ImportOfferingVersionOptions) SetIncludeConfig(includeConfig bool
return options
}

// SetIsVsi : Allow user to set IsVsi
func (options *ImportOfferingVersionOptions) SetIsVsi(isVsi bool) *ImportOfferingVersionOptions {
options.IsVsi = core.BoolPtr(isVsi)
return options
}

// SetRepoType : Allow user to set RepoType
func (options *ImportOfferingVersionOptions) SetRepoType(repoType string) *ImportOfferingVersionOptions {
options.RepoType = core.StringPtr(repoType)
Expand Down Expand Up @@ -10763,6 +10828,9 @@ type Offering struct {
// List of tags associated with this catalog.
Tags []string `json:"tags,omitempty"`

// List of keywords associated with offering, typically used to search for it.
Keywords []string `json:"keywords,omitempty"`

// Repository info for offerings.
Rating *Rating `json:"rating,omitempty"`

Expand Down Expand Up @@ -10870,6 +10938,10 @@ func UnmarshalOffering(m map[string]json.RawMessage, result interface{}) (err er
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "keywords", &obj.Keywords)
if err != nil {
return
}
err = core.UnmarshalModel(m, "rating", &obj.Rating, UnmarshalRating)
if err != nil {
return
Expand Down Expand Up @@ -11872,6 +11944,9 @@ type ReplaceCatalogOptions struct {
// Feature information.
SyndicationSettings *SyndicationResource

// Kind of catalog. Supported kinds are offering and vpe.
Kind *string

// Allows users to set headers on API requests
Headers map[string]string
}
Expand Down Expand Up @@ -11961,6 +12036,12 @@ func (options *ReplaceCatalogOptions) SetSyndicationSettings(syndicationSettings
return options
}

// SetKind : Allow user to set Kind
func (options *ReplaceCatalogOptions) SetKind(kind string) *ReplaceCatalogOptions {
options.Kind = core.StringPtr(kind)
return options
}

// SetHeaders : Allow user to set Headers
func (options *ReplaceCatalogOptions) SetHeaders(param map[string]string) *ReplaceCatalogOptions {
options.Headers = param
Expand Down Expand Up @@ -12262,6 +12343,9 @@ type ReplaceOfferingOptions struct {
// List of tags associated with this catalog.
Tags []string

// List of keywords associated with offering, typically used to search for it.
Keywords []string

// Repository info for offerings.
Rating *Rating

Expand Down Expand Up @@ -12409,6 +12493,12 @@ func (options *ReplaceOfferingOptions) SetTags(tags []string) *ReplaceOfferingOp
return options
}

// SetKeywords : Allow user to set Keywords
func (options *ReplaceOfferingOptions) SetKeywords(keywords []string) *ReplaceOfferingOptions {
options.Keywords = keywords
return options
}

// SetRating : Allow user to set Rating
func (options *ReplaceOfferingOptions) SetRating(rating *Rating) *ReplaceOfferingOptions {
options.Rating = rating
Expand Down Expand Up @@ -12732,6 +12822,9 @@ type SearchObjectsOptions struct {
// When true, hide private objects that correspond to public or IBM published objects.
Collapse *bool

// Display a digests of search results, has default value of true.
Digest *bool

// Allows users to set headers on API requests
Headers map[string]string
}
Expand Down Expand Up @@ -12767,6 +12860,12 @@ func (options *SearchObjectsOptions) SetCollapse(collapse bool) *SearchObjectsOp
return options
}

// SetDigest : Allow user to set Digest
func (options *SearchObjectsOptions) SetDigest(digest bool) *SearchObjectsOptions {
options.Digest = core.BoolPtr(digest)
return options
}

// SetHeaders : Allow user to set Headers
func (options *SearchObjectsOptions) SetHeaders(param map[string]string) *SearchObjectsOptions {
options.Headers = param
Expand Down
3 changes: 2 additions & 1 deletion catalogmanagementv1/catalog_management_v1_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
package catalogmanagementv1_test

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)

func TestCatalogManagementV1(t *testing.T) {
Expand Down

0 comments on commit 941ece8

Please sign in to comment.