Ejemplo n.º 1
0
        public CfNumberQueryResult SearchAvailableNumbers(CfSearchAvailableNumbers searchAvailableNumbers)
        {
            var resourceList = BaseRequest <ResourceList>(HttpMethod.Get, new SearchAvailableNumbers(searchAvailableNumbers),
                                                          new CallfireRestRoute <Number>(null, NumberRestRouteObjects.Search, null));

            var number = resourceList.Resource == null ? null
                : resourceList.Resource.Select(r => NumberMapper.FromNumber((Number)r)).ToArray();

            return(new CfNumberQueryResult(resourceList.TotalResults, number));
        }
Ejemplo n.º 2
0
        public CfNumberQueryResult QueryNumbers(CfQueryNumbers queryNumbers)
        {
            var resourceList = BaseRequest <ResourceList>(HttpMethod.Get, new QueryNumbers(queryNumbers),
                                                          new CallfireRestRoute <Number>());

            var number = resourceList.Resource == null ? null
                : resourceList.Resource.Select(r => NumberMapper.FromNumber((Number)r)).ToArray();

            return(new CfNumberQueryResult(resourceList.TotalResults, number));
        }
Ejemplo n.º 3
0
        public CfNumber GetNumber(string number)
        {
            if (String.IsNullOrEmpty(number))
            {
                return(null);
            }
            var resource = BaseRequest <Resource>(HttpMethod.Get, null, new CallfireRestRoute <Number>(long.Parse(number)));

            return(NumberMapper.FromNumber((Number)resource.Resources));
        }
 public CfNumber GetNumber(string number)
 {
     return(NumberMapper.FromNumber(NumberService.GetNumber(new GetNumber(number))));
 }