fromMap static method

Booking? fromMap(
  1. Object? body
)

Implementation

static Booking? fromMap(Object? body) {
  final source = readRecord(body);
  if (source == null) return null;
  return Booking(
    account: BookingAccount.fromMap(source['account']),
    allowContract: readFlag(source['allow_contract']),
    billingAddress: BookingBillingAddress.fromMap(source['billing_address']),
    billingPreferences:
        BookingBillingPreferences.fromMap(source['billing_preferences']),
    billingStartDate: readText(source['billing_start_date']),
    billingStartDayOfMonth: readText(source['billing_start_day_of_month']),
    communicationPreferences: readList<BookingCommunicationPreference>(
        source['communication_preferences'],
        BookingCommunicationPreference.fromMap),
    contractProperties:
        BookingContractProperties.fromMap(source['contract_properties']),
    createdBy: readAny(source['created_by']),
    createdOn: readText(source['created_on']),
    currency: BookingCurrency.fromMap(source['currency']),
    customForm: BookingCustomForm.fromMap(source['custom_form']),
    customerPurchaseOrderId: readText(source['customer_purchase_order_id']),
    description: readText(source['description']),
    discountProfile:
        BookingDiscountProfile.fromMap(source['discount_profile']),
    displayName: readText(source['display_name']),
    id: readText(source['id']),
    invoiceNote: readText(source['invoice_note']),
    lastUpdatedBy: readAny(source['last_updated_by']),
    lastUpdatedOn: readText(source['last_updated_on']),
    manager: BookingManager.fromMap(source['manager']),
    name: readText(source['name']),
    nextBillingFromDate: readText(source['next_billing_from_date']),
    nextBillingFromDateUtc: readText(source['next_billing_from_date_utc']),
    object: readText(source['object']),
    orderStartDate: readText(source['order_start_date']),
    orderType: readText(source['order_type']),
    origin: readText(source['origin']),
    originalTotal: readText(source['original_total']),
    preOrder: readFlag(source['pre_order']),
    priceTaxInclusive: readFlag(source['price_tax_inclusive']),
    quoteConverted: readFlag(source['quote_converted']),
    quoteOrder: readFlag(source['quote_order']),
    referralAccount:
        BookingReferralAccount.fromMap(source['referral_account']),
    salesRep: BookingSalesRep.fromMap(source['sales_rep']),
    shippingAddress:
        BookingShippingAddress.fromMap(source['shipping_address']),
    shippingCost: readDecimal(source['shipping_cost']),
    shippingProfile:
        BookingShippingProfile.fromMap(source['shipping_profile']),
    status: readText(source['status']),
    timeZone: BookingTimeZone.fromMap(source['time_zone']),
    version: readInteger(source['version']),
  );
}