import { transformResponse } from './utils.js';
/**
 * Notifications
 * @description Notifications provide automated triggers when specific entitlement balances and usage thresholds are reached, ensuring that your customers and sales teams are always informed. Notify customers and internal teams when specific conditions are met, like reaching 75%, 100%, and 150% of their monthly usage allowance.
 */
export class Notifications {
    client;
    channels;
    rules;
    events;
    constructor(client) {
        this.client = client;
        this.channels = new NotificationChannels(this.client);
        this.rules = new NotificationRules(this.client);
        this.events = new NotificationEvents(this.client);
    }
}
/**
 * Notification Channels
 * @description Notification channels are the destinations for notifications.
 */
export class NotificationChannels {
    client;
    constructor(client) {
        this.client = client;
    }
    /**
     * Create a notification channel
     * @param notification - The notification to create
     * @param signal - An optional abort signal
     * @returns The created notification
     */
    async create(notification, options) {
        const resp = await this.client.POST('/api/v1/notification/channels', {
            body: notification,
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Get a notification channel by ID
     * @param id - The ID of the notification channel
     * @param signal - An optional abort signal
     * @returns The notification channel
     */
    async get(id, options) {
        const resp = await this.client.GET('/api/v1/notification/channels/{channelId}', {
            params: {
                path: {
                    channelId: id,
                },
            },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Update a notification channel
     * @param id - The ID of the notification channel
     * @param notification - The notification to update
     * @param signal - An optional abort signal
     * @returns The updated notification
     */
    async update(id, notification, options) {
        const resp = await this.client.PUT('/api/v1/notification/channels/{channelId}', {
            body: notification,
            params: {
                path: {
                    channelId: id,
                },
            },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * List notification channels
     * @param query - The query parameters
     * @param signal - An optional abort signal
     * @returns The list of notification channels
     */
    async list(query, options) {
        const resp = await this.client.GET('/api/v1/notification/channels', {
            params: {
                query,
            },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Delete a notification channel
     * @param id - The ID of the notification channel
     * @param signal - An optional abort signal
     * @returns The deleted notification
     */
    async delete(id, options) {
        const resp = await this.client.DELETE('/api/v1/notification/channels/{channelId}', {
            params: {
                path: {
                    channelId: id,
                },
            },
            ...options,
        });
        return transformResponse(resp);
    }
}
/**
 * Notification Rules
 * @description Notification rules are the conditions that trigger notifications.
 */
export class NotificationRules {
    client;
    constructor(client) {
        this.client = client;
    }
    /**
     * Create a notification rule
     * @param rule - The rule to create
     * @param signal - An optional abort signal
     * @returns The created rule
     */
    async create(rule, options) {
        const resp = await this.client.POST('/api/v1/notification/rules', {
            body: rule,
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Get a notification rule by ID
     * @param id - The ID of the notification rule
     * @param signal - An optional abort signal
     * @returns The notification rule
     */
    async get(id, options) {
        const resp = await this.client.GET('/api/v1/notification/rules/{ruleId}', {
            params: {
                path: {
                    ruleId: id,
                },
            },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Update a notification rule
     * @param id - The ID of the notification rule
     * @param rule - The rule to update
     * @param signal - An optional abort signal
     * @returns The updated rule
     */
    async update(id, rule, options) {
        const resp = await this.client.PUT('/api/v1/notification/rules/{ruleId}', {
            body: rule,
            params: {
                path: {
                    ruleId: id,
                },
            },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * List notification rules
     * @param query - The query parameters
     * @param signal - An optional abort signal
     * @returns The list of notification rules
     */
    async list(query, options) {
        const resp = await this.client.GET('/api/v1/notification/rules', {
            params: {
                query,
            },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Delete a notification rule
     * @param id - The ID of the notification rule
     * @param signal - An optional abort signal
     * @returns The deleted notification
     */
    async delete(id, options) {
        const resp = await this.client.DELETE('/api/v1/notification/rules/{ruleId}', {
            params: {
                path: {
                    ruleId: id,
                },
            },
            ...options,
        });
        return transformResponse(resp);
    }
}
/**
 * Notification Events
 * @description Notification events are the events that trigger notifications.
 */
export class NotificationEvents {
    client;
    constructor(client) {
        this.client = client;
    }
    /**
     * Get a notification event by ID
     * @param id - The ID of the notification event
     * @param signal - An optional abort signal
     * @returns The notification event
     */
    async get(id, options) {
        const resp = await this.client.GET('/api/v1/notification/events/{eventId}', {
            params: {
                path: {
                    eventId: id,
                },
            },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * List notification events
     * @param query - The query parameters
     * @param signal - An optional abort signal
     * @returns The list of notification events
     */
    async list(query, options) {
        const resp = await this.client.GET('/api/v1/notification/events', {
            params: {
                query,
            },
            ...options,
        });
        return transformResponse(resp);
    }
    /**
     * Resend a notification event
     * @description Resend a notification event that has already been sent.
     * @param id - The ID of the notification event
     * @param channels - The channels to resend the notification event to, if not provided it will resend to all channels
     * @param signal - An optional abort signal
     * @returns The resent notification event
     */
    async resend(id, body = {}, options) {
        const resp = await this.client.POST('/api/v1/notification/events/{eventId}/resend', {
            body,
            params: {
                path: {
                    eventId: id,
                },
            },
            ...options,
        });
        return transformResponse(resp);
    }
}
//# sourceMappingURL=notifications.js.map