GoogleCloudRecommendationengineV1beta1ProductCatalogItem.fromJson constructor

GoogleCloudRecommendationengineV1beta1ProductCatalogItem.fromJson(
  1. Map _json
)

Implementation

GoogleCloudRecommendationengineV1beta1ProductCatalogItem.fromJson(
    core.Map _json)
    : this(
        availableQuantity: _json.containsKey('availableQuantity')
            ? _json['availableQuantity'] as core.String
            : null,
        canonicalProductUri: _json.containsKey('canonicalProductUri')
            ? _json['canonicalProductUri'] as core.String
            : null,
        costs: _json.containsKey('costs')
            ? (_json['costs'] as core.Map<core.String, core.dynamic>).map(
                (key, item) => core.MapEntry(
                  key,
                  (item as core.num).toDouble(),
                ),
              )
            : null,
        currencyCode: _json.containsKey('currencyCode')
            ? _json['currencyCode'] as core.String
            : null,
        exactPrice: _json.containsKey('exactPrice')
            ? GoogleCloudRecommendationengineV1beta1ProductCatalogItemExactPrice
                .fromJson(_json['exactPrice']
                    as core.Map<core.String, core.dynamic>)
            : null,
        images: _json.containsKey('images')
            ? (_json['images'] as core.List)
                .map<GoogleCloudRecommendationengineV1beta1Image>((value) =>
                    GoogleCloudRecommendationengineV1beta1Image.fromJson(
                        value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        priceRange: _json.containsKey('priceRange')
            ? GoogleCloudRecommendationengineV1beta1ProductCatalogItemPriceRange
                .fromJson(_json['priceRange']
                    as core.Map<core.String, core.dynamic>)
            : null,
        stockState: _json.containsKey('stockState')
            ? _json['stockState'] as core.String
            : null,
      );