/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { notificationsGetCompanyNotifications } from "../funcs/notificationsGetCompanyNotifications.js"; import { notificationsGetDetails } from "../funcs/notificationsGetDetails.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { GetCompanyNotificationsRequest, GetCompanyNotificationsResponse, } from "../models/operations/getcompanynotifications.js"; import { GetNotificationsNotificationUuidRequest, GetNotificationsNotificationUuidResponse, } from "../models/operations/getnotificationsnotificationuuid.js"; import { unwrapAsync } from "../types/fp.js"; export class Notifications extends ClientSDK { /** * Get a notification's details * * @remarks * Upon receiving a notification webhook event, use this endpoint to fetch the notification's details. The notification details include basic suggested content that can help you build notifications in your platform. * * Note: partners are responsible for the delivery and any custom state management of notifications in their application. Refer to our [partner notification guide](https://docs.gusto.com/embedded-payroll/docs/partner-notifications) for more details. * * If the notification UUID is not found, the response will be 404 Not Found. If the notification's supporting data is no longer valid, the response will be 422 Unprocessable Entity. * * scope: `notifications:read` */ async getDetails( request: GetNotificationsNotificationUuidRequest, options?: RequestOptions, ): Promise { return unwrapAsync(notificationsGetDetails( this, request, options, )); } /** * Get notifications for company * * @remarks * Returns all notifications relevant for the given company. * * scope: `notifications:read` */ async getCompanyNotifications( request: GetCompanyNotificationsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(notificationsGetCompanyNotifications( this, request, options, )); } }