001/* 002 * Copyright 2024 Vonage 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package com.vonage.client.insight; 017 018import com.fasterxml.jackson.annotation.JsonProperty; 019import com.vonage.client.Jsonable; 020 021/** 022 * Response object constructed from the JSON payload returned for Advanced number insight requests. 023 */ 024public class AdvancedInsightResponse extends StandardInsightResponse { 025 private Validity validNumber; 026 private Reachability reachability; 027 private LookupOutcome lookupOutcome; 028 private String lookupOutcomeMessage; 029 private RoamingDetails roaming; 030 private RealTimeData realTimeData; 031 private String errorText; 032 033 public static AdvancedInsightResponse fromJson(String json) { 034 return Jsonable.fromJson(json); 035 } 036 037 /** 038 * @return Whether the number exists, as an enum. 039 */ 040 @JsonProperty("valid_number") 041 public Validity getValidNumber() { 042 return validNumber; 043 } 044 045 /** 046 * @return Whether the number can be called, as an enum. 047 */ 048 @JsonProperty("reachable") 049 public Reachability getReachability() { 050 return reachability; 051 } 052 053 /** 054 * @return The outcome, as an enum. 055 */ 056 @JsonProperty("lookup_outcome") 057 public LookupOutcome getLookupOutcome() { 058 return lookupOutcome; 059 } 060 061 /** 062 * @return Shows if all information about a phone number has been returned, as a String. 063 */ 064 @JsonProperty("lookup_outcome_message") 065 public String getLookupOutcomeMessage() { 066 return lookupOutcomeMessage; 067 } 068 069 /** 070 * @return The roaming information, as an enum. 071 */ 072 @JsonProperty("roaming") 073 public RoamingDetails getRoaming() { 074 return roaming; 075 } 076 077 /** 078 * @return Real-time data about the number if it was requested, {@code null} otherwise. 079 */ 080 @JsonProperty("real_time_data") 081 public RealTimeData getRealTimeData() { 082 return realTimeData; 083 } 084 085 /** 086 * @return The status description of your request. 087 * This field is equivalent to status_message field in the other endpoints. 088 */ 089 @JsonProperty("error_text") 090 public String getErrorText() { 091 return errorText; 092 } 093}