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;
020import java.math.BigDecimal;
021
022/**
023 * Response object constructed from the JSON payload returned for Standard number insight requests.
024 */
025public class StandardInsightResponse extends BasicInsightResponse {
026    private BigDecimal requestPrice, remainingBalance, refundPrice;
027    private CarrierDetails originalCarrier, currentCarrier;
028    private PortedStatus ported;
029    private CallerIdentity callerIdentity;
030    private String callerName, firstName, lastName;
031    private CallerType callerType;
032
033    public static StandardInsightResponse fromJson(String json) {
034        return Jsonable.fromJson(json);
035    }
036
037    /**
038     * @return The amount in EUR charged to your account.
039     */
040    @JsonProperty("request_price")
041    public BigDecimal getRequestPrice() {
042        return requestPrice;
043    }
044
045    /**
046     * @return Your account balance in EUR after this request.
047     */
048    @JsonProperty("remaining_balance")
049    public BigDecimal getRemainingBalance() {
050        return remainingBalance;
051    }
052
053    /**
054     * @return Information about the network the number was initially connected to.
055     */
056    @JsonProperty("original_carrier")
057    public CarrierDetails getOriginalCarrier() {
058        return originalCarrier;
059    }
060
061    /**
062     * @return Information about the network the number is currently connected to.
063     */
064    @JsonProperty("current_carrier")
065    public CarrierDetails getCurrentCarrier() {
066        return currentCarrier;
067    }
068
069    /**
070     * @return Whether the number has been ported, as an enum.
071     */
072    @JsonProperty("ported")
073    public PortedStatus getPorted() {
074        return ported;
075    }
076
077    /**
078     * @return Information about the caller.
079     */
080    @JsonProperty("caller_identity")
081    public CallerIdentity getCallerIdentity() {
082        return callerIdentity;
083    }
084
085    /**
086     * @return If there is an internal lookup error, the refund_price will reflect the lookup price.
087     * If cnam is requested for a non-US number the refund_price will reflect the cnam price.
088     * If both of these conditions occur, refund_price is the sum of the lookup price and cnam price.
089     */
090    @JsonProperty("refund_price")
091    public BigDecimal getRefundPrice() {
092        return refundPrice;
093    }
094
095    /**
096     * @return Full name of the person or business who owns the phone number, or "unknown" if this
097     * information is not available. This parameter is only present if cnam had a value of
098     * {@code true} in the request.
099     */
100    @JsonProperty("caller_name")
101    public String getCallerName() {
102        return callerName;
103    }
104
105    /**
106     * @return First name of the person who owns the phone number if the owner is an individual.
107     * This parameter is only present if cnam had a value of {@code true} in the request.
108     */
109    @JsonProperty("first_name")
110    public String getFirstName() {
111        return firstName;
112    }
113
114    /**
115     * @return Last name of the person who owns the phone number if the owner is an individual.
116     * This parameter is only present if cnam had a value of {@code true} in the request.
117     */
118    @JsonProperty("last_name")
119    public String getLastName() {
120        return lastName;
121    }
122
123    /**
124     * @return The caller type, as an enum.
125     */
126    @JsonProperty("caller_type")
127    public CallerType getCallerType() {
128        return callerType;
129    }
130}