// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; /** * Author, publish, and install Unity Packages V2 packages */ export class Extract extends APIResource { /** * Export current packaging configurations and dependency order without creating a * package or version. Copy complete identifiers from GET /package-components/. * Extraction requires packages.read-write because it can persist missing API names * on source components and dependencies. Component reads follow the package * builder. If a missing or deleted component is skipped, the response is partial * and has_omitted_unreadable_components is true. omitted_components identifies * each skipped component with a NOT_FOUND reason and message; do not create a * package version from that snapshot. Safe to retry: each call reads current * source state and reuses API names already backfilled. Results can change if * source components change. * * @example HTTP * Representative request and response shapes. * ``` * POST /package-components/extract/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "identifiers": [ * {} * ] * } * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "component_configs": [ * {} * ], * "install_order": [ * {} * ], * "external_managed_dependencies": [ * {} * ], * "external_zobject_references": [ * {} * ], * "has_omitted_unreadable_components": false, * "omitted_components": [ * { * "identifier": {}, * "reason": "NOT_FOUND", * "message": "string" * } * ] * } * ``` */ create(body: ExtractCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/package-components/extract/', { body, ...options }); } } export interface ExtractCreateResponse { /** * Full packaging configurations for selected live components and their * dependencies. */ component_configs: Array; /** * Required components owned by other managed packages, outside this snapshot. */ external_managed_dependencies: Array; /** * Native object and field references required in the destination company. */ external_zobject_references: Array; /** * True when extraction skipped a missing, deleted, or unreadable component, * including a selected root or dependency. The returned snapshot is partial and * must not be used to create a package version. */ has_omitted_unreadable_components: boolean; /** * Component identifiers ordered for installation by the packaging dependency * graph. */ install_order: Array; /** * Missing or deleted components skipped by the shared extractor, with identifiers * and omission reasons. An empty list means no missing-component omissions were * reported. */ omitted_components: Array; } export namespace ExtractCreateResponse { export interface OmittedComponent { /** * Identifier of the selected component or dependency omitted from extraction. */ identifier: unknown; /** * Explanation of why the component was omitted. */ message: string; /** * Machine-readable reason the component was omitted. */ reason: 'NOT_FOUND'; } } export interface ExtractCreateParams { /** * Complete picker identifiers; fields depend on the component type. */ identifiers: Array; } export declare namespace Extract { export { type ExtractCreateResponse as ExtractCreateResponse, type ExtractCreateParams as ExtractCreateParams, }; }