// 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'; export class Assets extends APIResource { /** * Add assets to a specific collection */ add(collectionID: string, params: AssetAddParams, options?: RequestOptions): APIPromise { const { projectId, ...body } = params; return this._client.put(path`/collections/${collectionID}/assets`, { query: { projectId }, body, ...options, }); } /** * Remove assets from a specific collection */ remove( collectionID: string, params: AssetRemoveParams, options?: RequestOptions, ): APIPromise { const { projectId, ...body } = params; return this._client.delete(path`/collections/${collectionID}/assets`, { query: { projectId }, body, ...options, }); } } export interface AssetAddResponse { collection: AssetAddResponse.Collection; } export namespace AssetAddResponse { export interface Collection { /** * The collection ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; assetCount: number; /** * The collection creation date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ createdAt: string; itemCount: number; modelCount: number; /** * The collection name */ name: string; /** * The owner ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ ownerId: string; /** * The collection last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The thumbnail for the collection (if any) */ thumbnail?: Collection.Thumbnail; } export namespace Collection { /** * The thumbnail for the collection (if any) */ export interface Thumbnail { assetId: string; url: string; } } } export interface AssetRemoveResponse { collection: AssetRemoveResponse.Collection; } export namespace AssetRemoveResponse { export interface Collection { /** * The collection ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; assetCount: number; /** * The collection creation date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ createdAt: string; itemCount: number; modelCount: number; /** * The collection name */ name: string; /** * The owner ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ ownerId: string; /** * The collection last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The thumbnail for the collection (if any) */ thumbnail?: Collection.Thumbnail; } export namespace Collection { /** * The thumbnail for the collection (if any) */ export interface Thumbnail { assetId: string; url: string; } } } export interface AssetAddParams { /** * Body param: The ids of the assets to add to the collection. (Max 49 at once) */ assetIds: Array; /** * Query param: The projectId used for ownership resource management. Either to * assert ownership or to set the owner of the resource(s) */ projectId?: string; } export interface AssetRemoveParams { /** * Body param: The ids of the assets to remove from the collection. (Max 49 at * once) */ assetIds: Array; /** * Query param: The projectId used for ownership resource management. Either to * assert ownership or to set the owner of the resource(s) */ projectId?: string; } export declare namespace Assets { export { type AssetAddResponse as AssetAddResponse, type AssetRemoveResponse as AssetRemoveResponse, type AssetAddParams as AssetAddParams, type AssetRemoveParams as AssetRemoveParams, }; }