Skip to content

Commit

Permalink
feat(usageanalytics): add deleteSnowflakeReaderAccount call to read s… (
Browse files Browse the repository at this point in the history
#848)

feat(usageanalytics): add deleteSnowflakeReaderAccount call to read service
  • Loading branch information
mpayne-coveo authored Aug 19, 2024
1 parent b972109 commit bd581dc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/resources/UsageAnalytics/Read/Snowflake/Snowflake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,11 @@ export default class Snowflake extends ReadServiceResource {
createSnowflakeReaderAccount() {
return this.api.post<void>(this.buildPathWithOrg(`${Snowflake.baseUrl}/readeraccounts`));
}

/**
* Delete a reader acocunt.
*/
deleteSnowflakeReaderAccount() {
return this.api.delete<void>(this.buildPathWithOrg(`${Snowflake.baseUrl}/readeraccount`));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,21 @@ describe('Snowflake', () => {
});
});

describe('putSnowflakeReaderAccount', () => {
it('makes a PUT call to the specific Snowflake url', () => {
describe('createSnowflakeReaderAccount', () => {
it('makes a POST call to the specific Snowflake url', () => {
snowflake.createSnowflakeReaderAccount();

expect(api.post).toHaveBeenCalledTimes(1);
expect(api.post).toHaveBeenCalledWith(`${Snowflake.baseUrl}/readeraccounts`);
});
});

describe('deleteSnowflakeReaderAccount', () => {
it('makes a DELETE call to the specific Snowflake url', () => {
snowflake.deleteSnowflakeReaderAccount();

expect(api.delete).toHaveBeenCalledTimes(1);
expect(api.delete).toHaveBeenCalledWith(`${Snowflake.baseUrl}/readeraccount`);
});
});
});

0 comments on commit bd581dc

Please sign in to comment.