From 31686b7b226fe9f95e4d2d49187f832b7eda5855 Mon Sep 17 00:00:00 2001 From: Alexandre Perron Date: Tue, 1 Oct 2024 17:29:43 -0400 Subject: [PATCH 1/3] fix(UA-9417): make daysToExpiry param optional + add response model --- src/resources/UsageAnalytics/Read/Snowflake/Snowflake.ts | 3 ++- .../UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/resources/UsageAnalytics/Read/Snowflake/Snowflake.ts b/src/resources/UsageAnalytics/Read/Snowflake/Snowflake.ts index 8a700c9b4..1aca1d582 100644 --- a/src/resources/UsageAnalytics/Read/Snowflake/Snowflake.ts +++ b/src/resources/UsageAnalytics/Read/Snowflake/Snowflake.ts @@ -1,6 +1,7 @@ import ReadServiceResource from '../ReadServiceResource.js'; import { GetCreditUsageParams, + ReactivateUserModel, ReactivateUserParams, SnowflakeCreditUsageModel, SnowflakeNetworkPolicyModel, @@ -63,7 +64,7 @@ export default class Snowflake extends ReadServiceResource { * @param params The number of days until the user's expiration date. */ reactivateUser(snowflakeUser: string, params: ReactivateUserParams) { - return this.api.put( + return this.api.put( this.buildPathWithOrg(`${Snowflake.baseUrl}/users/${snowflakeUser}/expiration`), params, ); diff --git a/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts b/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts index 332d77a12..599574652 100644 --- a/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts +++ b/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts @@ -22,7 +22,13 @@ export interface SnowflakeUserModel { } export interface ReactivateUserParams { - daysToExpiry: number; + daysToExpiry?: number; +} + +export interface ReactivateUserModel { + name: string; + email: string; + daysToExpiry?: number; } export interface SnowflakeNetworkPolicyModel { From aad460b67e7434a97f47ed12fdded2706e749b0d Mon Sep 17 00:00:00 2001 From: Alexandre Perron Date: Wed, 2 Oct 2024 08:25:24 -0400 Subject: [PATCH 2/3] Update src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts Co-authored-by: Ruben Philippen --- .../UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts b/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts index 599574652..955469099 100644 --- a/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts +++ b/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts @@ -28,7 +28,7 @@ export interface ReactivateUserParams { export interface ReactivateUserModel { name: string; email: string; - daysToExpiry?: number; + daysToExpiry?: number | null; } export interface SnowflakeNetworkPolicyModel { From 752e16e95975ead62c68922fcfb78fc5654f43ad Mon Sep 17 00:00:00 2001 From: Alexandre Perron Date: Fri, 4 Oct 2024 11:12:55 -0400 Subject: [PATCH 3/3] fix(UA-9417): add tsdocs + fix signature of daysToExpiry --- .../Read/Snowflake/SnowflakeInterfaces.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts b/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts index 955469099..0ebc024fb 100644 --- a/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts +++ b/src/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.ts @@ -18,16 +18,30 @@ export interface SnowflakeUserModel { * The number of days that the user has access to the reader account. * Ranging from 0 (indefinitely) to 90 days. */ - daysToExpiry?: number; + daysToExpiry?: number | null; } export interface ReactivateUserParams { - daysToExpiry?: number; + /** + * The number of days that the user has access to the reader account. + * Ranging from 0 (indefinitely) to 90 days. + */ + daysToExpiry?: number | null; } export interface ReactivateUserModel { + /** + * The username of the user. + */ name: string; + /** + * The email of the user. + */ email: string; + /** + * The number of days that the user has access to the reader account. + * Ranging from 0 (indefinitely) to 90 days. + */ daysToExpiry?: number | null; }