/**
 * Paypal Server SDKLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { lazy, object, optional, Schema, string } from '../schema';
import {
  UniversalProductCode,
  universalProductCodeSchema,
} from './universalProductCode';

/** The details of the items in the shipment. */
export interface OrderTrackerItem {
  /** The item name or title. */
  name?: string;
  /** The item quantity. Must be a whole number. */
  quantity?: string;
  /** The stock keeping unit (SKU) for the item. This can contain unicode characters. */
  sku?: string;
  /** The URL to the item being purchased. Visible to buyer and used in buyer experiences. */
  url?: string;
  /** The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored. */
  imageUrl?: string;
  /** The Universal Product Code of the item. */
  upc?: UniversalProductCode;
}

export const orderTrackerItemSchema: Schema<OrderTrackerItem> = object({
  name: ['name', optional(string())],
  quantity: ['quantity', optional(string())],
  sku: ['sku', optional(string())],
  url: ['url', optional(string())],
  imageUrl: ['image_url', optional(string())],
  upc: ['upc', optional(lazy(() => universalProductCodeSchema))],
});
