public void Find()
 {
     var request = new CommonFindRequest();
     Page<KeywordLease> keywordLeases = Client.KeywordLeasesApi.Find(request);
     Assert.NotNull(keywordLeases);
     Console.WriteLine("Page of keywordLeases:" + keywordLeases);
 }
        public void FindApiCredentials()
        {
            var request = new CommonFindRequest();
            Page <ApiCredentials> apiCredentials = Client.MeApi.FindApiCredentials(request);

            Console.WriteLine("Page of credentials:" + apiCredentials);
        }
        public void Find()
        {
            var request = new CommonFindRequest();
            Page <KeywordLease> keywordLeases = Client.KeywordLeasesApi.Find(request);

            Assert.NotNull(keywordLeases);
            Console.WriteLine("Page of keywordLeases:" + keywordLeases);
        }
 public static void Main(string[] args)
 {
     var client  = new CallfireClient("account_login", "account_password");
     var request = new CommonFindRequest {
         Fields = "name,enabled"
     };
     Page <ApiCredentials> apiCredentials = client.MeApi.FindApiCredentials(request);
 }
        public void FindTollfreeNumbers()
        {
            var request = new CommonFindRequest { Limit = 2 };
            var numbers = Client.NumbersApi.FindNumbersTollfree(request);
            Assert.AreEqual(2, numbers.Count);

            Console.WriteLine(numbers);
        }
 public static void Main(string[] args)
 {
     var client  = new CallfireClient("api_login", "api_password");
     var request = new CommonFindRequest
     {
         Offset = 0,
         Limit  = 10,
         Fields = "items(keyword,leaseBegin,leaseEnd)"
     };
     Page <KeywordLease> leases = client.KeywordLeasesApi.Find(request);
 }
        public void FindObsoleteTollfreeNumbers()
        {
            var request = new CommonFindRequest {
                Limit = 2
            };
            var numbers = Client.NumbersApi.FindNumbersTollfree(request);

            Assert.AreEqual(2, numbers.Count);

            Console.WriteLine(numbers);
        }
 public void FindApiCredentials()
 {
     string expectedJson = GetJsonPayload("/account/meApi/response/findApiCredentials.json");
     var restRequest = MockRestResponse(expectedJson);
     var request = new CommonFindRequest
     {
         Limit = 1L,
         Offset = 5L
     };
     Page<ApiCredentials> apiCredentials = Client.MeApi.FindApiCredentials(request);
     Assert.That(Serializer.Serialize(apiCredentials), Is.EqualTo(expectedJson));
     Assert.AreEqual(Method.GET, restRequest.Value.Method);
     Assert.That(restRequest.Value.Parameters, Has.Some.Matches<Parameter>(p => p.Name.Equals("limit") && p.Value.Equals("1")));
     Assert.That(restRequest.Value.Parameters, Has.Some.Matches<Parameter>(p => p.Name.Equals("offset") && p.Value.Equals("5")));
 }
Beispiel #9
0
        public void FindApiCredentials()
        {
            string expectedJson = GetJsonPayload("/account/meApi/response/findApiCredentials.json");
            var    restRequest  = MockRestResponse(expectedJson);
            var    request      = new CommonFindRequest
            {
                Limit  = 1L,
                Offset = 5L
            };
            Page <ApiCredentials> apiCredentials = Client.MeApi.FindApiCredentials(request);

            Assert.That(Serializer.Serialize(apiCredentials), Is.EqualTo(expectedJson));
            Assert.AreEqual(Method.GET, restRequest.Value.Method);
            Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("limit") && p.Value.Equals("1")));
            Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("offset") && p.Value.Equals("5")));
        }
Beispiel #10
0
        public void Find()
        {
            string expectedJson = GetJsonPayload("/keywords/keywordLeasesApi/response/findKeywordLeases.json");
            var    restRequest  = MockRestResponse(expectedJson);
            var    request      = new CommonFindRequest
            {
                Limit  = 5L,
                Offset = 0L,
                Fields = FIELDS
            };
            Page <KeywordLease> keywordLeases = Client.KeywordLeasesApi.Find(request);

            Assert.That(Serializer.Serialize(keywordLeases), Is.EqualTo(expectedJson));
            Assert.AreEqual(Method.GET, restRequest.Value.Method);
            Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("limit") && p.Value.Equals("5")));
            Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("offset") && p.Value.Equals("0")));
            Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("fields") && p.Value.Equals(FIELDS)));
        }
        public void FindNumbersTollfree()
        {
            var expectedJson = GetJsonPayload("/numbers/numbersApi/response/findNumbersTollfree.json");
            var restRequest = MockRestResponse(expectedJson);

            var request = new CommonFindRequest
            {
                Limit = 1,
                Offset = 2
            };
            var numbers = Client.NumbersApi.FindNumbersTollfree(request);
            Assert.That(Serializer.Serialize(new ListHolder<Number>(numbers)), Is.EqualTo(expectedJson));

            Assert.AreEqual(Method.GET, restRequest.Value.Method);
            var requestBodyParam = restRequest.Value.Parameters.FirstOrDefault(p => p.Type == ParameterType.RequestBody);
            Assert.IsNull(requestBodyParam);
            Assert.That(restRequest.Value.Parameters, Has.Some.Matches<Parameter>(p => p.Name.Equals("limit") && p.Value.Equals("1")));
            Assert.That(restRequest.Value.Parameters, Has.Some.Matches<Parameter>(p => p.Name.Equals("offset") && p.Value.Equals("2")));
        }
        public void FindNumbersTollfree()
        {
            var expectedJson = GetJsonPayload("/numbers/numbersApi/response/findNumbersTollfree.json");
            var restRequest  = MockRestResponse(expectedJson);

            var request = new CommonFindRequest
            {
                Limit  = 1,
                Offset = 2
            };
            var numbers = Client.NumbersApi.FindNumbersTollfree(request);

            Assert.That(Serializer.Serialize(new ListHolder <Number>(numbers)), Is.EqualTo(expectedJson));

            Assert.AreEqual(Method.GET, restRequest.Value.Method);
            var requestBodyParam = restRequest.Value.Parameters.FirstOrDefault(p => p.Type == ParameterType.RequestBody);

            Assert.IsNull(requestBodyParam);
            Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("limit") && p.Value.Equals("1")));
            Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("offset") && p.Value.Equals("2")));
        }
 /// <summary>
 /// Find API credentials associated with current account
 /// </summary>
 /// <param name="request">request with properties to filter</param>
 /// <returns>paged credentials list</returns>
 /// <exception cref="BadRequestException">          in case HTTP response code is 400 - Bad request, the request was formatted improperly.</exception>
 /// <exception cref="UnauthorizedException">        in case HTTP response code is 401 - Unauthorized, API Key missing or invalid.</exception>
 /// <exception cref="AccessForbiddenException">     in case HTTP response code is 403 - Forbidden, insufficient permissions.</exception>
 /// <exception cref="ResourceNotFoundException">    in case HTTP response code is 404 - NOT FOUND, the resource requested does not exist.</exception>
 /// <exception cref="InternalServerErrorException"> in case HTTP response code is 500 - Internal Server Error.</exception>
 /// <exception cref="CallfireApiException">         in case HTTP response code is something different from codes listed above.</exception>
 /// <exception cref="CallfireClientException">      in case error has occurred in client.</exception>
 public Page<ApiCredentials> FindApiCredentials(CommonFindRequest request)
 {
     return Client.Get<Page<ApiCredentials>>(ME_API_CREDS_PATH, request);
 }
Beispiel #14
0
 /// <summary>
 /// Find all owned keyword leases for a user. A keyword lease is the ownership information involving a keyword.
 /// </summary>
 /// <param name="request">request payload</param>
 /// <returns>paged list with keyword lease objects</returns>
 /// <exception cref="BadRequestException">          in case HTTP response code is 400 - Bad request, the request was formatted improperly.</exception>
 /// <exception cref="UnauthorizedException">        in case HTTP response code is 401 - Unauthorized, API Key missing or invalid.</exception>
 /// <exception cref="AccessForbiddenException">     in case HTTP response code is 403 - Forbidden, insufficient permissions.</exception>
 /// <exception cref="ResourceNotFoundException">    in case HTTP response code is 404 - NOT FOUND, the resource requested does not exist.</exception>
 /// <exception cref="InternalServerErrorException"> in case HTTP response code is 500 - Internal Server Error.</exception>
 /// <exception cref="CallfireApiException">         in case HTTP response code is something different from codes listed above.</exception>
 /// <exception cref="CallfireClientException">      in case error has occurred in client.</exception>
 public Page <KeywordLease> Find(CommonFindRequest request)
 {
     return(Client.Get <Page <KeywordLease> >(KEYWORD_LEASES_PATH, request));
 }
 public void FindApiCredentials()
 {
     var request = new CommonFindRequest();
     Page<ApiCredentials> apiCredentials = Client.MeApi.FindApiCredentials(request);
     Console.WriteLine("Page of credentials:" + apiCredentials);
 }
 /// <summary>
 /// Find all owned keyword leases for a user. A keyword lease is the ownership information involving a keyword.
 /// </summary>
 /// <param name="request">request payload</param>
 /// <returns>paged list with keyword lease objects</returns>
 /// <exception cref="BadRequestException">          in case HTTP response code is 400 - Bad request, the request was formatted improperly.</exception>
 /// <exception cref="UnauthorizedException">        in case HTTP response code is 401 - Unauthorized, API Key missing or invalid.</exception>
 /// <exception cref="AccessForbiddenException">     in case HTTP response code is 403 - Forbidden, insufficient permissions.</exception>
 /// <exception cref="ResourceNotFoundException">    in case HTTP response code is 404 - NOT FOUND, the resource requested does not exist.</exception>
 /// <exception cref="InternalServerErrorException"> in case HTTP response code is 500 - Internal Server Error.</exception>
 /// <exception cref="CallfireApiException">         in case HTTP response code is something different from codes listed above.</exception>
 /// <exception cref="CallfireClientException">      in case error has occurred in client.</exception>
 public Page<KeywordLease> Find(CommonFindRequest request)
 {
     return Client.Get<Page<KeywordLease>>(KEYWORD_LEASES_PATH, request);
 }
 /// <summary>
 /// Find numbers in the CallFire tollfree numbers catalog that are available for purchase.
 /// </summary>
 /// <param name="request">request object</param>
 /// <returns>list of numbers</returns>
 /// <exception cref="BadRequestException">          in case HTTP response code is 400 - Bad request, the request was formatted improperly.</exception>
 /// <exception cref="UnauthorizedException">        in case HTTP response code is 401 - Unauthorized, API Key missing or invalid.</exception>
 /// <exception cref="AccessForbiddenException">     in case HTTP response code is 403 - Forbidden, insufficient permissions.</exception>
 /// <exception cref="ResourceNotFoundException">    in case HTTP response code is 404 - NOT FOUND, the resource requested does not exist.</exception>
 /// <exception cref="InternalServerErrorException"> in case HTTP response code is 500 - Internal Server Error.</exception>
 /// <exception cref="CallfireApiException">         in case HTTP response code is something different from codes listed above.</exception>
 /// <exception cref="CallfireClientException">      in case error has occurred in client.</exception>
 public IList<Number> FindNumbersTollfree(CommonFindRequest request)
 {
     return Client.Get<ListHolder<Number>>(NUMBERS_TOLLFREE_PATH, request).Items;
 }
Beispiel #18
0
 /// <summary>
 /// Find numbers in the CallFire tollfree numbers catalog that are available for purchase.
 /// </summary>
 /// <param name="request">request object</param>
 /// <returns>list of numbers</returns>
 /// <exception cref="BadRequestException">          in case HTTP response code is 400 - Bad request, the request was formatted improperly.</exception>
 /// <exception cref="UnauthorizedException">        in case HTTP response code is 401 - Unauthorized, API Key missing or invalid.</exception>
 /// <exception cref="AccessForbiddenException">     in case HTTP response code is 403 - Forbidden, insufficient permissions.</exception>
 /// <exception cref="ResourceNotFoundException">    in case HTTP response code is 404 - NOT FOUND, the resource requested does not exist.</exception>
 /// <exception cref="InternalServerErrorException"> in case HTTP response code is 500 - Internal Server Error.</exception>
 /// <exception cref="CallfireApiException">         in case HTTP response code is something different from codes listed above.</exception>
 /// <exception cref="CallfireClientException">      in case error has occurred in client.</exception>
 public IList <Number> FindNumbersTollfree(CommonFindRequest request)
 {
     return(Client.Get <ListHolder <Number> >(NUMBERS_TOLLFREE_PATH, request).Items);
 }
 /// <summary>
 /// Find API credentials associated with current account
 /// </summary>
 /// <param name="request">request with properties to filter</param>
 /// <returns>paged credentials list</returns>
 /// <exception cref="BadRequestException">          in case HTTP response code is 400 - Bad request, the request was formatted improperly.</exception>
 /// <exception cref="UnauthorizedException">        in case HTTP response code is 401 - Unauthorized, API Key missing or invalid.</exception>
 /// <exception cref="AccessForbiddenException">     in case HTTP response code is 403 - Forbidden, insufficient permissions.</exception>
 /// <exception cref="ResourceNotFoundException">    in case HTTP response code is 404 - NOT FOUND, the resource requested does not exist.</exception>
 /// <exception cref="InternalServerErrorException"> in case HTTP response code is 500 - Internal Server Error.</exception>
 /// <exception cref="CallfireApiException">         in case HTTP response code is something different from codes listed above.</exception>
 /// <exception cref="CallfireClientException">      in case error has occurred in client.</exception>
 public Page <ApiCredentials> FindApiCredentials(CommonFindRequest request)
 {
     return(Client.Get <Page <ApiCredentials> >(ME_API_CREDS_PATH, request));
 }