toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final budgetName = this.budgetName;
  final budgetType = this.budgetType;
  final timeUnit = this.timeUnit;
  final budgetLimit = this.budgetLimit;
  final calculatedSpend = this.calculatedSpend;
  final costFilters = this.costFilters;
  final costTypes = this.costTypes;
  final lastUpdatedTime = this.lastUpdatedTime;
  final plannedBudgetLimits = this.plannedBudgetLimits;
  final timePeriod = this.timePeriod;
  return {
    'BudgetName': budgetName,
    'BudgetType': budgetType.toValue(),
    'TimeUnit': timeUnit.toValue(),
    if (budgetLimit != null) 'BudgetLimit': budgetLimit,
    if (calculatedSpend != null) 'CalculatedSpend': calculatedSpend,
    if (costFilters != null) 'CostFilters': costFilters,
    if (costTypes != null) 'CostTypes': costTypes,
    if (lastUpdatedTime != null)
      'LastUpdatedTime': unixTimestampToJson(lastUpdatedTime),
    if (plannedBudgetLimits != null)
      'PlannedBudgetLimits': plannedBudgetLimits,
    if (timePeriod != null) 'TimePeriod': timePeriod,
  };
}