/** * PagarmeApiSDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { array, boolean, dict, lazy, nullable, number, object, optional, Schema, string, } from '../schema'; import { GetPlanItemResponse, getPlanItemResponseSchema, } from './getPlanItemResponse'; /** Response object for getting a plan */ export interface GetPlanResponse { id?: string | null; name?: string | null; description?: string | null; url?: string | null; statementDescriptor?: string | null; interval?: string | null; intervalCount?: number | null; billingType?: string | null; paymentMethods?: string[] | null; installments?: number[] | null; status?: string | null; currency?: string | null; createdAt?: string | null; updatedAt?: string | null; items?: GetPlanItemResponse[] | null; billingDays?: number[] | null; shippable?: boolean | null; metadata?: Record | null; trialPeriodDays?: number | null; minimumPrice?: number | null; deletedAt?: string | null; } export const getPlanResponseSchema: Schema = object({ id: ['id', optional(nullable(string()))], name: ['name', optional(nullable(string()))], description: ['description', optional(nullable(string()))], url: ['url', optional(nullable(string()))], statementDescriptor: ['statement_descriptor', optional(nullable(string()))], interval: ['interval', optional(nullable(string()))], intervalCount: ['interval_count', optional(nullable(number()))], billingType: ['billing_type', optional(nullable(string()))], paymentMethods: ['payment_methods', optional(nullable(array(string())))], installments: ['installments', optional(nullable(array(number())))], status: ['status', optional(nullable(string()))], currency: ['currency', optional(nullable(string()))], createdAt: ['created_at', optional(nullable(string()))], updatedAt: ['updated_at', optional(nullable(string()))], items: [ 'items', optional(nullable(array(lazy(() => getPlanItemResponseSchema)))), ], billingDays: ['billing_days', optional(nullable(array(number())))], shippable: ['shippable', optional(nullable(boolean()))], metadata: ['metadata', optional(nullable(dict(string())))], trialPeriodDays: ['trial_period_days', optional(nullable(number()))], minimumPrice: ['minimum_price', optional(nullable(number()))], deletedAt: ['deleted_at', optional(nullable(string()))], });