Skip to content

Commit

Permalink
feat(Catalog Management): re-gen service after recent API changes (#249)
Browse files Browse the repository at this point in the history
Signed-off-by: James Dubee <[email protected]>
  • Loading branch information
dubee authored Apr 27, 2023
1 parent c3088f8 commit 3b5367b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
14 changes: 13 additions & 1 deletion 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: 3.68.2-ac7def68-20230310-195410
* IBM OpenAPI SDK Code Generator Version: 3.70.0-7df966bf-20230419-195904
*/

// Package catalogmanagementv1 : Operations and models for the CatalogManagementV1 service
Expand Down Expand Up @@ -2987,6 +2987,9 @@ func (catalogManagement *CatalogManagementV1) GetOfferingSourceWithContext(ctx c
if getOfferingSourceOptions.Channel != nil {
builder.AddQuery("channel", fmt.Sprint(*getOfferingSourceOptions.Channel))
}
if getOfferingSourceOptions.Flavor != nil {
builder.AddQuery("flavor", fmt.Sprint(*getOfferingSourceOptions.Flavor))
}
if getOfferingSourceOptions.AsIs != nil {
builder.AddQuery("asIs", fmt.Sprint(*getOfferingSourceOptions.AsIs))
}
Expand Down Expand Up @@ -11683,6 +11686,9 @@ type GetOfferingSourceOptions struct {
// The channel value of the specified version.
Channel *string `json:"channel,omitempty"`

// The programmatic flavor name of the specified version.
Flavor *string `json:"flavor,omitempty"`

// If false (the default), the root folder from the original onboarded tgz file is removed. If true, the root folder
// is returned.
AsIs *bool `json:"asIs,omitempty"`
Expand Down Expand Up @@ -11740,6 +11746,12 @@ func (_options *GetOfferingSourceOptions) SetChannel(channel string) *GetOfferin
return _options
}

// SetFlavor : Allow user to set Flavor
func (_options *GetOfferingSourceOptions) SetFlavor(flavor string) *GetOfferingSourceOptions {
_options.Flavor = core.StringPtr(flavor)
return _options
}

// SetAsIs : Allow user to set AsIs
func (_options *GetOfferingSourceOptions) SetAsIs(asIs bool) *GetOfferingSourceOptions {
_options.AsIs = core.BoolPtr(asIs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2099,6 +2099,7 @@ var _ = Describe(`CatalogManagementV1 Integration Tests`, func() {
ID: core.StringPtr("testString"),
Kind: core.StringPtr("testString"),
Channel: core.StringPtr("testString"),
Flavor: core.StringPtr("testString"),
}

result, response, err := catalogManagementService.GetOfferingSource(getOfferingSourceOptions)
Expand Down
8 changes: 8 additions & 0 deletions catalogmanagementv1/catalog_management_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14570,6 +14570,7 @@ var _ = Describe(`CatalogManagementV1`, func() {
Expect(req.URL.Query()["id"]).To(Equal([]string{"testString"}))
Expect(req.URL.Query()["kind"]).To(Equal([]string{"testString"}))
Expect(req.URL.Query()["channel"]).To(Equal([]string{"testString"}))
Expect(req.URL.Query()["flavor"]).To(Equal([]string{"testString"}))
// TODO: Add check for asIs query parameter
// Sleep a short time to support a timeout test
time.Sleep(100 * time.Millisecond)
Expand Down Expand Up @@ -14598,6 +14599,7 @@ var _ = Describe(`CatalogManagementV1`, func() {
getOfferingSourceOptionsModel.ID = core.StringPtr("testString")
getOfferingSourceOptionsModel.Kind = core.StringPtr("testString")
getOfferingSourceOptionsModel.Channel = core.StringPtr("testString")
getOfferingSourceOptionsModel.Flavor = core.StringPtr("testString")
getOfferingSourceOptionsModel.AsIs = core.BoolPtr(true)
getOfferingSourceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

Expand Down Expand Up @@ -14643,6 +14645,7 @@ var _ = Describe(`CatalogManagementV1`, func() {
Expect(req.URL.Query()["id"]).To(Equal([]string{"testString"}))
Expect(req.URL.Query()["kind"]).To(Equal([]string{"testString"}))
Expect(req.URL.Query()["channel"]).To(Equal([]string{"testString"}))
Expect(req.URL.Query()["flavor"]).To(Equal([]string{"testString"}))
// TODO: Add check for asIs query parameter
// Set mock response
res.Header().Set("Content-type", "application/yaml")
Expand Down Expand Up @@ -14673,6 +14676,7 @@ var _ = Describe(`CatalogManagementV1`, func() {
getOfferingSourceOptionsModel.ID = core.StringPtr("testString")
getOfferingSourceOptionsModel.Kind = core.StringPtr("testString")
getOfferingSourceOptionsModel.Channel = core.StringPtr("testString")
getOfferingSourceOptionsModel.Flavor = core.StringPtr("testString")
getOfferingSourceOptionsModel.AsIs = core.BoolPtr(true)
getOfferingSourceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

Expand Down Expand Up @@ -14700,6 +14704,7 @@ var _ = Describe(`CatalogManagementV1`, func() {
getOfferingSourceOptionsModel.ID = core.StringPtr("testString")
getOfferingSourceOptionsModel.Kind = core.StringPtr("testString")
getOfferingSourceOptionsModel.Channel = core.StringPtr("testString")
getOfferingSourceOptionsModel.Flavor = core.StringPtr("testString")
getOfferingSourceOptionsModel.AsIs = core.BoolPtr(true)
getOfferingSourceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
// Invoke operation with empty URL (negative test)
Expand Down Expand Up @@ -14748,6 +14753,7 @@ var _ = Describe(`CatalogManagementV1`, func() {
getOfferingSourceOptionsModel.ID = core.StringPtr("testString")
getOfferingSourceOptionsModel.Kind = core.StringPtr("testString")
getOfferingSourceOptionsModel.Channel = core.StringPtr("testString")
getOfferingSourceOptionsModel.Flavor = core.StringPtr("testString")
getOfferingSourceOptionsModel.AsIs = core.BoolPtr(true)
getOfferingSourceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

Expand Down Expand Up @@ -26990,6 +26996,7 @@ var _ = Describe(`CatalogManagementV1`, func() {
getOfferingSourceOptionsModel.SetID("testString")
getOfferingSourceOptionsModel.SetKind("testString")
getOfferingSourceOptionsModel.SetChannel("testString")
getOfferingSourceOptionsModel.SetFlavor("testString")
getOfferingSourceOptionsModel.SetAsIs(true)
getOfferingSourceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
Expect(getOfferingSourceOptionsModel).ToNot(BeNil())
Expand All @@ -27000,6 +27007,7 @@ var _ = Describe(`CatalogManagementV1`, func() {
Expect(getOfferingSourceOptionsModel.ID).To(Equal(core.StringPtr("testString")))
Expect(getOfferingSourceOptionsModel.Kind).To(Equal(core.StringPtr("testString")))
Expect(getOfferingSourceOptionsModel.Channel).To(Equal(core.StringPtr("testString")))
Expect(getOfferingSourceOptionsModel.Flavor).To(Equal(core.StringPtr("testString")))
Expect(getOfferingSourceOptionsModel.AsIs).To(Equal(core.BoolPtr(true)))
Expect(getOfferingSourceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
})
Expand Down

0 comments on commit 3b5367b

Please sign in to comment.