/* tslint:disable */ /* eslint-disable */ /** * Fabric API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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 { BillingCycle } from './BillingCycle'; import { BillingCycleFromJSON, BillingCycleFromJSONTyped, BillingCycleToJSON, BillingCycleToJSONTyped, } from './BillingCycle'; import type { PlanEntitlements } from './PlanEntitlements'; import { PlanEntitlementsFromJSON, PlanEntitlementsFromJSONTyped, PlanEntitlementsToJSON, PlanEntitlementsToJSONTyped, } from './PlanEntitlements'; import type { SubscriptionStatus } from './SubscriptionStatus'; import { SubscriptionStatusFromJSON, SubscriptionStatusFromJSONTyped, SubscriptionStatusToJSON, SubscriptionStatusToJSONTyped, } from './SubscriptionStatus'; import type { UsageItems } from './UsageItems'; import { UsageItemsFromJSON, UsageItemsFromJSONTyped, UsageItemsToJSON, UsageItemsToJSONTyped, } from './UsageItems'; import type { WorkspaceSubscriptionCreditOperationCosts } from './WorkspaceSubscriptionCreditOperationCosts'; import { WorkspaceSubscriptionCreditOperationCostsFromJSON, WorkspaceSubscriptionCreditOperationCostsFromJSONTyped, WorkspaceSubscriptionCreditOperationCostsToJSON, WorkspaceSubscriptionCreditOperationCostsToJSONTyped, } from './WorkspaceSubscriptionCreditOperationCosts'; import type { Store } from './Store'; import { StoreFromJSON, StoreFromJSONTyped, StoreToJSON, StoreToJSONTyped, } from './Store'; import type { SubscriptionTier } from './SubscriptionTier'; import { SubscriptionTierFromJSON, SubscriptionTierFromJSONTyped, SubscriptionTierToJSON, SubscriptionTierToJSONTyped, } from './SubscriptionTier'; /** * * @export * @interface WorkspaceSubscription */ export interface WorkspaceSubscription { /** * * @type {SubscriptionTier} * @memberof WorkspaceSubscription */ 'tier': SubscriptionTier | null; /** * * @type {SubscriptionStatus} * @memberof WorkspaceSubscription */ 'status': SubscriptionStatus | null; /** * * @type {string} * @memberof WorkspaceSubscription */ 'trialEndingAt': string | null; /** * * @type {BillingCycle} * @memberof WorkspaceSubscription */ 'billingCycle': BillingCycle | null; /** * * @type {PlanEntitlements} * @memberof WorkspaceSubscription */ 'entitlements': PlanEntitlements | null; /** * * @type {boolean} * @memberof WorkspaceSubscription */ 'hasDefaultPaymentMethod': boolean; /** * * @type {UsageItems} * @memberof WorkspaceSubscription */ 'usage': UsageItems; /** * * @type {string} * @memberof WorkspaceSubscription */ 'creditTopupAt': string | null; /** * * @type {WorkspaceSubscriptionCreditOperationCosts} * @memberof WorkspaceSubscription */ 'creditOperationCosts': WorkspaceSubscriptionCreditOperationCosts; /** * * @type {string} * @memberof WorkspaceSubscription */ 'planStoreId': string | null; /** * * @type {Store} * @memberof WorkspaceSubscription */ 'planStoreType': Store | null; /** * * @type {boolean} * @memberof WorkspaceSubscription */ 'isFreeTrialAvailable': boolean; } /** * Check if a given object implements the WorkspaceSubscription interface. */ export function instanceOfWorkspaceSubscription(value: object): value is WorkspaceSubscription { if (!('tier' in value) || value['tier'] === undefined) return false; if (!('status' in value) || value['status'] === undefined) return false; if (!('trialEndingAt' in value) || value['trialEndingAt'] === undefined) return false; if (!('billingCycle' in value) || value['billingCycle'] === undefined) return false; if (!('entitlements' in value) || value['entitlements'] === undefined) return false; if (!('hasDefaultPaymentMethod' in value) || value['hasDefaultPaymentMethod'] === undefined) return false; if (!('usage' in value) || value['usage'] === undefined) return false; if (!('creditTopupAt' in value) || value['creditTopupAt'] === undefined) return false; if (!('creditOperationCosts' in value) || value['creditOperationCosts'] === undefined) return false; if (!('planStoreId' in value) || value['planStoreId'] === undefined) return false; if (!('planStoreType' in value) || value['planStoreType'] === undefined) return false; if (!('isFreeTrialAvailable' in value) || value['isFreeTrialAvailable'] === undefined) return false; return true; } export function WorkspaceSubscriptionFromJSON(json: any): WorkspaceSubscription { return WorkspaceSubscriptionFromJSONTyped(json, false); } export function WorkspaceSubscriptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): WorkspaceSubscription { if (json == null) { return json; } const result = { } as WorkspaceSubscription; if (json['tier'] !== undefined) { if (json['tier'] === null) { result['tier'] = null; } else { result['tier'] = SubscriptionTierFromJSON(json['tier']); } } if (json['status'] !== undefined) { if (json['status'] === null) { result['status'] = null; } else { result['status'] = SubscriptionStatusFromJSON(json['status']); } } if (json['trialEndingAt'] !== undefined) { if (json['trialEndingAt'] === null) { result['trialEndingAt'] = null; } else { result['trialEndingAt'] = json['trialEndingAt']; } } if (json['billingCycle'] !== undefined) { if (json['billingCycle'] === null) { result['billingCycle'] = null; } else { result['billingCycle'] = BillingCycleFromJSON(json['billingCycle']); } } if (json['entitlements'] !== undefined) { if (json['entitlements'] === null) { result['entitlements'] = null; } else { result['entitlements'] = PlanEntitlementsFromJSON(json['entitlements']); } } if (json['hasDefaultPaymentMethod'] !== undefined) { result['hasDefaultPaymentMethod'] = json['hasDefaultPaymentMethod']; } if (json['usage'] !== undefined) { result['usage'] = UsageItemsFromJSON(json['usage']); } if (json['creditTopupAt'] !== undefined) { if (json['creditTopupAt'] === null) { result['creditTopupAt'] = null; } else { result['creditTopupAt'] = json['creditTopupAt']; } } if (json['creditOperationCosts'] !== undefined) { result['creditOperationCosts'] = WorkspaceSubscriptionCreditOperationCostsFromJSON(json['creditOperationCosts']); } if (json['planStoreId'] !== undefined) { if (json['planStoreId'] === null) { result['planStoreId'] = null; } else { result['planStoreId'] = json['planStoreId']; } } if (json['planStoreType'] !== undefined) { if (json['planStoreType'] === null) { result['planStoreType'] = null; } else { result['planStoreType'] = StoreFromJSON(json['planStoreType']); } } if (json['isFreeTrialAvailable'] !== undefined) { result['isFreeTrialAvailable'] = json['isFreeTrialAvailable']; } return result; } export function WorkspaceSubscriptionToJSON(json: any): WorkspaceSubscription { return WorkspaceSubscriptionToJSONTyped(json, false); } export function WorkspaceSubscriptionToJSONTyped(value?: WorkspaceSubscription | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'tier': SubscriptionTierToJSON(value['tier']), 'status': SubscriptionStatusToJSON(value['status']), 'trialEndingAt': value['trialEndingAt'], 'billingCycle': BillingCycleToJSON(value['billingCycle']), 'entitlements': PlanEntitlementsToJSON(value['entitlements']), 'hasDefaultPaymentMethod': value['hasDefaultPaymentMethod'], 'usage': UsageItemsToJSON(value['usage']), 'creditTopupAt': value['creditTopupAt'], 'creditOperationCosts': WorkspaceSubscriptionCreditOperationCostsToJSON(value['creditOperationCosts']), 'planStoreId': value['planStoreId'], 'planStoreType': StoreToJSON(value['planStoreType']), 'isFreeTrialAvailable': value['isFreeTrialAvailable'], }; }