From 67937e4421759cd009300b3be24fc4f242819e20 Mon Sep 17 00:00:00 2001 From: Francesca De Cicco <55192611+francescadecicco@users.noreply.github.com> Date: Tue, 7 Mar 2023 19:21:26 +0100 Subject: [PATCH] fix(Global Search): remove is_hidden param from search operation (#239) Signed-off-by: francescadecicco --- globalsearchv2/global_search_v2.go | 24 +----------------------- globalsearchv2/global_search_v2_test.go | 10 ---------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/globalsearchv2/global_search_v2.go b/globalsearchv2/global_search_v2.go index d025a888..2782ce74 100644 --- a/globalsearchv2/global_search_v2.go +++ b/globalsearchv2/global_search_v2.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.63.0-5dae26c1-20230111-193039 + * IBM OpenAPI SDK Code Generator Version: 3.67.0-df2073a1-20230222-221157 */ // Package globalsearchv2 : Operations and models for the GlobalSearchV2 service @@ -247,9 +247,6 @@ func (globalSearch *GlobalSearchV2) SearchWithContext(ctx context.Context, searc if searchOptions.CanTag != nil { builder.AddQuery("can_tag", fmt.Sprint(*searchOptions.CanTag)) } - if searchOptions.IsHidden != nil { - builder.AddQuery("is_hidden", fmt.Sprint(*searchOptions.IsHidden)) - } body := make(map[string]interface{}) if searchOptions.Query != nil { @@ -521,10 +518,6 @@ type SearchOptions struct { // only resources that user has permissions for tagging are returned (_for administrators only_). CanTag *string `json:"can_tag,omitempty"` - // Determines if the result set must return only the visible resources or not. If false (default), only visible - // resources are returned; if true, only hidden resources are returned; if any, all resources are returned. - IsHidden *string `json:"is_hidden,omitempty"` - // Allows users to set headers on API requests Headers map[string]string } @@ -575,15 +568,6 @@ const ( SearchOptionsCanTagTrueConst = "true" ) -// Constants associated with the SearchOptions.IsHidden property. -// Determines if the result set must return only the visible resources or not. If false (default), only visible -// resources are returned; if true, only hidden resources are returned; if any, all resources are returned. -const ( - SearchOptionsIsHiddenAnyConst = "any" - SearchOptionsIsHiddenFalseConst = "false" - SearchOptionsIsHiddenTrueConst = "true" -) - // NewSearchOptions : Instantiate SearchOptions func (*GlobalSearchV2) NewSearchOptions() *SearchOptions { return &SearchOptions{} @@ -673,12 +657,6 @@ func (_options *SearchOptions) SetCanTag(canTag string) *SearchOptions { return _options } -// SetIsHidden : Allow user to set IsHidden -func (_options *SearchOptions) SetIsHidden(isHidden string) *SearchOptions { - _options.IsHidden = core.StringPtr(isHidden) - return _options -} - // SetHeaders : Allow user to set Headers func (options *SearchOptions) SetHeaders(param map[string]string) *SearchOptions { options.Headers = param diff --git a/globalsearchv2/global_search_v2_test.go b/globalsearchv2/global_search_v2_test.go index fb5b3abc..9e3cbba7 100644 --- a/globalsearchv2/global_search_v2_test.go +++ b/globalsearchv2/global_search_v2_test.go @@ -184,7 +184,6 @@ var _ = Describe(`GlobalSearchV2`, func() { Expect(req.URL.Query()["is_public"]).To(Equal([]string{"false"})) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["can_tag"]).To(Equal([]string{"false"})) - Expect(req.URL.Query()["is_hidden"]).To(Equal([]string{"false"})) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) @@ -214,7 +213,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.IsPublic = core.StringPtr("false") searchOptionsModel.ImpersonateUser = core.StringPtr("testString") searchOptionsModel.CanTag = core.StringPtr("false") - searchOptionsModel.IsHidden = core.StringPtr("false") searchOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response result, response, operationErr := globalSearchService.Search(searchOptionsModel) @@ -272,7 +270,6 @@ var _ = Describe(`GlobalSearchV2`, func() { Expect(req.URL.Query()["is_public"]).To(Equal([]string{"false"})) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["can_tag"]).To(Equal([]string{"false"})) - Expect(req.URL.Query()["is_hidden"]).To(Equal([]string{"false"})) // Sleep a short time to support a timeout test time.Sleep(100 * time.Millisecond) @@ -307,7 +304,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.IsPublic = core.StringPtr("false") searchOptionsModel.ImpersonateUser = core.StringPtr("testString") searchOptionsModel.CanTag = core.StringPtr("false") - searchOptionsModel.IsHidden = core.StringPtr("false") searchOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -371,7 +367,6 @@ var _ = Describe(`GlobalSearchV2`, func() { Expect(req.URL.Query()["is_public"]).To(Equal([]string{"false"})) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["can_tag"]).To(Equal([]string{"false"})) - Expect(req.URL.Query()["is_hidden"]).To(Equal([]string{"false"})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) @@ -408,7 +403,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.IsPublic = core.StringPtr("false") searchOptionsModel.ImpersonateUser = core.StringPtr("testString") searchOptionsModel.CanTag = core.StringPtr("false") - searchOptionsModel.IsHidden = core.StringPtr("false") searchOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -442,7 +436,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.IsPublic = core.StringPtr("false") searchOptionsModel.ImpersonateUser = core.StringPtr("testString") searchOptionsModel.CanTag = core.StringPtr("false") - searchOptionsModel.IsHidden = core.StringPtr("false") searchOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := globalSearchService.SetServiceURL("") @@ -490,7 +483,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.IsPublic = core.StringPtr("false") searchOptionsModel.ImpersonateUser = core.StringPtr("testString") searchOptionsModel.CanTag = core.StringPtr("false") - searchOptionsModel.IsHidden = core.StringPtr("false") searchOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -736,7 +728,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SetIsPublic("false") searchOptionsModel.SetImpersonateUser("testString") searchOptionsModel.SetCanTag("false") - searchOptionsModel.SetIsHidden("false") searchOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(searchOptionsModel).ToNot(BeNil()) Expect(searchOptionsModel.Query).To(Equal(core.StringPtr("testString"))) @@ -753,7 +744,6 @@ var _ = Describe(`GlobalSearchV2`, func() { Expect(searchOptionsModel.IsPublic).To(Equal(core.StringPtr("false"))) Expect(searchOptionsModel.ImpersonateUser).To(Equal(core.StringPtr("testString"))) Expect(searchOptionsModel.CanTag).To(Equal(core.StringPtr("false"))) - Expect(searchOptionsModel.IsHidden).To(Equal(core.StringPtr("false"))) Expect(searchOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) })