Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/rest/lookups/v2/phoneNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,14 @@ export class PhoneNumberContextImpl implements PhoneNumberContext {

interface PhoneNumberPayload extends PhoneNumberResource {}

interface LineTypeIntelligenceResource {
mobile_country_code?: string;
mobile_network_code?: string;
carrier_name?: string;
type?: string;
error_code?: number;
}

interface PhoneNumberResource {
calling_country_code: string;
country_code: string;
Expand All @@ -277,7 +285,7 @@ interface PhoneNumberResource {
caller_name: CallerNameInfo;
sim_swap: SimSwapInfo;
call_forwarding: CallForwardingInfo;
line_type_intelligence: LineTypeIntelligenceInfo;
line_type_intelligence: LineTypeIntelligenceResource;
line_status: LineStatusInfo;
identity_match: IdentityMatchInfo;
reassigned_number: ReassignedNumberInfo;
Expand Down Expand Up @@ -305,7 +313,15 @@ export class PhoneNumberInstance {
this.callerName = payload.caller_name;
this.simSwap = payload.sim_swap;
this.callForwarding = payload.call_forwarding;
this.lineTypeIntelligence = payload.line_type_intelligence;
this.lineTypeIntelligence = payload.line_type_intelligence
? {
mobileCountryCode: payload.line_type_intelligence.mobile_country_code,
mobileNetworkCode: payload.line_type_intelligence.mobile_network_code,
carrierName: payload.line_type_intelligence.carrier_name,
type: payload.line_type_intelligence.type,
errorCode: payload.line_type_intelligence.error_code,
}
: undefined;
this.lineStatus = payload.line_status;
this.identityMatch = payload.identity_match;
this.reassignedNumber = payload.reassigned_number;
Expand Down