// 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'; import { path } from '../internal/utils/path'; /** * Author, publish, and install Unity Packages V2 packages */ export class PackageUpgrades extends APIResource { /** * Start upgrading a managed package install asynchronously. * * @example HTTP * Representative request and response shapes. * ``` * POST /package-upgrades/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "install_key": "install_key", * "package_key": "package_key", * "version_id": "version_id" * } * * HTTP/1.1 202 Accepted * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "package_key": "string", * "install_key": "string", * "old_version_id": "string", * "new_version_id": "string", * "status": "string", * "error_message": "string", * "upgrade_plan": {}, * "upgraded_components": [ * null * ], * "post_install_landing_component": {} * } * ``` */ create( body: PackageUpgradeCreateParams, options?: RequestOptions, ): APIPromise { return this._client.post('/package-upgrades/', { body, ...options }); } /** * Retrieve the status of a managed package upgrade. * * @example HTTP * Representative request and response shapes. * ``` * GET /package-upgrades/{tracker_id}/ 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 * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "package_key": "string", * "install_key": "string", * "old_version_id": "string", * "new_version_id": "string", * "status": "string", * "error_message": "string", * "upgrade_plan": {}, * "upgraded_components": [ * null * ], * "post_install_landing_component": {} * } * ``` */ retrieve(trackerID: string, options?: RequestOptions): APIPromise { return this._client.get(path`/package-upgrades/${trackerID}/`, options); } } /** * Async managed package upgrade tracker for subscriber companies. */ export interface PackageUpgradeCreateResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Error message when upgrade failed */ error_message?: string; /** * The install key of the managed package install */ install_key?: string; /** * The published package version being upgraded to */ new_version_id?: string; /** * The currently installed package version being upgraded from */ old_version_id?: string; /** * The package key of the managed package */ package_key?: string; /** * Component to open after upgrade completes */ post_install_landing_component?: unknown; /** * Upgrade status (IN_PROGRESS, COMPLETE, or FAILED) */ status?: string; /** * Upgrade plan snapshot when available */ upgrade_plan?: unknown; /** * Components upgraded so far */ upgraded_components?: Array; } /** * Async managed package upgrade tracker for subscriber companies. */ export interface PackageUpgradeRetrieveResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Error message when upgrade failed */ error_message?: string; /** * The install key of the managed package install */ install_key?: string; /** * The published package version being upgraded to */ new_version_id?: string; /** * The currently installed package version being upgraded from */ old_version_id?: string; /** * The package key of the managed package */ package_key?: string; /** * Component to open after upgrade completes */ post_install_landing_component?: unknown; /** * Upgrade status (IN_PROGRESS, COMPLETE, or FAILED) */ status?: string; /** * Upgrade plan snapshot when available */ upgrade_plan?: unknown; /** * Components upgraded so far */ upgraded_components?: Array; } export interface PackageUpgradeCreateParams { /** * The install key of the managed package install to upgrade. */ install_key: string; /** * The package key of the managed package to upgrade. */ package_key: string; /** * The published package version to upgrade to. */ version_id: string; } export declare namespace PackageUpgrades { export { type PackageUpgradeCreateResponse as PackageUpgradeCreateResponse, type PackageUpgradeRetrieveResponse as PackageUpgradeRetrieveResponse, type PackageUpgradeCreateParams as PackageUpgradeCreateParams, }; }