// 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 1` * - Filterable fields: `badge_id` * - Expandable fields: `worker` * - Sortable fields: `id`, `created_at`, `updated_at` * * @example HTTP * Representative request and response shapes. * ``` * GET /kiosk-badges/?filter=filter&expand=expand&order_by=order_by&limit=50&cursor=cursor HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * { * "name": "date_of_birth", * "reason": "Insufficient entitlements" * } * ] * }, * "results": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "badge_id": "string", * "worker": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "user_id": "string", * "user": {}, * "is_manager": "string", * "manager_id": "string", * "manager": {}, * "legal_entity_id": "string", * "legal_entity": {}, * "country": "AF", * "start_date": "string", * "end_date": "string", * "number": "string", * "work_email": "string", * "personal_email": "string", * "status": "INIT", * "location": {}, * "employment_type_id": "string", * "employment_type": {}, * "gender": "MALE", * "date_of_birth": "string", * "race": "BLACK", * "ethnicity": "HISPANIC_OR_LATINO", * "citizenship": "AF", * "compensation_id": "string", * "compensation": {}, * "overtime_exemption": "EXEMPT", * "department_id": "string", * "department": {}, * "teams_id": [], * "teams": [], * "title": "string", * "title_effective_date": "string", * "level_id": "string", * "level": {}, * "job_function_id": "string", * "job_function": {}, * "termination_details": {}, * "pay_schedule_id": "string", * "work_schedule": {}, * "compensation_grade": {}, * "original_start_date": "string", * "custom_fields": [], * "country_fields": {}, * "business_partners_id": [], * "business_partners": [] * }, * "worker_id": "string", * "worker_number": 0, * "is_enabled": false * } * ], * "next_link": "string" * } * ``` */ list( query: KioskBadgeListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/kiosk-badges/', PageCursorURL, { query, ...options, }); } /** * Create a new kiosk badge * * @example HTTP * Representative request and response shapes. * ``` * POST /kiosk-badges/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "badge_id": "badge_id" * } * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "badge_id": "string", * "worker": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "user_id": "string", * "user": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "is_manager": false, * "manager_id": "string", * "manager": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "legal_entity_id": "string", * "legal_entity": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "country": "AF", * "start_date": "string", * "end_date": "string", * "number": 0, * "work_email": "string", * "personal_email": "string", * "status": "INIT", * "location": { * "type": "REMOTE", * "work_location_id": "string" * }, * "employment_type_id": "string", * "employment_type": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "label": "string" * }, * "gender": "MALE", * "date_of_birth": "string", * "race": "BLACK", * "ethnicity": "HISPANIC_OR_LATINO", * "citizenship": "AF", * "compensation_id": "string", * "compensation": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "overtime_exemption": "EXEMPT", * "department_id": "string", * "department": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "parent_id": "string" * }, * "teams_id": [ * "string" * ], * "teams": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "parent_id": "string", * "parent": {}, * "name": "string" * } * ], * "title": "string", * "title_effective_date": "string", * "level_id": "string", * "level": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "parent_id": "string", * "parent": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "parent_id": "string", * "parent": {}, * "global_level": "string", * "description": "string", * "scope_of_responsibilities": "string", * "experience_requirements": "string", * "rank": "string", * "track_id": "string", * "track": {} * }, * "global_level": 0, * "description": "string", * "scope_of_responsibilities": "string", * "experience_requirements": "string", * "rank": 0, * "track_id": "string", * "track": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "is_default": "string", * "order": "string", * "start_global_level": "string" * } * }, * "job_function_id": "string", * "job_function": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string" * }, * "termination_details": { * "type": "VOLUNTARY", * "reason": "string" * }, * "pay_schedule_id": "string", * "work_schedule": {}, * "compensation_grade": { * "id": "string", * "label": "string" * }, * "original_start_date": "string", * "custom_fields": [ * null * ], * "country_fields": { * "us": { * "ssn": "string" * }, * "ca": { * "sin": "string" * }, * "nz": { * "ird_number": "string" * } * }, * "business_partners_id": [ * "string" * ], * "business_partners": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "business_partner_group_id": "string", * "business_partner_group": {}, * "worker_id": "string", * "worker": {}, * "client_group_id": "string", * "client_group": {}, * "client_group_member_count": "string" * } * ] * }, * "worker_id": "string", * "worker_number": 0, * "is_enabled": false * } * ``` */ create(body: KioskBadgeCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/kiosk-badges/', { body, ...options }); } /** * Retrieve a specific kiosk badge * * @example HTTP * Representative request and response shapes. * ``` * GET /kiosk-badges/{id}/?expand=expand HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * {} * ] * } * } * ``` */ 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. * * @example HTTP * Representative request and response shapes. * ``` * PATCH /kiosk-badges/{id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * {} * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "badge_id": "string", * "worker": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "user_id": "string", * "user": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "is_manager": false, * "manager_id": "string", * "manager": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "legal_entity_id": "string", * "legal_entity": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "country": "AF", * "start_date": "string", * "end_date": "string", * "number": 0, * "work_email": "string", * "personal_email": "string", * "status": "INIT", * "location": { * "type": "REMOTE", * "work_location_id": "string" * }, * "employment_type_id": "string", * "employment_type": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "label": "string" * }, * "gender": "MALE", * "date_of_birth": "string", * "race": "BLACK", * "ethnicity": "HISPANIC_OR_LATINO", * "citizenship": "AF", * "compensation_id": "string", * "compensation": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "overtime_exemption": "EXEMPT", * "department_id": "string", * "department": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "parent_id": "string" * }, * "teams_id": [ * "string" * ], * "teams": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "parent_id": "string", * "parent": {}, * "name": "string" * } * ], * "title": "string", * "title_effective_date": "string", * "level_id": "string", * "level": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "parent_id": "string", * "parent": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "parent_id": "string", * "parent": {}, * "global_level": "string", * "description": "string", * "scope_of_responsibilities": "string", * "experience_requirements": "string", * "rank": "string", * "track_id": "string", * "track": {} * }, * "global_level": 0, * "description": "string", * "scope_of_responsibilities": "string", * "experience_requirements": "string", * "rank": 0, * "track_id": "string", * "track": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "is_default": "string", * "order": "string", * "start_global_level": "string" * } * }, * "job_function_id": "string", * "job_function": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string" * }, * "termination_details": { * "type": "VOLUNTARY", * "reason": "string" * }, * "pay_schedule_id": "string", * "work_schedule": {}, * "compensation_grade": { * "id": "string", * "label": "string" * }, * "original_start_date": "string", * "custom_fields": [ * null * ], * "country_fields": { * "us": { * "ssn": "string" * }, * "ca": { * "sin": "string" * }, * "nz": { * "ird_number": "string" * } * }, * "business_partners_id": [ * "string" * ], * "business_partners": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "business_partner_group_id": "string", * "business_partner_group": {}, * "worker_id": "string", * "worker": {}, * "client_group_id": "string", * "client_group": {}, * "client_group_member_count": "string" * } * ] * }, * "worker_id": "string", * "worker_number": 0, * "is_enabled": false * } * ``` */ update( id: string, body: KioskBadgeUpdateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.patch(path`/kiosk-badges/${id}/`, { body, ...options }); } /** * Delete a kiosk badge * * @example HTTP * Representative request and response shapes. * ``` * DELETE /kiosk-badges/{id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 204 No Content * ``` */ 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; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; 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, }; }