From bd581dce0729d66cc405e5446561cf77864ea105 Mon Sep 17 00:00:00 2001 From: Marie Payne <116597610+mpayne-coveo@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:07:56 -0400 Subject: [PATCH] =?UTF-8?q?feat(usageanalytics):=20add=20deleteSnowflakeRe?= =?UTF-8?q?aderAccount=20call=20to=20read=20s=E2=80=A6=20(#848)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat(usageanalytics): add deleteSnowflakeReaderAccount call to read service --- .../UsageAnalytics/Read/Snowflake/Snowflake.ts | 7 +++++++ .../Read/Snowflake/tests/Snowflake.spec.ts | 13 +++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/resources/UsageAnalytics/Read/Snowflake/Snowflake.ts b/src/resources/UsageAnalytics/Read/Snowflake/Snowflake.ts index 422cd2ffc..d2800310f 100644 --- a/src/resources/UsageAnalytics/Read/Snowflake/Snowflake.ts +++ b/src/resources/UsageAnalytics/Read/Snowflake/Snowflake.ts @@ -100,4 +100,11 @@ export default class Snowflake extends ReadServiceResource { createSnowflakeReaderAccount() { return this.api.post(this.buildPathWithOrg(`${Snowflake.baseUrl}/readeraccounts`)); } + + /** + * Delete a reader acocunt. + */ + deleteSnowflakeReaderAccount() { + return this.api.delete(this.buildPathWithOrg(`${Snowflake.baseUrl}/readeraccount`)); + } } diff --git a/src/resources/UsageAnalytics/Read/Snowflake/tests/Snowflake.spec.ts b/src/resources/UsageAnalytics/Read/Snowflake/tests/Snowflake.spec.ts index 0f6db89a6..e9eafd656 100644 --- a/src/resources/UsageAnalytics/Read/Snowflake/tests/Snowflake.spec.ts +++ b/src/resources/UsageAnalytics/Read/Snowflake/tests/Snowflake.spec.ts @@ -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`); + }); + }); });