1 package pl
.smsapi
.api
.action
.sms
;
3 import org
.json
.JSONObject
;
4 import pl
.smsapi
.api
.action
.BaseAction
;
5 import pl
.smsapi
.api
.response
.CountableResponse
;
8 import java
.net
.URISyntaxException
;
9 import java
.util
.ArrayList
;
11 public class Delete
extends BaseAction
<CountableResponse
> {
13 private ArrayList
<String
> id
= new ArrayList
<String
>();
16 public URI
uri() throws URISyntaxException
{
20 query
= paramsLoginToQuery();
22 query
+= paramsOther();
24 String tmp
[] = new String
[this.id
.size()];
27 query
+= "&sch_del=" + join(tmp
, "|");
29 return new URI(proxy
.getProtocol(), null, proxy
.getHost(), proxy
.getPort(), proxy
.getPath()+"sms.do", query
, null);
32 public Delete
id(String id
) {
37 public Delete
ids(String
[] ids
) {
38 for (String item
: ids
) {
44 protected CountableResponse
createResponse(String data
) {
45 JSONObject jsonObject
= new JSONObject(data
);
46 return new CountableResponse(jsonObject
.getInt("count"));