Exemplo n.º 1
0
        /// <summary>
        /// Delete a Do Not Contact(DNC) value.
        /// </summary>
        /// <param name="number">number to remove dnc for</param>
        /// <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 void Delete(string number)
        {
            Validate.NotNull(number, "number");
            string path = DNC_NUMBER_PATH.ReplaceFirst(ClientConstants.PLACEHOLDER, number);

            Client.Delete(path);
        }
        public void DeleteOperation_ShouldDeleteFromDB()
        {
            Assert.True(_apiClient.Post("/api/v1/Operations/Save", SampleOperation()).IsSuccessStatusCode);

            var getOperationsResp = _apiClient.Post("/api/v1/Operations/List", new OperationGetRequest());

            Assert.True(getOperationsResp.IsSuccessStatusCode);
            var ops = getOperationsResp.Deserialize <IList <OperationResponse> >();

            Assert.Equal(1, ops.Count);

            var deleteResp = _apiClient.Delete("/api/v1/Operations/" + ops[0].Id.ToString());

            Assert.True(deleteResp.IsSuccessStatusCode);

            getOperationsResp = _apiClient.Post("/api/v1/Operations/List", new OperationGetRequest());
            Assert.True(getOperationsResp.IsSuccessStatusCode);
            ops = getOperationsResp.Deserialize <IList <OperationResponse> >();
            Assert.Equal(0, ops.Count);
        }
Exemplo n.º 3
0
        public void DeleteResource_ShouldDeleteFromDB()
        {
            Assert.True(_apiClient.Post("/api/v1/Resources/Save", SampleResource()).IsSuccessStatusCode);

            var getResourcesResp = _apiClient.Post("/api/v1/Resources/List", new ResourceGetRequest());

            Assert.True(getResourcesResp.IsSuccessStatusCode);
            var resources = getResourcesResp.Deserialize <IList <ResourceResponse> >();

            Assert.Equal(1, resources.Count);

            var deleteResp = _apiClient.Delete("/api/v1/Resources/" + resources[0].Id.ToString());

            Assert.True(deleteResp.IsSuccessStatusCode);

            getResourcesResp = _apiClient.Post("/api/v1/Resources/List", new ResourceGetRequest());
            Assert.True(getResourcesResp.IsSuccessStatusCode);
            resources = getResourcesResp.Deserialize <IList <ResourceResponse> >();
            Assert.Equal(0, resources.Count);
        }
 /// <summary>
 /// Delete a contact that is stored in your Ez Texting account
 /// </summary>
 /// <param name="id">contact's id</param>
 /// <exception cref="EzTextingApiException">in case error has occurred on server side, check provided error description.</exception>
 /// <exception cref="EzTextingClientException">in case error has occurred in client.</exception>
 public void Delete(string id)
 {
     Validate.NotBlank(id, "id cannot be blank");
     _client.Delete(ContactsItemPath.ReplaceFirst(ClientConstants.Placeholder, id));
 }
 /// <summary>
 /// Delete a group that is stored in your Ez Texting account
 /// </summary>
 /// <param name="id">group's id</param>
 /// <exception cref="EzTextingApiException">in case error has occurred on server side, check provided error description.</exception>
 /// <exception cref="EzTextingClientException">in case error has occurred in client.</exception>
 public void Delete(long id)
 {
     _client.Delete(GroupsItemPath.ReplaceFirst(ClientConstants.Placeholder, id.ToString()));
 }
Exemplo n.º 6
0
 public Job Delete(long id)
 {
     return(jobsApiClient.Delete(id));
 }
 /// <summary>
 /// Delete subscription by id
 /// </summary>
 /// <param name="id">id of subscription</param>
 /// <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 void Delete(long id)
 {
     Client.Delete(SUBSCRIPTIONS_ITEM_PATH.ReplaceFirst(ClientConstants.PLACEHOLDER, id.ToString()));
 }
 /// <summary>
 /// Cancels an active Keyword on Ez Texting's short code in the country your account is set to send messages to.
 /// </summary>
 /// <param name="keyword">keyword</param>
 /// <exception cref="EzTextingApiException">in case error has occurred on server side, check provided error description.</exception>
 /// <exception cref="EzTextingClientException">in case error has occurred in client.</exception>
 public void Cancel(string keyword)
 {
     Validate.NotBlank(keyword, "keyword cannot be blank");
     _client.Delete(KeywordsItemPath.ReplaceFirst(ClientConstants.Placeholder, keyword));
 }
 /// <summary>
 /// Delete DNC list
 /// </summary>
 /// <param name="id">DNC list id</param>
 /// <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 void Delete(long id)
 {
     Client.Delete(DNC_LISTS_LIST_PATH.ReplaceFirst(ClientConstants.PLACEHOLDER, id.ToString()));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Delete API credentials by id
 /// </summary>
 /// <param name="id">id of credentials</param>
 /// <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 void DeleteApiCredentials(long id)
 {
     Client.Delete(ME_API_CREDS_ITEM_PATH.ReplaceFirst(ClientConstants.PLACEHOLDER, id.ToString()));
 }
        /// <summary>
        /// Delete a single CampaignSound instance for a given campaign sound id.
        /// </summary>
        /// <param name="id">id of campaign sound</param>
        /// <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 void Delete(long id)
        {
            string path = SOUNDS_ITEM_PATH.ReplaceFirst(ClientConstants.PLACEHOLDER, id.ToString());

            Client.Delete(path);
        }
 ///
 /// Delete text auto reply message attached to number.
 /// Can not delete a TextAutoReply currently active on a campaign.
 /// <param name="id">id of text auto reply</param>
 /// <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 void Delete(long id)
 {
     Client.Delete(TEXT_AUTO_REPLIES_ITEM_PATH.ReplaceFirst(ClientConstants.PLACEHOLDER, id.ToString()));
 }