You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mohemm-flutter-app/lib/models/chat/incoming_call_model.dart

334 lines
10 KiB
Dart

3 years ago
// To parse this JSON data, do
//
2 years ago
// final incomingCallModel = incomingCallModelFromJson(jsonString);
3 years ago
import 'dart:convert';
2 years ago
class IncomingCallModel {
String? actionColor;
String? appName;
Args? args;
String? avatar;
String? backgroundColor;
String? backgroundUrl;
int? duration;
Extra? extra;
String? from;
String? handle;
Args? headers;
String? id;
bool? isAccepted;
bool? isCustomNotification;
bool? isCustomSmallExNotification;
bool? isShowCallback;
bool? isShowLogo;
bool? isShowMissedCallNotification;
String? nameCaller;
String? ringtonePath;
String? textAccept;
String? textCallback;
String? textDecline;
String? textMissedCall;
int? type;
String? uuid;
IncomingCallModel({
this.actionColor,
3 years ago
this.appName,
2 years ago
this.args,
3 years ago
this.avatar,
2 years ago
this.backgroundColor,
this.backgroundUrl,
3 years ago
this.duration,
2 years ago
this.extra,
this.from,
this.handle,
this.headers,
this.id,
this.isAccepted,
this.isCustomNotification,
this.isCustomSmallExNotification,
this.isShowCallback,
this.isShowLogo,
this.isShowMissedCallNotification,
this.nameCaller,
this.ringtonePath,
3 years ago
this.textAccept,
2 years ago
this.textCallback,
3 years ago
this.textDecline,
this.textMissedCall,
2 years ago
this.type,
this.uuid,
3 years ago
});
2 years ago
factory IncomingCallModel.fromRawJson(String str) => IncomingCallModel.fromJson(json.decode(str));
3 years ago
String toRawJson() => json.encode(toJson());
2 years ago
factory IncomingCallModel.fromJson(Map<String, dynamic> json) => IncomingCallModel(
2 years ago
actionColor: json["actionColor"],
appName: json["appName"],
args: json["args"] == null ? null : Args.fromJson(json["args"]),
avatar: json["avatar"],
backgroundColor: json["backgroundColor"],
backgroundUrl: json["backgroundUrl"],
duration: json["duration"] == null ? null : json["duration"].toInt(),
extra: json["extra"] == null ? null : Extra.fromJson(json["extra"]),
from: json["from"],
handle: json["handle"],
headers: json["headers"] == null ? null : Args.fromJson(json["headers"]),
id: json["id"],
isAccepted: json["isAccepted"],
isCustomNotification: json["isCustomNotification"],
isCustomSmallExNotification: json["isCustomSmallExNotification"],
isShowCallback: json["isShowCallback"],
isShowLogo: json["isShowLogo"],
isShowMissedCallNotification: json["isShowMissedCallNotification"],
nameCaller: json["nameCaller"],
ringtonePath: json["ringtonePath"],
textAccept: json["textAccept"],
textCallback: json["textCallback"],
textDecline: json["textDecline"],
textMissedCall: json["textMissedCall"],
type: json["type"] == null ? null : json["type"].toInt(),
uuid: json["uuid"],
);
3 years ago
Map<String, dynamic> toJson() => {
2 years ago
"actionColor": actionColor,
"appName": appName,
"args": args?.toJson(),
"avatar": avatar,
"backgroundColor": backgroundColor,
"backgroundUrl": backgroundUrl,
"duration": duration,
"extra": extra?.toJson(),
"from": from,
"handle": handle,
"headers": headers?.toJson(),
"id": id,
"isAccepted": isAccepted,
"isCustomNotification": isCustomNotification,
"isCustomSmallExNotification": isCustomSmallExNotification,
"isShowCallback": isShowCallback,
"isShowLogo": isShowLogo,
"isShowMissedCallNotification": isShowMissedCallNotification,
"nameCaller": nameCaller,
"ringtonePath": ringtonePath,
"textAccept": textAccept,
"textCallback": textCallback,
"textDecline": textDecline,
"textMissedCall": textMissedCall,
"type": type,
"uuid": uuid,
};
3 years ago
}
2 years ago
class Args {
Args();
3 years ago
2 years ago
factory Args.fromRawJson(String str) => Args.fromJson(json.decode(str));
3 years ago
String toRawJson() => json.encode(toJson());
2 years ago
factory Args.fromJson(Map<String, dynamic> json) => Args();
3 years ago
2 years ago
Map<String, dynamic> toJson() => {};
3 years ago
}
class Extra {
2 years ago
LoginDetails? loginDetails;
bool? isIncomingCall;
CallerDetails? callerDetails;
2 years ago
String? callType;
2 years ago
3 years ago
Extra({
this.loginDetails,
2 years ago
this.isIncomingCall,
3 years ago
this.callerDetails,
2 years ago
this.callType,
3 years ago
});
factory Extra.fromRawJson(String str) => Extra.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory Extra.fromJson(Map<String, dynamic> json) => Extra(
2 years ago
loginDetails: json["loginDetails"] == null ? null : LoginDetails.fromJson(json["loginDetails"]),
isIncomingCall: json["isIncomingCall"],
2 years ago
callType: json["callType"],
2 years ago
callerDetails: json["callerDetails"] == null ? null : CallerDetails.fromJson(json["callerDetails"]),
);
3 years ago
Map<String, dynamic> toJson() => {
2 years ago
"loginDetails": loginDetails?.toJson(),
"isIncomingCall": isIncomingCall,
2 years ago
"callType": callType,
2 years ago
"callerDetails": callerDetails?.toJson(),
};
3 years ago
}
class CallerDetails {
2 years ago
int? userChatHistoryId;
String? contant;
FileTypeResponse? fileTypeResponse;
String? currentUserName;
String? targetUserEmail;
String? conversationId;
String? encryptedTargetUserId;
int? targetUserId;
bool? isSeen;
int? userChatHistoryLineId;
bool? isDelivered;
String? targetUserName;
int? currentUserId;
DateTime? createdDate;
String? currentUserEmail;
String? contantNo;
int? chatEventId;
String? encryptedTargetUserName;
int? chatSource;
3 years ago
CallerDetails({
this.userChatHistoryId,
this.contant,
2 years ago
this.fileTypeResponse,
3 years ago
this.currentUserName,
this.targetUserEmail,
2 years ago
this.conversationId,
this.encryptedTargetUserId,
this.targetUserId,
3 years ago
this.isSeen,
2 years ago
this.userChatHistoryLineId,
3 years ago
this.isDelivered,
2 years ago
this.targetUserName,
this.currentUserId,
3 years ago
this.createdDate,
2 years ago
this.currentUserEmail,
this.contantNo,
this.chatEventId,
this.encryptedTargetUserName,
3 years ago
this.chatSource,
});
factory CallerDetails.fromRawJson(String str) => CallerDetails.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory CallerDetails.fromJson(Map<String, dynamic> json) => CallerDetails(
2 years ago
userChatHistoryId: json["userChatHistoryId"] == null ? null : json["userChatHistoryId"].toInt(),
contant: json["contant"],
fileTypeResponse: json["fileTypeResponse"] == null ? null : FileTypeResponse.fromJson(json["fileTypeResponse"]),
currentUserName: json["currentUserName"],
targetUserEmail: json["targetUserEmail"],
conversationId: json["conversationId"],
encryptedTargetUserId: json["encryptedTargetUserId"],
targetUserId: json["targetUserId"] == null ? null : json["targetUserId"].toInt(),
isSeen: json["isSeen"],
userChatHistoryLineId: json["userChatHistoryLineId"] == null ? null : json["userChatHistoryLineId"].toInt(),
isDelivered: json["isDelivered"],
targetUserName: json["targetUserName"],
currentUserId: json["currentUserId"] == null ? null : json["currentUserId"].toInt(),
createdDate: json["createdDate"] == null ? null : DateTime.parse(json["createdDate"]),
currentUserEmail: json["currentUserEmail"],
contantNo: json["contantNo"],
chatEventId: json["chatEventId"] == null ? null : json["chatEventId"].toInt(),
encryptedTargetUserName: json["encryptedTargetUserName"],
chatSource: json["chatSource"] == null ? null : json["chatSource"].toInt(),
);
3 years ago
Map<String, dynamic> toJson() => {
2 years ago
"userChatHistoryId": userChatHistoryId,
"contant": contant,
"fileTypeResponse": fileTypeResponse?.toJson(),
"currentUserName": currentUserName,
"targetUserEmail": targetUserEmail,
"conversationId": conversationId,
"encryptedTargetUserId": encryptedTargetUserId,
"targetUserId": targetUserId,
"isSeen": isSeen,
"userChatHistoryLineId": userChatHistoryLineId,
"isDelivered": isDelivered,
"targetUserName": targetUserName,
"currentUserId": currentUserId,
"createdDate": createdDate?.toIso8601String(),
"currentUserEmail": currentUserEmail,
"contantNo": contantNo,
"chatEventId": chatEventId,
"encryptedTargetUserName": encryptedTargetUserName,
"chatSource": chatSource,
};
3 years ago
}
class FileTypeResponse {
2 years ago
int? fileTypeId;
3 years ago
FileTypeResponse({
this.fileTypeId,
});
factory FileTypeResponse.fromRawJson(String str) => FileTypeResponse.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory FileTypeResponse.fromJson(Map<String, dynamic> json) => FileTypeResponse(
2 years ago
fileTypeId: json["fileTypeId"].toInt(),
);
3 years ago
Map<String, dynamic> toJson() => {
2 years ago
"fileTypeId": fileTypeId,
};
3 years ago
}
class LoginDetails {
2 years ago
bool? isActiveCode;
int? id;
String? encryptedUserName;
String? userName;
String? title;
String? encryptedUserId;
String? email;
bool? isDomainUser;
String? token;
3 years ago
LoginDetails({
2 years ago
this.isActiveCode,
3 years ago
this.id,
2 years ago
this.encryptedUserName,
3 years ago
this.userName,
this.title,
this.encryptedUserId,
2 years ago
this.email,
this.isDomainUser,
this.token,
3 years ago
});
factory LoginDetails.fromRawJson(String str) => LoginDetails.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory LoginDetails.fromJson(Map<String, dynamic> json) => LoginDetails(
2 years ago
isActiveCode: json["isActiveCode"],
id: json["id"] == null ? null : json["id"].toInt(),
encryptedUserName: json["encryptedUserName"],
userName: json["userName"],
title: json["title"],
encryptedUserId: json["encryptedUserId"],
email: json["email"],
isDomainUser: json["isDomainUser"],
token: json["token"],
);
3 years ago
Map<String, dynamic> toJson() => {
2 years ago
"isActiveCode": isActiveCode,
"id": id,
"encryptedUserName": encryptedUserName,
"userName": userName,
"title": title,
"encryptedUserId": encryptedUserId,
"email": email,
"isDomainUser": isDomainUser,
"token": token,
};
3 years ago
}