From 51eb2974f21e9b813bf322b0782a800d14ef02a4 Mon Sep 17 00:00:00 2001 From: Francesca De Cicco <55192611+francescadecicco@users.noreply.github.com> Date: Tue, 7 Mar 2023 19:22:19 +0100 Subject: [PATCH] fix(Global Search): remove is_hidden param from search operation (#198) Signed-off-by: francescadecicco --- global-search/v2.ts | 17 +---------------- test/unit/global-search.v2.test.js | 9 +++------ 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/global-search/v2.ts b/global-search/v2.ts index 95d3b24b..1e52c08b 100644 --- a/global-search/v2.ts +++ b/global-search/v2.ts @@ -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 */ import * as extend from 'extend'; @@ -157,9 +157,6 @@ class GlobalSearchV2 extends BaseService { * the resources that the user can view (only a GhoST admin can use this parameter). If false (default), only * resources user can view are returned; if true, only resources that user has permissions for tagging are returned * (_for administrators only_). - * @param {string} [params.isHidden] - 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. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -183,7 +180,6 @@ class GlobalSearchV2 extends BaseService { 'isPublic', 'impersonateUser', 'canTag', - 'isHidden', 'headers', ]; const _validationErrors = validateParams(_params, _requiredParams, _validParams); @@ -208,7 +204,6 @@ class GlobalSearchV2 extends BaseService { 'is_public': _params.isPublic, 'impersonate_user': _params.impersonateUser, 'can_tag': _params.canTag, - 'is_hidden': _params.isHidden, }; const sdkHeaders = getSdkHeaders(GlobalSearchV2.DEFAULT_SERVICE_NAME, 'v2', 'search'); @@ -371,10 +366,6 @@ namespace GlobalSearchV2 { * only_). */ canTag?: SearchConstants.CanTag | string; - /** 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?: SearchConstants.IsHidden | string; headers?: OutgoingHttpHeaders; } @@ -408,12 +399,6 @@ namespace GlobalSearchV2 { TRUE = 'true', FALSE = 'false', } - /** 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. */ - export enum IsHidden { - TRUE = 'true', - FALSE = 'false', - ANY = 'any', - } } /** Parameters for the `getSupportedTypes` operation. */ diff --git a/test/unit/global-search.v2.test.js b/test/unit/global-search.v2.test.js index 74901138..e14d7304 100644 --- a/test/unit/global-search.v2.test.js +++ b/test/unit/global-search.v2.test.js @@ -15,9 +15,9 @@ */ // need to import the whole package to mock getAuthenticatorFromEnvironment -const core = require('ibm-cloud-sdk-core'); +const sdkCorePackage = require('ibm-cloud-sdk-core'); -const { NoAuthAuthenticator, unitTestUtils } = core; +const { NoAuthAuthenticator, unitTestUtils } = sdkCorePackage; const GlobalSearchV2 = require('../../dist/global-search/v2'); @@ -46,7 +46,7 @@ function mock_createRequest() { } // dont actually construct an authenticator -const getAuthenticatorMock = jest.spyOn(core, 'getAuthenticatorFromEnvironment'); +const getAuthenticatorMock = jest.spyOn(sdkCorePackage, 'getAuthenticatorFromEnvironment'); getAuthenticatorMock.mockImplementation(() => new NoAuthAuthenticator()); describe('GlobalSearchV2', () => { @@ -131,7 +131,6 @@ describe('GlobalSearchV2', () => { const isPublic = 'false'; const impersonateUser = 'testString'; const canTag = 'false'; - const isHidden = 'false'; const searchParams = { query, fields, @@ -147,7 +146,6 @@ describe('GlobalSearchV2', () => { isPublic, impersonateUser, canTag, - isHidden, }; const searchResult = globalSearchService.search(searchParams); @@ -178,7 +176,6 @@ describe('GlobalSearchV2', () => { expect(mockRequestOptions.qs.is_public).toEqual(isPublic); expect(mockRequestOptions.qs.impersonate_user).toEqual(impersonateUser); expect(mockRequestOptions.qs.can_tag).toEqual(canTag); - expect(mockRequestOptions.qs.is_hidden).toEqual(isHidden); } test('should pass the right params to createRequest with enable and disable retries', () => {