// Copyright © 2022-2026 Partium, Inc. DBA Partium import { Observable } from 'rxjs'; import { GetOrganizationByIdRequest } from './models/get-organization-by-id-request'; import { GetOrganizationByNameRequest } from './models/get-organization-by-name-request'; import { GetOrganizationsRequest } from './models/get-organizations-request'; import { Organization, OrganizationListItem } from './models/organization'; import { DefaultGetPaginatedRequestPaginationContext } from '../../models/default-get-paginated-request-pagination-context'; import { BaseService } from '../base.service'; export type OrganizationsResponse = { organizations: OrganizationListItem[]; paginationContext: DefaultGetPaginatedRequestPaginationContext; }; /** * Service for loading Organizations. */ export interface OrganizationService { /** * Load the first page of organizations. * * @param request - The request containing the parent organization name and other parameters. * @returns An Observable that emits the first page of organizations with pagination context. */ loadOrganizations(request: GetOrganizationsRequest): Observable; /** * Load the next page of organizations. * * @param paginationContext - The pagination context from the most recent call. * @returns An Observable that emits the next page of organizations with pagination context. */ loadMoreOrganizations(paginationContext: DefaultGetPaginatedRequestPaginationContext): Observable; /** * Check if there are more results available to load based on the current pagination context. * * @param paginationContext - The pagination context from the most recent call. * @returns True if there are more results available to load, false otherwise. */ hasMoreOrganizationsAvailable(paginationContext: DefaultGetPaginatedRequestPaginationContext): boolean; /** * Fetch the detail info of an organization by partium-id. * * @param request - The request containing partium-id of the organization to fetch. * @returns An Observable that emits the detail info of the organization. * Throws SDK_ERROR_CODES.ORGANIZATION_NOT_FOUND if no organization is found. */ getOrganizationById(request: GetOrganizationByIdRequest): Observable; /** * Fetch the detail info of an organization by name. * * @param request - The request containing name of the organization to fetch. * @returns An Observable that emits the detail info of the organization. * Throws SDK_ERROR_CODES.ORGANIZATION_NOT_FOUND if no organization is found. */ getOrganizationByName(request: GetOrganizationByNameRequest): Observable; /** * Fetch the detail info of the first organization of the organization that the logged-in user is associated with, which does not need * additional authentication. * Throws SDK_ERROR_CODES.ORGANIZATION_NOT_FOUND if no organization is found. * * @returns An Observable that emits the detail info of the first organization. */ getFirstOrganization(): Observable; } export declare class OrganizationServiceImpl extends BaseService implements OrganizationService { private httpsService; onCreate(): void; loadOrganizations(request: GetOrganizationsRequest): Observable; loadMoreOrganizations(paginationContext: DefaultGetPaginatedRequestPaginationContext): Observable; hasMoreOrganizationsAvailable(paginationContext: DefaultGetPaginatedRequestPaginationContext): boolean; getOrganizationById(request: GetOrganizationByIdRequest): Observable; getOrganizationByName(request: GetOrganizationByNameRequest): Observable; /** * Gets the first organization of the organizations that the logged-in user is associated with, which does not need * additional authentication. * Since the get organizations endpoint is paginated and we don't want to risk loading all assigned organizations in a loop, because we don't know how many it may be, * this method is only considering the first 100 organizations. If each of them requires additional authentication, the first of them will be returned, even though * on a later page, there might be an organization without additional authentication. */ getFirstOrganization(): Observable; private fetchOrganizationsPage; private mapNotFound; }