OrderLineItem.fromJson constructor

OrderLineItem.fromJson(
  1. Map json_
)

Implementation

OrderLineItem.fromJson(core.Map json_)
    : this(
        adjustments: json_.containsKey('adjustments')
            ? (json_['adjustments'] as core.List)
                .map((value) => OrderLineItemAdjustment.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        annotations: json_.containsKey('annotations')
            ? (json_['annotations'] as core.List)
                .map((value) => OrderMerchantProvidedAnnotation.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        cancellations: json_.containsKey('cancellations')
            ? (json_['cancellations'] as core.List)
                .map((value) => OrderCancellation.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        id: json_.containsKey('id') ? json_['id'] as core.String : null,
        price: json_.containsKey('price')
            ? Price.fromJson(
                json_['price'] as core.Map<core.String, core.dynamic>)
            : null,
        product: json_.containsKey('product')
            ? OrderLineItemProduct.fromJson(
                json_['product'] as core.Map<core.String, core.dynamic>)
            : null,
        quantityCanceled: json_.containsKey('quantityCanceled')
            ? json_['quantityCanceled'] as core.int
            : null,
        quantityDelivered: json_.containsKey('quantityDelivered')
            ? json_['quantityDelivered'] as core.int
            : null,
        quantityOrdered: json_.containsKey('quantityOrdered')
            ? json_['quantityOrdered'] as core.int
            : null,
        quantityPending: json_.containsKey('quantityPending')
            ? json_['quantityPending'] as core.int
            : null,
        quantityReadyForPickup: json_.containsKey('quantityReadyForPickup')
            ? json_['quantityReadyForPickup'] as core.int
            : null,
        quantityReturned: json_.containsKey('quantityReturned')
            ? json_['quantityReturned'] as core.int
            : null,
        quantityShipped: json_.containsKey('quantityShipped')
            ? json_['quantityShipped'] as core.int
            : null,
        quantityUndeliverable: json_.containsKey('quantityUndeliverable')
            ? json_['quantityUndeliverable'] as core.int
            : null,
        returnInfo: json_.containsKey('returnInfo')
            ? OrderLineItemReturnInfo.fromJson(
                json_['returnInfo'] as core.Map<core.String, core.dynamic>)
            : null,
        returns: json_.containsKey('returns')
            ? (json_['returns'] as core.List)
                .map((value) => OrderReturn.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        shippingDetails: json_.containsKey('shippingDetails')
            ? OrderLineItemShippingDetails.fromJson(json_['shippingDetails']
                as core.Map<core.String, core.dynamic>)
            : null,
        tax: json_.containsKey('tax')
            ? Price.fromJson(
                json_['tax'] as core.Map<core.String, core.dynamic>)
            : null,
      );