/** * Generated by orval v8.19.0 🍺 * Do not edit manually. * Webitel API * OpenAPI spec version: 24.04.0 */ import axios from '@aliasedDeps/api-services/axios'; import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; import type { WebitelImApiGatewayV1Authorization, WebitelImApiGatewayV1LogoutResponse, WebitelImApiGatewayV1PUSHSubscriptionBody, WebitelImApiGatewayV1RegisterDeviceResponse, WebitelImApiGatewayV1TokenRequest, WebitelImApiGatewayV1UnregisterDeviceResponse, } from '../_models'; // --- header start // export const // --- title start getWebitelImApiGatewayV1Account = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Register device to receive PUSH notifications */ const accountRegisterDevice = ( webitelImApiGatewayV1PUSHSubscriptionBody: WebitelImApiGatewayV1PUSHSubscriptionBody, options?: AxiosRequestConfig, ): Promise< AxiosResponse > => { return axiosInstance.post( `/v1/auth/devices`, webitelImApiGatewayV1PUSHSubscriptionBody, options, ); }; /** * @summary Deletes a device by its token, stops sending PUSH-notifications to it. */ const accountUnregisterDevice = ( webitelImApiGatewayV1PUSHSubscriptionBody: WebitelImApiGatewayV1PUSHSubscriptionBody, options?: AxiosRequestConfig, ): Promise< AxiosResponse > => { return axiosInstance.post( `/v1/auth/devices/unregister`, webitelImApiGatewayV1PUSHSubscriptionBody, options, ); }; /** * @summary Logout Device Request */ const accountLogout = ( options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post(`/v1/auth/logout`, undefined, options); }; /** * @summary Inspect current Authorization credentials */ const accountInspect = ( options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/v1/auth/token`, options); }; /** * @summary // Authorization Request. Part of OAuth flow rpc Auth(AuthRequest) returns (AuthResponse); */ const accountToken = ( webitelImApiGatewayV1TokenRequest: WebitelImApiGatewayV1TokenRequest, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/v1/auth/token`, webitelImApiGatewayV1TokenRequest, options, ); }; // --- footer start return { accountRegisterDevice, accountUnregisterDevice, accountLogout, accountInspect, accountToken, }; }; export type AccountRegisterDeviceResult = AxiosResponse; export type AccountUnregisterDeviceResult = AxiosResponse; export type AccountLogoutResult = AxiosResponse; export type AccountInspectResult = AxiosResponse; export type AccountTokenResult = AxiosResponse; // --- footer end