public void Find()
        {
            string expectedJson = GetJsonPayload("/contacts/dncApi/response/findDncList.json");
            var    restRequest  = MockRestResponse(expectedJson);

            FindDncContactsRequest request = new FindDncContactsRequest
            {
                Limit       = 1,
                Offset      = 5,
                Fields      = FIELDS,
                Prefix      = "1",
                DncListId   = TEST_LONG,
                DncListName = TEST_STRING,
                CallDnc     = true,
                TextDnc     = true
            };

            Page <DoNotContact> dncs = Client.DncApi.Find(request);

            Assert.NotNull(dncs);
            Assert.That(Serializer.Serialize(dncs), Is.EqualTo(expectedJson));
            Assert.AreEqual(Method.GET, restRequest.Value.Method);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Find all Do Not Contact (DNC) objects created by the user.
 /// These DoNotContact entries only affect calls/texts/campaigns on this account.
 /// </summary>
 /// <param name="request">find request with different properties to filter</param>
 /// <returns>paged list with dnc 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 <DoNotContact> Find(FindDncContactsRequest request)
 {
     return(Client.Get <Page <DoNotContact> >(DNC_PATH, request));
 }