// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as BusinessPartnersAPI from './business-partners'; import * as WorkersAPI from './workers'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Business partners of the company */ export class BusinessPartnerGroups extends APIResource { /** * A list of business partner groups. * * - Requires: `API Tier 1` * - Expandable fields: `default_business_partner` * - Sortable fields: `id`, `created_at`, `updated_at` */ list( query: BusinessPartnerGroupListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/business-partner-groups/', PageCursorURL, { query, ...options, }); } /** * Create a new business partner group */ create(body: BusinessPartnerGroupCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/business-partner-groups/', { body, ...options }); } /** * Retrieve a specific business partner group */ retrieve( id: string, query: BusinessPartnerGroupRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/business-partner-groups/${id}/`, { query, ...options }); } /** * Delete a business partner group */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/business-partner-groups/${id}/`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } } export type BusinessPartnerGroupsPageCursorURL = PageCursorURL; export interface BusinessPartnerGroup { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Name used to identify business partner group */ name: string; /** * Record update date */ updated_at: string; /** * Optional default business partner worker to whom all employees will be mapped if * not explicitly mapped to a business partner in the group. * * Expandable field */ default_business_partner?: WorkersAPI.Worker; /** * Id of Optional default business partner worker to whom all employees will be * mapped if not explicitly mapped to a business partner in the group. */ default_business_partner_id?: string; /** * Type of business partner group */ domain?: 'HR' | 'IT' | 'FINANCE' | 'RECRUITING' | 'OTHER'; } /** * Meta information for the response. */ export interface BusinessPartnerGroupRetrieveResponse extends BusinessPartnersAPI.Meta, BusinessPartnerGroup {} export interface BusinessPartnerGroupListParams { cursor?: string; expand?: string; order_by?: string; } export interface BusinessPartnerGroupCreateParams { /** * Name used to identify business partner group */ name: string; /** * Id of Optional default business partner worker to whom all employees will be * mapped if not explicitly mapped to a business partner in the group. */ default_business_partner_id?: string; /** * Type of business partner group */ domain?: 'HR' | 'IT' | 'FINANCE' | 'RECRUITING' | 'OTHER'; } export interface BusinessPartnerGroupRetrieveParams { expand?: string; } export declare namespace BusinessPartnerGroups { export { type BusinessPartnerGroup as BusinessPartnerGroup, type BusinessPartnerGroupRetrieveResponse as BusinessPartnerGroupRetrieveResponse, type BusinessPartnerGroupsPageCursorURL as BusinessPartnerGroupsPageCursorURL, type BusinessPartnerGroupListParams as BusinessPartnerGroupListParams, type BusinessPartnerGroupCreateParams as BusinessPartnerGroupCreateParams, type BusinessPartnerGroupRetrieveParams as BusinessPartnerGroupRetrieveParams, }; }