fromJson static method

AssetsUpdate? fromJson(
  1. dynamic value
)

Returns a new AssetsUpdate instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static AssetsUpdate? fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();

    // Ensure that the map contains the required keys.
    // Note 1: the values aren't checked for validity beyond being non-null.
    // Note 2: this code is stripped in release mode!
    assert(() {
      return true;
    }());

    return AssetsUpdate(
      userId: mapValueOfType<String>(json, r'user_id'),
      companyId: mapValueOfType<String>(json, r'company_id'),
      connectionId: mapValueOfType<String>(json, r'connection_id'),
      industryId: mapValueOfType<int>(json, r'industry_id'),
      aucId: mapValueOfType<int>(json, r'auc_id'),
      functionId: mapValueOfType<String>(json, r'function_id'),
      approvalStatus: AssetsUpdateApprovalStatusEnum.fromJson(json[r'approval_status']),
      approvedByUserId: mapValueOfType<String>(json, r'approved_by_user_id'),
      approvedAt: mapDateTime(json, r'approved_at', r''),
      name: mapValueOfType<String>(json, r'name'),
      slug: mapValueOfType<String>(json, r'slug'),
      description: mapValueOfType<String>(json, r'description'),
      detailedDescription: mapValueOfType<String>(json, r'detailed_description'),
      source_: AssetsUpdateSource_Enum.fromJson(json[r'source']),
      assetType: AssetsUpdateAssetTypeEnum.fromJson(json[r'asset_type']),
      assetSchema: mapValueOfType<Object>(json, r'asset_schema'),
      tags: mapValueOfType<String>(json, r'tags'),
      topQuestions: mapValueOfType<String>(json, r'top_questions'),
      shortCode: mapValueOfType<String>(json, r'short_code'),
      restrictedDomains: mapValueOfType<String>(json, r'restricted_domains'),
      sqlLogic: mapValueOfType<String>(json, r'sql_logic'),
      sourceSchemaName: mapValueOfType<String>(json, r'source_schema_name'),
      sourceTableName: mapValueOfType<String>(json, r'source_table_name'),
      sellInMarketplace: mapValueOfType<bool>(json, r'sell_in_marketplace'),
      requireCustomization: mapValueOfType<bool>(json, r'require_customization'),
      vizSpec: mapValueOfType<Object>(json, r'viz_spec'),
      vizChartLibrary: AssetsUpdateVizChartLibraryEnum.fromJson(json[r'viz_chart_library']),
      vizChartType: AssetsUpdateVizChartTypeEnum.fromJson(json[r'viz_chart_type']),
      vizDepVarColName: mapValueOfType<String>(json, r'viz_dep_var_col_name'),
      vizIndepVarColName: mapValueOfType<String>(json, r'viz_indep_var_col_name'),
      vizSizeColName: mapValueOfType<String>(json, r'viz_size_col_name'),
      vizColorColName: mapValueOfType<String>(json, r'viz_color_col_name'),
      vizDataAggregation: AssetsUpdateVizDataAggregationEnum.fromJson(json[r'viz_data_aggregation']),
      vizSortDirection: AssetsUpdateVizSortDirectionEnum.fromJson(json[r'viz_sort_direction']),
      vizDataLimit: mapValueOfType<int>(json, r'viz_data_limit'),
      vizColorScheme: AssetsUpdateVizColorSchemeEnum.fromJson(json[r'viz_color_scheme']),
      vizShowLegend: mapValueOfType<bool>(json, r'viz_show_legend'),
      vizShowGrid: mapValueOfType<bool>(json, r'viz_show_grid'),
      vizShowTrendline: mapValueOfType<bool>(json, r'viz_show_trendline'),
      vizLineSmoothing: mapValueOfType<bool>(json, r'viz_line_smoothing'),
      vizBarStacked: mapValueOfType<bool>(json, r'viz_bar_stacked'),
      vizFilterDirection: AssetsUpdateVizFilterDirectionEnum.fromJson(json[r'viz_filter_direction']),
      allowParams: mapValueOfType<bool>(json, r'allow_params'),
      acceptTerms: mapValueOfType<bool>(json, r'accept_terms'),
      cached: mapValueOfType<bool>(json, r'cached'),
      schedule: mapValueOfType<String>(json, r'schedule'),
      nextRun: mapDateTime(json, r'next_run', r''),
      dataTimePeriodStart: mapDateTime(json, r'data_time_period_start', r''),
      dataTimePeriodEnd: mapDateTime(json, r'data_time_period_end', r''),
      dateCollectionStart: mapDateTime(json, r'date_collection_start', r''),
      geographicCoverageType: AssetsUpdateGeographicCoverageTypeEnum.fromJson(json[r'geographic_coverage_type']),
      geographicCoverageDetails: mapValueOfType<String>(json, r'geographic_coverage_details'),
      dataSourceRefreshFrequency: AssetsUpdateDataSourceRefreshFrequencyEnum.fromJson(json[r'data_source_refresh_frequency']),
      rateLimitNumber: mapValueOfType<int>(json, r'rate_limit_number'),
      rateLimitPeriod: AssetsUpdateRateLimitPeriodEnum.fromJson(json[r'rate_limit_period']),
      rateLimitGranularity: AssetsUpdateRateLimitGranularityEnum.fromJson(json[r'rate_limit_granularity']),
    );
  }
  return null;
}