The platform for continuously improving AI agents.
/* tslint:disable */
/* eslint-disable */
/**
* Overbae API
* Backend API for the Overclaw / Overmind platform.
*
* The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
import type { DedicatedStartup } from './DedicatedStartup';
import {
DedicatedStartupFromJSON,
DedicatedStartupFromJSONTyped,
DedicatedStartupToJSON,
DedicatedStartupToJSONTyped,
} from './DedicatedStartup';
import type { DedicatedDeploymentStatusEnum } from './DedicatedDeploymentStatusEnum';
import {
DedicatedDeploymentStatusEnumFromJSON,
DedicatedDeploymentStatusEnumFromJSONTyped,
DedicatedDeploymentStatusEnumToJSON,
DedicatedDeploymentStatusEnumToJSONTyped,
} from './DedicatedDeploymentStatusEnum';
/**
*
* @export
* @interface DedicatedDeployment
*/
export interface DedicatedDeployment {
/**
*
* @type {string}
* @memberof DedicatedDeployment
*/
readonly id: string;
/**
*
* @type {string}
* @memberof DedicatedDeployment
*/
modelId: string;
/**
*
* @type {string}
* @memberof DedicatedDeployment
*/
readonly modelName: string;
/**
*
* @type {string}
* @memberof DedicatedDeployment
*/
deployedModel: string;
/**
*
* @type {string}
* @memberof DedicatedDeployment
*/
gpuType: string;
/**
*
* @type {string}
* @memberof DedicatedDeployment
*/
servingShape: string;
/**
*
* @type {DedicatedDeploymentStatusEnum}
* @memberof DedicatedDeployment
*/
status?: DedicatedDeploymentStatusEnum;
/**
*
* @type {number}
* @memberof DedicatedDeployment
*/
minReplicas?: number;
/**
*
* @type {number}
* @memberof DedicatedDeployment
*/
maxReplicas?: number;
/**
*
* @type {boolean}
* @memberof DedicatedDeployment
*/
scaleToZero?: boolean;
/**
*
* @type {number}
* @memberof DedicatedDeployment
*/
idleShutdownSeconds?: number;
/**
*
* @type {number}
* @memberof DedicatedDeployment
*/
runningReplicas?: number;
/**
*
* @type {string}
* @memberof DedicatedDeployment
*/
creditsPerGpuHour: string;
/**
*
* @type {string}
* @memberof DedicatedDeployment
*/
accruedCredits?: string;
/**
*
* @type {Date}
* @memberof DedicatedDeployment
*/
ratesFetchedAt?: Date | null;
/**
*
* @type {Date}
* @memberof DedicatedDeployment
*/
onlineAt?: Date | null;
/**
*
* @type {Date}
* @memberof DedicatedDeployment
*/
stoppedAt?: Date | null;
/**
*
* @type {string}
* @memberof DedicatedDeployment
*/
errorMessage?: string;
/**
*
* @type {DedicatedStartup}
* @memberof DedicatedDeployment
*/
readonly startup: DedicatedStartup | null;
}
/**
* Check if a given object implements the DedicatedDeployment interface.
*/
export function instanceOfDedicatedDeployment(value: object): value is DedicatedDeployment {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('modelId' in value) || value['modelId'] === undefined) return false;
if (!('modelName' in value) || value['modelName'] === undefined) return false;
if (!('deployedModel' in value) || value['deployedModel'] === undefined) return false;
if (!('gpuType' in value) || value['gpuType'] === undefined) return false;
if (!('servingShape' in value) || value['servingShape'] === undefined) return false;
if (!('creditsPerGpuHour' in value) || value['creditsPerGpuHour'] === undefined) return false;
if (!('startup' in value) || value['startup'] === undefined) return false;
return true;
}
export function DedicatedDeploymentFromJSON(json: any): DedicatedDeployment {
return DedicatedDeploymentFromJSONTyped(json, false);
}
export function DedicatedDeploymentFromJSONTyped(json: any, ignoreDiscriminator: boolean): DedicatedDeployment {
if (json == null) {
return json;
}
return {
'id': json['id'],
'modelId': json['model_id'],
'modelName': json['model_name'],
'deployedModel': json['deployed_model'],
'gpuType': json['gpu_type'],
'servingShape': json['serving_shape'],
'status': json['status'] == null ? undefined : DedicatedDeploymentStatusEnumFromJSON(json['status']),
'minReplicas': json['min_replicas'] == null ? undefined : json['min_replicas'],
'maxReplicas': json['max_replicas'] == null ? undefined : json['max_replicas'],
'scaleToZero': json['scale_to_zero'] == null ? undefined : json['scale_to_zero'],
'idleShutdownSeconds': json['idle_shutdown_seconds'] == null ? undefined : json['idle_shutdown_seconds'],
'runningReplicas': json['running_replicas'] == null ? undefined : json['running_replicas'],
'creditsPerGpuHour': json['credits_per_gpu_hour'],
'accruedCredits': json['accrued_credits'] == null ? undefined : json['accrued_credits'],
'ratesFetchedAt': json['rates_fetched_at'] == null ? undefined : (new Date(json['rates_fetched_at'])),
'onlineAt': json['online_at'] == null ? undefined : (new Date(json['online_at'])),
'stoppedAt': json['stopped_at'] == null ? undefined : (new Date(json['stopped_at'])),
'errorMessage': json['error_message'] == null ? undefined : json['error_message'],
'startup': DedicatedStartupFromJSON(json['startup']),
};
}
export function DedicatedDeploymentToJSON(json: any): DedicatedDeployment {
return DedicatedDeploymentToJSONTyped(json, false);
}
export function DedicatedDeploymentToJSONTyped(value?: Omit<DedicatedDeployment, 'id'|'model_name'|'startup'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'model_id': value['modelId'],
'deployed_model': value['deployedModel'],
'gpu_type': value['gpuType'],
'serving_shape': value['servingShape'],
'status': DedicatedDeploymentStatusEnumToJSON(value['status']),
'min_replicas': value['minReplicas'],
'max_replicas': value['maxReplicas'],
'scale_to_zero': value['scaleToZero'],
'idle_shutdown_seconds': value['idleShutdownSeconds'],
'running_replicas': value['runningReplicas'],
'credits_per_gpu_hour': value['creditsPerGpuHour'],
'accrued_credits': value['accruedCredits'],
'rates_fetched_at': value['ratesFetchedAt'] == null ? value['ratesFetchedAt'] : value['ratesFetchedAt'].toISOString(),
'online_at': value['onlineAt'] == null ? value['onlineAt'] : value['onlineAt'].toISOString(),
'stopped_at': value['stoppedAt'] == null ? value['stoppedAt'] : value['stoppedAt'].toISOString(),
'error_message': value['errorMessage'],
};
}