// 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'; /** * Badge information used with Timeclock Kiosk */ export class KioskBadges extends APIResource { /** * A list of kiosk badges. * * - Requires: `API Tier 2` * - Filterable fields: `badge_id` * - Expandable fields: `worker` * - Sortable fields: `id`, `created_at`, `updated_at` */ list( query: KioskBadgeListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/kiosk-badges/', PageCursorURL, { query, ...options, }); } /** * Create a new kiosk badge */ create(body: KioskBadgeCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/kiosk-badges/', { body, ...options }); } /** * Retrieve a specific kiosk badge */ retrieve( id: string, query: KioskBadgeRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/kiosk-badges/${id}/`, { query, ...options }); } /** * Update a specific kiosk badge. */ update( id: string, body: KioskBadgeUpdateParams, options?: RequestOptions, ): APIPromise { return this._client.patch(path`/kiosk-badges/${id}/`, { body, ...options }); } /** * Delete a kiosk badge */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/kiosk-badges/${id}/`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } } export type KioskBadgeListResponsesPageCursorURL = PageCursorURL; export interface TimeKioskBadge { /** * The ID associated with the badge. Not to be confused with the record's ID. */ badge_id: string; /** * Whether this badge can be used with the Kiosk app. */ is_enabled?: boolean; /** * The ID of the worker associated with the badge. */ worker_id?: string; /** * The employee number of the worker associated with the badge. */ worker_number?: number; } export interface KioskBadgeListResponse { /** * Identifier field */ id: string; /** * The ID associated with the badge. Not to be confused with the record's ID. */ badge_id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Whether this badge can be used with the Kiosk app. */ is_enabled?: boolean; /** * The worker associated with the badge. * * Expandable field */ worker?: WorkersAPI.Worker; /** * The ID of the worker associated with the badge. */ worker_id?: string; /** * The employee number of the worker associated with the badge. */ worker_number?: number; } export interface KioskBadgeCreateResponse { /** * Identifier field */ id: string; /** * The ID associated with the badge. Not to be confused with the record's ID. */ badge_id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Whether this badge can be used with the Kiosk app. */ is_enabled?: boolean; /** * The worker associated with the badge. * * Expandable field */ worker?: WorkersAPI.Worker; /** * The ID of the worker associated with the badge. */ worker_id?: string; /** * The employee number of the worker associated with the badge. */ worker_number?: number; } /** * Meta information for the response. */ export interface KioskBadgeRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Identifier field */ id: string; /** * The ID associated with the badge. Not to be confused with the record's ID. */ badge_id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Whether this badge can be used with the Kiosk app. */ is_enabled?: boolean; /** * The worker associated with the badge. * * Expandable field */ worker?: WorkersAPI.Worker; /** * The ID of the worker associated with the badge. */ worker_id?: string; /** * The employee number of the worker associated with the badge. */ worker_number?: number; } export interface KioskBadgeUpdateResponse { /** * Identifier field */ id: string; /** * The ID associated with the badge. Not to be confused with the record's ID. */ badge_id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Whether this badge can be used with the Kiosk app. */ is_enabled?: boolean; /** * The worker associated with the badge. * * Expandable field */ worker?: WorkersAPI.Worker; /** * The ID of the worker associated with the badge. */ worker_id?: string; /** * The employee number of the worker associated with the badge. */ worker_number?: number; } export interface KioskBadgeListParams { cursor?: string; expand?: string; filter?: string; order_by?: string; } export interface KioskBadgeCreateParams { /** * The ID associated with the badge. Not to be confused with the record's ID. */ badge_id: string; /** * Whether this badge can be used with the Kiosk app. */ is_enabled?: boolean; /** * The ID of the worker associated with the badge. */ worker_id?: string; /** * The employee number of the worker associated with the badge. */ worker_number?: number; } export interface KioskBadgeRetrieveParams { expand?: string; } export interface KioskBadgeUpdateParams { /** * The ID associated with the badge. Not to be confused with the record's ID. */ badge_id: string; /** * Whether this badge can be used with the Kiosk app. */ is_enabled?: boolean; /** * The ID of the worker associated with the badge. */ worker_id?: string; /** * The employee number of the worker associated with the badge. */ worker_number?: number; } export declare namespace KioskBadges { export { type TimeKioskBadge as TimeKioskBadge, type KioskBadgeListResponse as KioskBadgeListResponse, type KioskBadgeCreateResponse as KioskBadgeCreateResponse, type KioskBadgeRetrieveResponse as KioskBadgeRetrieveResponse, type KioskBadgeUpdateResponse as KioskBadgeUpdateResponse, type KioskBadgeListResponsesPageCursorURL as KioskBadgeListResponsesPageCursorURL, type KioskBadgeListParams as KioskBadgeListParams, type KioskBadgeCreateParams as KioskBadgeCreateParams, type KioskBadgeRetrieveParams as KioskBadgeRetrieveParams, type KioskBadgeUpdateParams as KioskBadgeUpdateParams, }; }