Skip to content

Commit bd581dc

Browse files
authored
feat(usageanalytics): add deleteSnowflakeReaderAccount call to read s… (#848)
feat(usageanalytics): add deleteSnowflakeReaderAccount call to read service
1 parent b972109 commit bd581dc

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/resources/UsageAnalytics/Read/Snowflake/Snowflake.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,11 @@ export default class Snowflake extends ReadServiceResource {
100100
createSnowflakeReaderAccount() {
101101
return this.api.post<void>(this.buildPathWithOrg(`${Snowflake.baseUrl}/readeraccounts`));
102102
}
103+
104+
/**
105+
* Delete a reader acocunt.
106+
*/
107+
deleteSnowflakeReaderAccount() {
108+
return this.api.delete<void>(this.buildPathWithOrg(`${Snowflake.baseUrl}/readeraccount`));
109+
}
103110
}

src/resources/UsageAnalytics/Read/Snowflake/tests/Snowflake.spec.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,21 @@ describe('Snowflake', () => {
122122
});
123123
});
124124

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

129129
expect(api.post).toHaveBeenCalledTimes(1);
130130
expect(api.post).toHaveBeenCalledWith(`${Snowflake.baseUrl}/readeraccounts`);
131131
});
132132
});
133+
134+
describe('deleteSnowflakeReaderAccount', () => {
135+
it('makes a DELETE call to the specific Snowflake url', () => {
136+
snowflake.deleteSnowflakeReaderAccount();
137+
138+
expect(api.delete).toHaveBeenCalledTimes(1);
139+
expect(api.delete).toHaveBeenCalledWith(`${Snowflake.baseUrl}/readeraccount`);
140+
});
141+
});
133142
});

0 commit comments

Comments
 (0)