PhoneNumber.fromJson constructor

PhoneNumber.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory PhoneNumber.fromJson(Map<String, dynamic> json) {
  return PhoneNumber(
    associations: (json['Associations'] as List?)
        ?.whereNotNull()
        .map(
            (e) => PhoneNumberAssociation.fromJson(e as Map<String, dynamic>))
        .toList(),
    callingName: json['CallingName'] as String?,
    callingNameStatus:
        (json['CallingNameStatus'] as String?)?.toCallingNameStatus(),
    capabilities: json['Capabilities'] != null
        ? PhoneNumberCapabilities.fromJson(
            json['Capabilities'] as Map<String, dynamic>)
        : null,
    createdTimestamp: timeStampFromJson(json['CreatedTimestamp']),
    deletionTimestamp: timeStampFromJson(json['DeletionTimestamp']),
    e164PhoneNumber: json['E164PhoneNumber'] as String?,
    phoneNumberId: json['PhoneNumberId'] as String?,
    productType: (json['ProductType'] as String?)?.toPhoneNumberProductType(),
    status: (json['Status'] as String?)?.toPhoneNumberStatus(),
    type: (json['Type'] as String?)?.toPhoneNumberType(),
    updatedTimestamp: timeStampFromJson(json['UpdatedTimestamp']),
  );
}