// 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'; /** * Shift inputs used by the company */ export class ShiftInputs extends APIResource { /** * A list of shift inputs. * * - Requires: `API Tier 2` * - Filterable fields: `name` * - Expandable fields: `creator` * - Sortable fields: `id`, `created_at`, `updated_at` */ list( query: ShiftInputListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/shift-inputs/', PageCursorURL, { query, ...options, }); } /** * Create a new shift input */ create(body: ShiftInputCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/shift-inputs/', { body, ...options }); } /** * Retrieve a specific shift input */ retrieve( id: string, query: ShiftInputRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/shift-inputs/${id}/`, { query, ...options }); } /** * Update a specific shift input. */ update( id: string, body: ShiftInputUpdateParams, options?: RequestOptions, ): APIPromise { return this._client.patch(path`/shift-inputs/${id}/`, { body, ...options }); } /** * Delete a shift input */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/shift-inputs/${id}/`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } } export type ShiftInputListResponsesPageCursorURL = PageCursorURL; export interface ShiftInput { /** * Two letter string designating country code which the shift input is associated. */ country_code: string; /** * Name of the shift unit. */ name: string; /** * Prompt for the shift unit. */ prompt: string; /** * Type of shift unit. */ type: string; /** * The creator id associated with the shift input. */ creator_id?: string; } export interface ShiftInputListResponse { /** * Identifier field */ id: string; /** * Two letter string designating country code which the shift input is associated. */ country_code: string; /** * Record creation date */ created_at: string; /** * Name of the shift unit. */ name: string; /** * Prompt for the shift unit. */ prompt: string; /** * Type of shift unit. */ type: string; /** * Record update date */ updated_at: string; /** * The creator associated with the shift input. * * Expandable field */ creator?: WorkersAPI.Worker; /** * The creator id associated with the shift input. */ creator_id?: string; /** * The party that manages this shift input */ managed_by?: string; } export interface ShiftInputCreateResponse { /** * Identifier field */ id: string; /** * Two letter string designating country code which the shift input is associated. */ country_code: string; /** * Record creation date */ created_at: string; /** * Name of the shift unit. */ name: string; /** * Prompt for the shift unit. */ prompt: string; /** * Type of shift unit. */ type: string; /** * Record update date */ updated_at: string; /** * The creator associated with the shift input. * * Expandable field */ creator?: WorkersAPI.Worker; /** * The creator id associated with the shift input. */ creator_id?: string; /** * The party that manages this shift input */ managed_by?: string; } /** * Meta information for the response. */ export interface ShiftInputRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Identifier field */ id: string; /** * Two letter string designating country code which the shift input is associated. */ country_code: string; /** * Record creation date */ created_at: string; /** * Name of the shift unit. */ name: string; /** * Prompt for the shift unit. */ prompt: string; /** * Type of shift unit. */ type: string; /** * Record update date */ updated_at: string; /** * The creator associated with the shift input. * * Expandable field */ creator?: WorkersAPI.Worker; /** * The creator id associated with the shift input. */ creator_id?: string; /** * The party that manages this shift input */ managed_by?: string; } export interface ShiftInputUpdateResponse { /** * Identifier field */ id: string; /** * Two letter string designating country code which the shift input is associated. */ country_code: string; /** * Record creation date */ created_at: string; /** * Name of the shift unit. */ name: string; /** * Prompt for the shift unit. */ prompt: string; /** * Type of shift unit. */ type: string; /** * Record update date */ updated_at: string; /** * The creator associated with the shift input. * * Expandable field */ creator?: WorkersAPI.Worker; /** * The creator id associated with the shift input. */ creator_id?: string; /** * The party that manages this shift input */ managed_by?: string; } export interface ShiftInputListParams { cursor?: string; expand?: string; filter?: string; order_by?: string; } export interface ShiftInputCreateParams { /** * Two letter string designating country code which the shift input is associated. */ country_code: string; /** * Name of the shift unit. */ name: string; /** * Prompt for the shift unit. */ prompt: string; /** * Type of shift unit. */ type: string; /** * The creator id associated with the shift input. */ creator_id?: string; } export interface ShiftInputRetrieveParams { expand?: string; } export interface ShiftInputUpdateParams { /** * Two letter string designating country code which the shift input is associated. */ country_code: string; /** * Name of the shift unit. */ name: string; /** * Prompt for the shift unit. */ prompt: string; /** * Type of shift unit. */ type: string; /** * The creator id associated with the shift input. */ creator_id?: string; } export declare namespace ShiftInputs { export { type ShiftInput as ShiftInput, type ShiftInputListResponse as ShiftInputListResponse, type ShiftInputCreateResponse as ShiftInputCreateResponse, type ShiftInputRetrieveResponse as ShiftInputRetrieveResponse, type ShiftInputUpdateResponse as ShiftInputUpdateResponse, type ShiftInputListResponsesPageCursorURL as ShiftInputListResponsesPageCursorURL, type ShiftInputListParams as ShiftInputListParams, type ShiftInputCreateParams as ShiftInputCreateParams, type ShiftInputRetrieveParams as ShiftInputRetrieveParams, type ShiftInputUpdateParams as ShiftInputUpdateParams, }; }