Skip to content

Commit

Permalink
fix(Global Search): remove is_hidden param from search operation (#198)
Browse files Browse the repository at this point in the history
Signed-off-by: francescadecicco <[email protected]>
  • Loading branch information
francescadecicco authored Mar 7, 2023
1 parent dc7ffed commit 51eb297
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
17 changes: 1 addition & 16 deletions global-search/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<GlobalSearchV2.Response<GlobalSearchV2.ScanResult>>}
*/
Expand All @@ -183,7 +180,6 @@ class GlobalSearchV2 extends BaseService {
'isPublic',
'impersonateUser',
'canTag',
'isHidden',
'headers',
];
const _validationErrors = validateParams(_params, _requiredParams, _validParams);
Expand All @@ -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');
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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. */
Expand Down
9 changes: 3 additions & 6 deletions test/unit/global-search.v2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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', () => {
Expand Down Expand Up @@ -131,7 +131,6 @@ describe('GlobalSearchV2', () => {
const isPublic = 'false';
const impersonateUser = 'testString';
const canTag = 'false';
const isHidden = 'false';
const searchParams = {
query,
fields,
Expand All @@ -147,7 +146,6 @@ describe('GlobalSearchV2', () => {
isPublic,
impersonateUser,
canTag,
isHidden,
};

const searchResult = globalSearchService.search(searchParams);
Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit 51eb297

Please sign in to comment.