/* 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 LimitsFields */ export interface LimitsFields { [key: string]: any | any; /** * * @type {string} * @memberof LimitsFields */ accessTier?: string; /** * * @type {string} * @memberof LimitsFields */ blockedReason?: string | null; /** * * @type {LimitsFieldsCurrentLimits} * @memberof LimitsFields */ currentLimits?: LimitsFieldsCurrentLimits; /** * * @type {LimitsFieldsCurrentLimits} * @memberof LimitsFields */ standardLimits?: LimitsFieldsCurrentLimits; /** * * @type {LimitsFieldsCurrentLimits} * @memberof LimitsFields */ trialLimits?: LimitsFieldsCurrentLimits; /** * * @type {{ [key: string]: any; }} * @memberof LimitsFields */ upgradeEffects?: { [key: string]: any; }; /** * Whether the authenticated account can create or operate boxes right now. * @type {boolean} * @memberof LimitsFields */ canStart: boolean; /** * * @type {boolean} * @memberof LimitsFields */ checkoutRequired?: boolean; /** * * @type {string} * @memberof LimitsFields */ startBlockedReason?: string | null; /** * * @type {string} * @memberof LimitsFields */ contactMessage?: string | null; /** * * @type {number} * @memberof LimitsFields */ activeBoxes: number; /** * * @type {Array} * @memberof LimitsFields */ activeStates?: Array; /** * * @type {number} * @memberof LimitsFields */ maxActiveBoxes: number; /** * * @type {number} * @memberof LimitsFields */ maxCreationRequestsPerMinute?: number; /** * * @type {number} * @memberof LimitsFields */ maxCreationRequestsPerDay?: number | null; /** * * @type {LimitsFieldsStartLimits} * @memberof LimitsFields */ startLimits?: LimitsFieldsStartLimits; /** * * @type {LimitsFieldsStarts} * @memberof LimitsFields */ starts?: LimitsFieldsStarts; /** * Remaining machine time in hours (`creditBalanceSeconds / 3600`). Null on unlimited accounts. * @type {number} * @memberof LimitsFields */ creditBalanceHours?: number | null; /** * Remaining purchased credit packs in hours. * @type {number} * @memberof LimitsFields */ packBalanceHours?: number; /** * Remaining purchased credit packs in dollars. * @type {number} * @memberof LimitsFields */ packBalanceDollars?: number; /** * * @type {boolean} * @memberof LimitsFields */ hasPaymentHistory?: boolean; /** * * @type {{ [key: string]: any; }} * @memberof LimitsFields */ _package?: { [key: string]: any; }; /** * * @type {number} * @memberof LimitsFields */ subscriptionQuotaSeconds?: number; /** * * @type {number} * @memberof LimitsFields */ subscriptionRemainingSeconds?: number; /** * * @type {number} * @memberof LimitsFields */ packBalanceSeconds?: number; /** * * @type {number} * @memberof LimitsFields */ creditPurchasedSeconds?: number; /** * * @type {number} * @memberof LimitsFields */ creditUsedSeconds?: number; /** * * @type {number} * @memberof LimitsFields */ liveUsageSeconds?: number; /** * * @type {number} * @memberof LimitsFields */ creditSecondsPerDollar?: number; /** * Account access state returned by the current backend. Billing endpoints are not part of v1. * @type {string} * @memberof LimitsFields */ billingStatus: string; /** * * @type {string} * @memberof LimitsFields */ subscriptionStatus?: string | null; /** * * @type {boolean} * @memberof LimitsFields */ subscriptionCancelAtPeriodEnd?: boolean; /** * * @type {boolean} * @memberof LimitsFields */ hasSubscription?: boolean; /** * * @type {Date} * @memberof LimitsFields */ subscriptionTrialEndsAt?: Date | null; /** * * @type {Date} * @memberof LimitsFields */ subscriptionCurrentPeriodEnd?: Date | null; /** * * @type {number} * @memberof LimitsFields */ creditBalanceSeconds?: number; /** * Present when limits were read for a team wallet (`?teamId=`, `?org=`, or `X-Box-Org`). * @type {string} * @memberof LimitsFields */ teamId?: string; /** * Caller's role on that team when `teamId` is present. * @type {string} * @memberof LimitsFields */ teamRole?: string; } /** * Check if a given object implements the LimitsFields interface. */ export function instanceOfLimitsFields(value: object): value is LimitsFields { 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 LimitsFieldsFromJSON(json: any): LimitsFields { return LimitsFieldsFromJSONTyped(json, false); } export function LimitsFieldsFromJSONTyped(json: any, ignoreDiscriminator: boolean): LimitsFields { if (json == null) { return json; } return { ...json, '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 LimitsFieldsToJSON(json: any): LimitsFields { return LimitsFieldsToJSONTyped(json, false); } export function LimitsFieldsToJSONTyped(value?: LimitsFields | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { ...value, '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'], }; }