/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { imagesDelete } from "../funcs/imagesDelete.js"; import { imagesGetMetadata } from "../funcs/imagesGetMetadata.js"; import { GetPublicAcceptEnum, imagesGetPublic, } from "../funcs/imagesGetPublic.js"; import { imagesList } from "../funcs/imagesList.js"; import { imagesUpdate } from "../funcs/imagesUpdate.js"; import { imagesUpdateMetadata } from "../funcs/imagesUpdateMetadata.js"; import { imagesUpload } from "../funcs/imagesUpload.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export { GetPublicAcceptEnum } from "../funcs/imagesGetPublic.js"; export class Images extends ClientSDK { /** * List metadata for all images in the specified account. */ async list( request: operations.ListImageMetadataRequest, options?: RequestOptions, ): Promise { return unwrapAsync(imagesList( this, request, options, )); } /** * Upload a new PNG, JPEG, or WebP image with optional metadata. * Duplicate images, and requests larger than 16MB will be rejected. */ async upload( request: operations.UploadImageRequest, options?: RequestOptions, ): Promise { return unwrapAsync(imagesUpload( this, request, options, )); } /** * Retrieve metadata for a specific image by its ID. */ async getMetadata( request: operations.GetImageMetadataRequest, options?: RequestOptions, ): Promise { return unwrapAsync(imagesGetMetadata( this, request, options, )); } /** * Replace an existing image and, optionally, its metadata. * * This endpoint replaces the existing image with the new PNG, JPEG, or WebP. Omit * the metadata form section to keep existing metadata. Duplicate images, and requests larger than 16MB will be rejected. */ async update( request: operations.UpdateImageRequest, options?: RequestOptions, ): Promise { return unwrapAsync(imagesUpdate( this, request, options, )); } /** * Disable an image by its ID. * * Disabled images are still be accessible via their public URL, and cannot be assigned * to products or line-items. */ async delete( request: operations.DeleteImageRequest, options?: RequestOptions, ): Promise { return unwrapAsync(imagesDelete( this, request, options, )); } /** * Replace the metadata for an existing image. */ async updateMetadata( request: operations.UpdateImageMetadataRequest, options?: RequestOptions, ): Promise { return unwrapAsync(imagesUpdateMetadata( this, request, options, )); } /** * Get an image by its public ID. */ async getPublic( request: operations.GetPublicImageRequest, options?: RequestOptions & { acceptHeaderOverride?: GetPublicAcceptEnum }, ): Promise { return unwrapAsync(imagesGetPublic( this, request, options, )); } }