/* tslint:disable */ /* eslint-disable */ /** * Boat Public API v1 * Public JSON API for creating, operating, prompting, observing, and exposing Boat sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1. * * The version of the OpenAPI document: 1.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'; /** * * @export * @interface BoxUsageResponse */ export interface BoxUsageResponse { /** * * @type {boolean} * @memberof BoxUsageResponse */ ok: boolean; /** * * @type {string} * @memberof BoxUsageResponse */ type: string; /** * * @type {string} * @memberof BoxUsageResponse */ boxId: string; /** * The box's current machine size, which sets `billingMultiplier`. * @type {BoxUsageResponseBoxTypeEnum} * @memberof BoxUsageResponse */ boxType: BoxUsageResponseBoxTypeEnum; /** * Rate at which this box consumes machine time. 0.5 for `small`, 1 for `default`, 2 for `large`, and 50/9 for `xlarge`. * @type {number} * @memberof BoxUsageResponse */ billingMultiplier: number; /** * Start of the window the figures cover. The box's creation time when the request did not pass `since`. * @type {Date} * @memberof BoxUsageResponse */ since: Date; /** * End of the window. Now when the request did not pass `until`, or passed one in the future. * @type {Date} * @memberof BoxUsageResponse */ until: Date; /** * Billable machine-seconds inside the window, the type multiplier already applied: a `large` box that ran ten minutes reads 1200. Includes a running box's time up to `until`. Time while stopped is never counted and time past a refused stop is excluded. * @type {number} * @memberof BoxUsageResponse */ seconds: number; /** * `seconds` at list price (`seconds / secondsPerDollar`), whatever plan, trial or gift actually paid for it. Up to six decimals. * @type {number} * @memberof BoxUsageResponse */ dollars: number; /** * How many billable seconds one dollar buys, so you can price `seconds` yourself. * @type {number} * @memberof BoxUsageResponse */ secondsPerDollar: number; /** * The meter is still moving: the box is up and no refused stop is holding it paused. Read again after it stops for the final figure. `false` on a box that is up but paused past a refused stop, whose figure will not change until it is used again. * @type {boolean} * @memberof BoxUsageResponse */ running: boolean; } /** * @export */ export const BoxUsageResponseBoxTypeEnum = { Small: 'small', Default: 'default', Large: 'large', Xlarge: 'xlarge' } as const; export type BoxUsageResponseBoxTypeEnum = typeof BoxUsageResponseBoxTypeEnum[keyof typeof BoxUsageResponseBoxTypeEnum]; /** * Check if a given object implements the BoxUsageResponse interface. */ export function instanceOfBoxUsageResponse(value: object): value is BoxUsageResponse { if (!('ok' in value) || value['ok'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; if (!('boxId' in value) || value['boxId'] === undefined) return false; if (!('boxType' in value) || value['boxType'] === undefined) return false; if (!('billingMultiplier' in value) || value['billingMultiplier'] === undefined) return false; if (!('since' in value) || value['since'] === undefined) return false; if (!('until' in value) || value['until'] === undefined) return false; if (!('seconds' in value) || value['seconds'] === undefined) return false; if (!('dollars' in value) || value['dollars'] === undefined) return false; if (!('secondsPerDollar' in value) || value['secondsPerDollar'] === undefined) return false; if (!('running' in value) || value['running'] === undefined) return false; return true; } export function BoxUsageResponseFromJSON(json: any): BoxUsageResponse { return BoxUsageResponseFromJSONTyped(json, false); } export function BoxUsageResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): BoxUsageResponse { if (json == null) { return json; } return { 'ok': json['ok'], 'type': json['type'], 'boxId': json['boxId'], 'boxType': json['boxType'], 'billingMultiplier': json['billingMultiplier'], 'since': (new Date(json['since'])), 'until': (new Date(json['until'])), 'seconds': json['seconds'], 'dollars': json['dollars'], 'secondsPerDollar': json['secondsPerDollar'], 'running': json['running'], }; } export function BoxUsageResponseToJSON(json: any): BoxUsageResponse { return BoxUsageResponseToJSONTyped(json, false); } export function BoxUsageResponseToJSONTyped(value?: BoxUsageResponse | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'ok': value['ok'], 'type': value['type'], 'boxId': value['boxId'], 'boxType': value['boxType'], 'billingMultiplier': value['billingMultiplier'], 'since': value['since'].toISOString(), 'until': value['until'].toISOString(), 'seconds': value['seconds'], 'dollars': value['dollars'], 'secondsPerDollar': value['secondsPerDollar'], 'running': value['running'], }; }