export type PackageInfo = {appVersion?: string | undefined, description?: string | undefined, isDisabled?: boolean | undefined, isMandatory?: boolean | undefined, rollout?: number | undefined, label?: string | undefined}; export type PatchApiAppsAppNameDeploymentsDeploymentNameReleaseArgs = {appName: string, deploymentName: string, tenant?: string | undefined, body: {packageInfo?: PackageInfo | undefined, label?: string | undefined}}; export type PatchApiAppsAppNameDeploymentsDeploymentNameReleaseOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Patch release metadata * * PATCH /apps/{appName}/deployments/{deploymentName}/release */ export const patchApiAppsAppNameDeploymentsDeploymentNameRelease = async (args: PatchApiAppsAppNameDeploymentsDeploymentNameReleaseArgs, options: PatchApiAppsAppNameDeploymentsDeploymentNameReleaseOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.tenant != null) headers.set("tenant", String(args.tenant)) const url = `${baseUrl.replace(/\/+$/, '')}/apps/${encodeURIComponent(String(args.appName))}/deployments/${encodeURIComponent(String(args.deploymentName))}/release${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };