// To parse this JSON data, do
//
//     final structureMaterials = structureMaterialsFromJson(jsonString);

import 'package:meta/meta.dart';
import 'dart:convert';

StructureMaterials structureMaterialsFromJson(String str) =>
    StructureMaterials.fromJson(json.decode(str));

String structureMaterialsToJson(StructureMaterials data) =>
    json.encode(data.toJson());

class StructureMaterials {
  final int? id;
  final int? bldgapprDetailsId;
  final String? foundation;
  final String? columns;
  final String? beams;
  final String? trussFraming;
  final String? roof;
  final String? flooring;
  final String? walls;
  final String? others;
  final String? genCode;

  StructureMaterials(
      {this.id,
      this.bldgapprDetailsId,
      this.foundation,
      this.columns,
      this.beams,
      this.trussFraming,
      this.roof,
      this.flooring,
      this.walls,
      this.others,
      this.genCode});

  StructureMaterials copy(
          {int? id,
          int? bldgapprDetailsId,
          String? foundation,
          String? columns,
          String? beams,
          String? trussFraming,
          String? roof,
          String? flooring,
          String? walls,
          String? others,
          String? genCode}) =>
      StructureMaterials(
          id: id ?? this.id,
          bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
          foundation: foundation ?? this.foundation,
          columns: columns ?? this.columns,
          beams: beams ?? this.beams,
          trussFraming: trussFraming ?? this.trussFraming,
          roof: roof ?? this.roof,
          flooring: flooring ?? this.flooring,
          walls: walls ?? this.walls,
          others: others ?? this.others,
          genCode: genCode ?? this.genCode);

  factory StructureMaterials.fromJson(Map<String, dynamic> json) =>
      StructureMaterials(
          id: json["id"],
          bldgapprDetailsId: json["bldgappr_details_id"],
          foundation: json["foundation"],
          columns: json["columns"],
          beams: json["beams"],
          trussFraming: json["truss_framing"],
          roof: json["roof"],
          flooring: json["flooring"],
          walls: json["walls"],
          others: json["others"],
          genCode: json["gen_code"]);

  factory StructureMaterials.fromJson2(Map<String, dynamic> json) =>
      StructureMaterials(
          id: json["id"],
          bldgapprDetailsId: json["bldgapprDetailsId"],
          foundation: json["foundation"],
          columns: json["columns"],
          beams: json["beams"],
          trussFraming: json["trussFraming"],
          roof: json["roof"],
          flooring: json["flooring"],
          walls: json["walls"],
          others: json["others"],
          genCode: json["gen_code"]);

  Map<String, dynamic> toJson() => {
        "id": id,
        "bldgappr_details_id": bldgapprDetailsId,
        "foundation": foundation,
        "columns": columns,
        "beams": beams,
        "truss_framing": trussFraming,
        "roof": roof,
        "flooring": flooring,
        "walls": walls,
        "others": others,
        "gen_code": genCode,
      };
}
