EmbeddedProduct.fromJson constructor

EmbeddedProduct.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory EmbeddedProduct.fromJson(
  Map<String, Object?> json,
) =>
    EmbeddedProduct(
      id: json["id"] as String,
      about: json["about"] == null ? null : json["about"] as String,
      active: json["active"] as bool,
      archivedAt: json["archived_at"] == null
          ? null
          : decodeDateTime(json["archived_at"]),
      attributes: json["attributes"] == null
          ? null
          : (json["attributes"] as List)
              .map(
                (item) => EmbeddedProductAttributesItem.fromJson(
                  (item as Map).cast<String, Object?>(),
                ),
              )
              .toList(),
      category: json["category"] == null ? null : json["category"] as String,
      createdAt: decodeDateTime(json["created_at"]),
      customData: json["custom_data"] == null
          ? null
          : core.CustomData.fromJson(json["custom_data"]),
      description:
          json["description"] == null ? null : json["description"] as String,
      dimensions: json["dimensions"] == null
          ? null
          : inttegro_product.Dimensions.fromJson(
              (json["dimensions"] as Map).cast<String, Object?>(),
            ),
      media: json["media"] == null
          ? null
          : inttegro_product.Media.fromJson(
              (json["media"] as Map).cast<String, Object?>()),
      name: json["name"] as String,
      publishedAt: json["published_at"] == null
          ? null
          : decodeDateTime(json["published_at"]),
      reference:
          json["reference"] == null ? null : json["reference"] as String,
      shipment: json["shipment"] == null
          ? null
          : inttegro_product.Shipment.fromJson(
              (json["shipment"] as Map).cast<String, Object?>(),
            ),
      taxCode: json["tax_code"] == null ? null : json["tax_code"] as String,
      type: inttegro_product.Type.fromJson(json["type"]),
      unitDim: json["unit_dim"] == null ? null : json["unit_dim"] as String,
      updatedAt: json["updated_at"] == null
          ? null
          : decodeDateTime(json["updated_at"]),
    );