/* 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'; import type { LimitsFieldsCurrentLimits } from './LimitsFieldsCurrentLimits'; import { LimitsFieldsCurrentLimitsFromJSON, LimitsFieldsCurrentLimitsFromJSONTyped, LimitsFieldsCurrentLimitsToJSON, LimitsFieldsCurrentLimitsToJSONTyped, } from './LimitsFieldsCurrentLimits'; import type { LimitsFieldsStartLimits } from './LimitsFieldsStartLimits'; import { LimitsFieldsStartLimitsFromJSON, LimitsFieldsStartLimitsFromJSONTyped, LimitsFieldsStartLimitsToJSON, LimitsFieldsStartLimitsToJSONTyped, } from './LimitsFieldsStartLimits'; import type { LimitsFieldsStarts } from './LimitsFieldsStarts'; import { LimitsFieldsStartsFromJSON, LimitsFieldsStartsFromJSONTyped, LimitsFieldsStartsToJSON, LimitsFieldsStartsToJSONTyped, } from './LimitsFieldsStarts'; /** * * @export * @interface LimitsResponse */ export interface LimitsResponse { /** * * @type {boolean} * @memberof LimitsResponse */ ok: boolean; /** * Stable success envelope discriminator added by v1. * @type {string} * @memberof LimitsResponse */ type: string; /** * * @type {string} * @memberof LimitsResponse */ accessTier?: string; /** * * @type {string} * @memberof LimitsResponse */ blockedReason?: string; /** * * @type {LimitsFieldsCurrentLimits} * @memberof LimitsResponse */ currentLimits?: LimitsFieldsCurrentLimits; /** * * @type {LimitsFieldsCurrentLimits} * @memberof LimitsResponse */ standardLimits?: LimitsFieldsCurrentLimits; /** * * @type {LimitsFieldsCurrentLimits} * @memberof LimitsResponse */ trialLimits?: LimitsFieldsCurrentLimits; /** * * @type {{ [key: string]: any; }} * @memberof LimitsResponse */ upgradeEffects?: { [key: string]: any; }; /** * Whether the authenticated account can create or operate boxes right now. * @type {boolean} * @memberof LimitsResponse */ canStart: boolean; /** * * @type {boolean} * @memberof LimitsResponse */ checkoutRequired?: boolean; /** * * @type {string} * @memberof LimitsResponse */ startBlockedReason?: string; /** * * @type {string} * @memberof LimitsResponse */ contactMessage?: string; /** * * @type {number} * @memberof LimitsResponse */ activeBoxes: number; /** * * @type {Array} * @memberof LimitsResponse */ activeStates?: Array; /** * * @type {number} * @memberof LimitsResponse */ maxActiveBoxes: number; /** * * @type {number} * @memberof LimitsResponse */ maxCreationRequestsPerMinute?: number; /** * * @type {number} * @memberof LimitsResponse */ maxCreationRequestsPerDay?: number; /** * * @type {LimitsFieldsStartLimits} * @memberof LimitsResponse */ startLimits?: LimitsFieldsStartLimits; /** * * @type {LimitsFieldsStarts} * @memberof LimitsResponse */ starts?: LimitsFieldsStarts; /** * Remaining machine time in hours (`creditBalanceSeconds / 3600`). Null on unlimited accounts. * @type {number} * @memberof LimitsResponse */ creditBalanceHours?: number; /** * Remaining purchased credit packs in hours. * @type {number} * @memberof LimitsResponse */ packBalanceHours?: number; /** * Remaining purchased credit packs in dollars. * @type {number} * @memberof LimitsResponse */ packBalanceDollars?: number; /** * * @type {boolean} * @memberof LimitsResponse */ hasPaymentHistory?: boolean; /** * * @type {{ [key: string]: any; }} * @memberof LimitsResponse */ _package?: { [key: string]: any; }; /** * * @type {number} * @memberof LimitsResponse */ subscriptionQuotaSeconds?: number; /** * * @type {number} * @memberof LimitsResponse */ subscriptionRemainingSeconds?: number; /** * * @type {number} * @memberof LimitsResponse */ packBalanceSeconds?: number; /** * * @type {number} * @memberof LimitsResponse */ creditPurchasedSeconds?: number; /** * * @type {number} * @memberof LimitsResponse */ creditUsedSeconds?: number; /** * * @type {number} * @memberof LimitsResponse */ liveUsageSeconds?: number; /** * * @type {number} * @memberof LimitsResponse */ creditSecondsPerDollar?: number; /** * Account access state returned by the current backend. Billing endpoints are not part of v1. * @type {string} * @memberof LimitsResponse */ billingStatus: string; /** * * @type {string} * @memberof LimitsResponse */ subscriptionStatus?: string; /** * * @type {boolean} * @memberof LimitsResponse */ subscriptionCancelAtPeriodEnd?: boolean; /** * * @type {boolean} * @memberof LimitsResponse */ hasSubscription?: boolean; /** * * @type {Date} * @memberof LimitsResponse */ subscriptionTrialEndsAt?: Date; /** * * @type {Date} * @memberof LimitsResponse */ subscriptionCurrentPeriodEnd?: Date; /** * * @type {number} * @memberof LimitsResponse */ creditBalanceSeconds?: number; /** * Present when limits were read for a team wallet (`?teamId=`, `?org=`, or `X-Box-Org`). * @type {string} * @memberof LimitsResponse */ teamId?: string; /** * Caller's role on that team when `teamId` is present. * @type {string} * @memberof LimitsResponse */ teamRole?: string; } /** * Check if a given object implements the LimitsResponse interface. */ export function instanceOfLimitsResponse(value: object): value is LimitsResponse { if (!('ok' in value) || value['ok'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; if (!('canStart' in value) || value['canStart'] === undefined) return false; if (!('activeBoxes' in value) || value['activeBoxes'] === undefined) return false; if (!('maxActiveBoxes' in value) || value['maxActiveBoxes'] === undefined) return false; if (!('billingStatus' in value) || value['billingStatus'] === undefined) return false; return true; } export function LimitsResponseFromJSON(json: any): LimitsResponse { return LimitsResponseFromJSONTyped(json, false); } export function LimitsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): LimitsResponse { if (json == null) { return json; } return { 'ok': json['ok'], 'type': json['type'], 'accessTier': json['accessTier'] == null ? undefined : json['accessTier'], 'blockedReason': json['blockedReason'] == null ? undefined : json['blockedReason'], 'currentLimits': json['currentLimits'] == null ? undefined : LimitsFieldsCurrentLimitsFromJSON(json['currentLimits']), 'standardLimits': json['standardLimits'] == null ? undefined : LimitsFieldsCurrentLimitsFromJSON(json['standardLimits']), 'trialLimits': json['trialLimits'] == null ? undefined : LimitsFieldsCurrentLimitsFromJSON(json['trialLimits']), 'upgradeEffects': json['upgradeEffects'] == null ? undefined : json['upgradeEffects'], 'canStart': json['canStart'], 'checkoutRequired': json['checkoutRequired'] == null ? undefined : json['checkoutRequired'], 'startBlockedReason': json['startBlockedReason'] == null ? undefined : json['startBlockedReason'], 'contactMessage': json['contactMessage'] == null ? undefined : json['contactMessage'], 'activeBoxes': json['activeBoxes'], 'activeStates': json['activeStates'] == null ? undefined : json['activeStates'], 'maxActiveBoxes': json['maxActiveBoxes'], 'maxCreationRequestsPerMinute': json['maxCreationRequestsPerMinute'] == null ? undefined : json['maxCreationRequestsPerMinute'], 'maxCreationRequestsPerDay': json['maxCreationRequestsPerDay'] == null ? undefined : json['maxCreationRequestsPerDay'], 'startLimits': json['startLimits'] == null ? undefined : LimitsFieldsStartLimitsFromJSON(json['startLimits']), 'starts': json['starts'] == null ? undefined : LimitsFieldsStartsFromJSON(json['starts']), 'creditBalanceHours': json['creditBalanceHours'] == null ? undefined : json['creditBalanceHours'], 'packBalanceHours': json['packBalanceHours'] == null ? undefined : json['packBalanceHours'], 'packBalanceDollars': json['packBalanceDollars'] == null ? undefined : json['packBalanceDollars'], 'hasPaymentHistory': json['hasPaymentHistory'] == null ? undefined : json['hasPaymentHistory'], '_package': json['package'] == null ? undefined : json['package'], 'subscriptionQuotaSeconds': json['subscriptionQuotaSeconds'] == null ? undefined : json['subscriptionQuotaSeconds'], 'subscriptionRemainingSeconds': json['subscriptionRemainingSeconds'] == null ? undefined : json['subscriptionRemainingSeconds'], 'packBalanceSeconds': json['packBalanceSeconds'] == null ? undefined : json['packBalanceSeconds'], 'creditPurchasedSeconds': json['creditPurchasedSeconds'] == null ? undefined : json['creditPurchasedSeconds'], 'creditUsedSeconds': json['creditUsedSeconds'] == null ? undefined : json['creditUsedSeconds'], 'liveUsageSeconds': json['liveUsageSeconds'] == null ? undefined : json['liveUsageSeconds'], 'creditSecondsPerDollar': json['creditSecondsPerDollar'] == null ? undefined : json['creditSecondsPerDollar'], 'billingStatus': json['billingStatus'], 'subscriptionStatus': json['subscriptionStatus'] == null ? undefined : json['subscriptionStatus'], 'subscriptionCancelAtPeriodEnd': json['subscriptionCancelAtPeriodEnd'] == null ? undefined : json['subscriptionCancelAtPeriodEnd'], 'hasSubscription': json['hasSubscription'] == null ? undefined : json['hasSubscription'], 'subscriptionTrialEndsAt': json['subscriptionTrialEndsAt'] == null ? undefined : (new Date(json['subscriptionTrialEndsAt'])), 'subscriptionCurrentPeriodEnd': json['subscriptionCurrentPeriodEnd'] == null ? undefined : (new Date(json['subscriptionCurrentPeriodEnd'])), 'creditBalanceSeconds': json['creditBalanceSeconds'] == null ? undefined : json['creditBalanceSeconds'], 'teamId': json['teamId'] == null ? undefined : json['teamId'], 'teamRole': json['teamRole'] == null ? undefined : json['teamRole'], }; } export function LimitsResponseToJSON(json: any): LimitsResponse { return LimitsResponseToJSONTyped(json, false); } export function LimitsResponseToJSONTyped(value?: LimitsResponse | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'ok': value['ok'], 'type': value['type'], 'accessTier': value['accessTier'], 'blockedReason': value['blockedReason'], 'currentLimits': LimitsFieldsCurrentLimitsToJSON(value['currentLimits']), 'standardLimits': LimitsFieldsCurrentLimitsToJSON(value['standardLimits']), 'trialLimits': LimitsFieldsCurrentLimitsToJSON(value['trialLimits']), 'upgradeEffects': value['upgradeEffects'], 'canStart': value['canStart'], 'checkoutRequired': value['checkoutRequired'], 'startBlockedReason': value['startBlockedReason'], 'contactMessage': value['contactMessage'], 'activeBoxes': value['activeBoxes'], 'activeStates': value['activeStates'], 'maxActiveBoxes': value['maxActiveBoxes'], 'maxCreationRequestsPerMinute': value['maxCreationRequestsPerMinute'], 'maxCreationRequestsPerDay': value['maxCreationRequestsPerDay'], 'startLimits': LimitsFieldsStartLimitsToJSON(value['startLimits']), 'starts': LimitsFieldsStartsToJSON(value['starts']), 'creditBalanceHours': value['creditBalanceHours'], 'packBalanceHours': value['packBalanceHours'], 'packBalanceDollars': value['packBalanceDollars'], 'hasPaymentHistory': value['hasPaymentHistory'], 'package': value['_package'], 'subscriptionQuotaSeconds': value['subscriptionQuotaSeconds'], 'subscriptionRemainingSeconds': value['subscriptionRemainingSeconds'], 'packBalanceSeconds': value['packBalanceSeconds'], 'creditPurchasedSeconds': value['creditPurchasedSeconds'], 'creditUsedSeconds': value['creditUsedSeconds'], 'liveUsageSeconds': value['liveUsageSeconds'], 'creditSecondsPerDollar': value['creditSecondsPerDollar'], 'billingStatus': value['billingStatus'], 'subscriptionStatus': value['subscriptionStatus'], 'subscriptionCancelAtPeriodEnd': value['subscriptionCancelAtPeriodEnd'], 'hasSubscription': value['hasSubscription'], 'subscriptionTrialEndsAt': value['subscriptionTrialEndsAt'] == null ? value['subscriptionTrialEndsAt'] : value['subscriptionTrialEndsAt'].toISOString(), 'subscriptionCurrentPeriodEnd': value['subscriptionCurrentPeriodEnd'] == null ? value['subscriptionCurrentPeriodEnd'] : value['subscriptionCurrentPeriodEnd'].toISOString(), 'creditBalanceSeconds': value['creditBalanceSeconds'], 'teamId': value['teamId'], 'teamRole': value['teamRole'], }; }