All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bandwidth.iris.sdk.model.AvailableNumbers Maven / Gradle / Ivy

There is a newer version: 4.2.0
Show newest version
package com.bandwidth.iris.sdk.model;

import com.bandwidth.iris.sdk.IrisClient;
import com.bandwidth.iris.sdk.IrisPath;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by sbarstow on 11/19/14.
 */
public class AvailableNumbers {
    public static List search(IrisClient client, Map query) throws Exception {

        List numbersList;

        boolean returnDetails = query.get("enableTNDetail") != null ? Boolean.valueOf(query.get("enableTNDetail").toString()) : false;

        String searchUri = client.buildAccountModelUri(new String[] { IrisPath.AVAILABLE_NUMBERS_URI_PATH }, query);

        SearchResult result = client.get(searchUri, SearchResult.class);

        numbersList = returnDetails ? result.getTelephoneNumberDetailList() : result.getTelephoneNumberList();
        return numbersList;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy