// To parse this JSON data, do
//
//     final branch = branchFromJson(jsonString);

import 'dart:convert';

Branch branchFromJson(String str) => Branch.fromJson(json.decode(str));

String branchToJson(Branch data) => json.encode(data.toJson());

class Branch {
  Branch({
    this.totalItemsCount,
    this.data,
    this.messageStatus,
    this.message,
  });

  int? totalItemsCount;
  List<BranchData>? data;
  int? messageStatus;
  String? message;

  factory Branch.fromJson(Map<String, dynamic> json) => Branch(
    totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
    data: json["data"] == null ? null : List<BranchData>.from(json["data"].map((x) => BranchData.fromJson(x))),
    messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
    message: json["message"] == null ? null : json["message"],
  );

  Map<String, dynamic> toJson() => {
    "totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
    "data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
    "messageStatus": messageStatus == null ? null : messageStatus,
    "message": message == null ? null : message,
  };
}

class BranchData {
  BranchData({
    this.id,
    this.serviceProviderId,
    this.branchName,
    this.branchDescription,
    this.countryID,
    this.cityId,
    this.address,
    this.latitude,
    this.longitude,
    this.status,
  });

  int? id;
  int? serviceProviderId;
  String? branchName;
  String? branchDescription;
  int? countryID;
  int? cityId;
  String? address;
  String? latitude;
  String? longitude;
  int? status;


  factory BranchData.fromJson(Map<String, dynamic> json) => BranchData(
    id: json["id"] == null ? null : json["id"],
    serviceProviderId: json["serviceProviderID"] == null ? null : json["serviceProviderID"],
    branchName: json["branchName"] == null ? null : json["branchName"],
    branchDescription: json["branchDescription"] == null ? null : json["branchDescription"],
    countryID: json["countryID"] == null ? null : json["countryID"],
    cityId: json["cityID"] == null ? null : json["cityID"],
    address: json["address"] == null ? null : json["address"],
    latitude: json["latitude"] == null ? null : json["latitude"],
    longitude: json["longitude"] == null ? null : json["longitude"],
    status: json["status"] == null ? null : json["status"],
  );

  Map<String, dynamic> toJson() => {
    "id": id == null ? null : id,
    "serviceProviderID": serviceProviderId == null ? null : serviceProviderId,
    "branchName": branchName == null ? null : branchName,
    "branchDescription": branchDescription == null ? null : branchDescription,
    "cityID": cityId == null ? null : cityId,
    "address": address == null ? null : address,
    "latitude": latitude == null ? null : latitude,
    "longitude": longitude == null ? null : longitude,
    "status": status == null ? null : status,
  };
}
