|
| 1 | +package com.pingplusplus.model; |
| 2 | + |
| 3 | +import com.pingplusplus.exception.*; |
| 4 | +import com.pingplusplus.net.APIResource; |
| 5 | + |
| 6 | +import java.util.Map; |
| 7 | + |
| 8 | +/** |
| 9 | + * 微信企业付款 |
| 10 | + */ |
| 11 | +public class Agreement extends APIResource { |
| 12 | + String id; |
| 13 | + String object; |
| 14 | + Boolean livemode; |
| 15 | + String app; |
| 16 | + Long created; |
| 17 | + String channel; |
| 18 | + String contractNo; |
| 19 | + String contractId; |
| 20 | + Map<String, Object> credential; |
| 21 | + String status; |
| 22 | + Long timeSucceeded; |
| 23 | + Long timeCanceled; |
| 24 | + String failureCode; |
| 25 | + String failureMsg; |
| 26 | + Map<String, Object> extra; |
| 27 | + Map<String, Object> metadata; |
| 28 | + |
| 29 | + public String getId() { |
| 30 | + return id; |
| 31 | + } |
| 32 | + |
| 33 | + public void setId(String id) { |
| 34 | + this.id = id; |
| 35 | + } |
| 36 | + |
| 37 | + public String getObject() { |
| 38 | + return object; |
| 39 | + } |
| 40 | + |
| 41 | + public void setObject(String object) { |
| 42 | + this.object = object; |
| 43 | + } |
| 44 | + |
| 45 | + public Boolean getLivemode() { |
| 46 | + return livemode; |
| 47 | + } |
| 48 | + |
| 49 | + public void setLivemode(Boolean livemode) { |
| 50 | + this.livemode = livemode; |
| 51 | + } |
| 52 | + |
| 53 | + public String getApp() { |
| 54 | + return app; |
| 55 | + } |
| 56 | + |
| 57 | + public void setApp(String app) { |
| 58 | + this.app = app; |
| 59 | + } |
| 60 | + |
| 61 | + public Long getCreated() { |
| 62 | + return created; |
| 63 | + } |
| 64 | + |
| 65 | + public void setCreated(Long created) { |
| 66 | + this.created = created; |
| 67 | + } |
| 68 | + |
| 69 | + public String getChannel() { |
| 70 | + return channel; |
| 71 | + } |
| 72 | + |
| 73 | + public void setChannel(String channel) { |
| 74 | + this.channel = channel; |
| 75 | + } |
| 76 | + |
| 77 | + public String getContractNo() { |
| 78 | + return contractNo; |
| 79 | + } |
| 80 | + |
| 81 | + public void setContractNo(String contractNo) { |
| 82 | + this.contractNo = contractNo; |
| 83 | + } |
| 84 | + |
| 85 | + public String getContractId() { |
| 86 | + return contractId; |
| 87 | + } |
| 88 | + |
| 89 | + public void setContractId(String contractId) { |
| 90 | + this.contractId = contractId; |
| 91 | + } |
| 92 | + |
| 93 | + public Map<String, Object> getCredential() { |
| 94 | + return credential; |
| 95 | + } |
| 96 | + |
| 97 | + public void setCredential(Map<String, Object> credential) { |
| 98 | + this.credential = credential; |
| 99 | + } |
| 100 | + |
| 101 | + public String getStatus() { |
| 102 | + return status; |
| 103 | + } |
| 104 | + |
| 105 | + public void setStatus(String status) { |
| 106 | + this.status = status; |
| 107 | + } |
| 108 | + |
| 109 | + public Long getTimeSucceeded() { |
| 110 | + return timeSucceeded; |
| 111 | + } |
| 112 | + |
| 113 | + public void setTimeSucceeded(Long timeSucceeded) { |
| 114 | + this.timeSucceeded = timeSucceeded; |
| 115 | + } |
| 116 | + |
| 117 | + public Long getTimeCanceled() { |
| 118 | + return timeCanceled; |
| 119 | + } |
| 120 | + |
| 121 | + public void setTimeCanceled(Long timeCanceled) { |
| 122 | + this.timeCanceled = timeCanceled; |
| 123 | + } |
| 124 | + |
| 125 | + public String getFailureCode() { |
| 126 | + return failureCode; |
| 127 | + } |
| 128 | + |
| 129 | + public void setFailureCode(String failureCode) { |
| 130 | + this.failureCode = failureCode; |
| 131 | + } |
| 132 | + |
| 133 | + public String getFailureMsg() { |
| 134 | + return failureMsg; |
| 135 | + } |
| 136 | + |
| 137 | + public void setFailureMsg(String failureMsg) { |
| 138 | + this.failureMsg = failureMsg; |
| 139 | + } |
| 140 | + |
| 141 | + public Map<String, Object> getExtra() { |
| 142 | + return extra; |
| 143 | + } |
| 144 | + |
| 145 | + public void setExtra(Map<String, Object> extra) { |
| 146 | + this.extra = extra; |
| 147 | + } |
| 148 | + |
| 149 | + public Map<String, Object> getMetadata() { |
| 150 | + return metadata; |
| 151 | + } |
| 152 | + |
| 153 | + public void setMetadata(Map<String, Object> metadata) { |
| 154 | + this.metadata = metadata; |
| 155 | + } |
| 156 | + |
| 157 | + /** |
| 158 | + * 创建签约(agreement) |
| 159 | + * |
| 160 | + * @param params 签约参数 |
| 161 | + * @return Agreement |
| 162 | + * @throws AuthenticationException |
| 163 | + * @throws InvalidRequestException |
| 164 | + * @throws APIConnectionException |
| 165 | + * @throws APIException |
| 166 | + * @throws ChannelException |
| 167 | + */ |
| 168 | + public static Agreement create(Map<String, Object> params) |
| 169 | + throws AuthenticationException, InvalidRequestException, |
| 170 | + APIConnectionException, APIException, ChannelException, RateLimitException { |
| 171 | + return create(params, null); |
| 172 | + } |
| 173 | + |
| 174 | + /** |
| 175 | + * 创建签约(agreement) |
| 176 | + * |
| 177 | + * @param params 签约参数 |
| 178 | + * @param apiKey Ping++ APiKey |
| 179 | + * @return Transfer |
| 180 | + * @throws AuthenticationException |
| 181 | + * @throws InvalidRequestException |
| 182 | + * @throws APIConnectionException |
| 183 | + * @throws APIException |
| 184 | + * @throws ChannelException |
| 185 | + * @throws RateLimitException |
| 186 | + */ |
| 187 | + public static Agreement create(Map<String, Object> params, String apiKey) |
| 188 | + throws AuthenticationException, InvalidRequestException, |
| 189 | + APIConnectionException, APIException, ChannelException, RateLimitException { |
| 190 | + return request(RequestMethod.POST, classURL(Agreement.class), apiKey, params, Agreement.class); |
| 191 | + } |
| 192 | + |
| 193 | + /** |
| 194 | + * 查询签约(agreement) |
| 195 | + * |
| 196 | + * @param id id |
| 197 | + * @return Agreement |
| 198 | + * @throws AuthenticationException |
| 199 | + * @throws InvalidRequestException |
| 200 | + * @throws APIConnectionException |
| 201 | + * @throws APIException |
| 202 | + * @throws ChannelException |
| 203 | + */ |
| 204 | + public static Agreement retrieve(String id) throws AuthenticationException, |
| 205 | + InvalidRequestException, APIConnectionException, |
| 206 | + APIException, ChannelException, RateLimitException { |
| 207 | + return retrieve(id, null); |
| 208 | + } |
| 209 | + |
| 210 | + /** |
| 211 | + * 查询签约(agreement) |
| 212 | + * |
| 213 | + * @param id id |
| 214 | + * @param apiKey Ping++ ApiKey |
| 215 | + * @return Agreement |
| 216 | + * @throws AuthenticationException |
| 217 | + * @throws InvalidRequestException |
| 218 | + * @throws APIConnectionException |
| 219 | + * @throws APIException |
| 220 | + * @throws ChannelException |
| 221 | + * @throws RateLimitException |
| 222 | + */ |
| 223 | + public static Agreement retrieve(String id, String apiKey) throws AuthenticationException, |
| 224 | + InvalidRequestException, APIConnectionException, |
| 225 | + APIException, ChannelException, RateLimitException { |
| 226 | + return request(RequestMethod.GET, instanceURL(Agreement.class, id), apiKey, null, Agreement.class); |
| 227 | + } |
| 228 | + |
| 229 | + /** |
| 230 | + * 查询签约列表 |
| 231 | + * |
| 232 | + * @param params 分页参数等 |
| 233 | + * @return AgreementCollection |
| 234 | + * @throws AuthenticationException |
| 235 | + * @throws InvalidRequestException |
| 236 | + * @throws APIConnectionException |
| 237 | + * @throws APIException |
| 238 | + * @throws ChannelException |
| 239 | + */ |
| 240 | + public static AgreementCollection list(Map<String, Object> params) |
| 241 | + throws AuthenticationException, InvalidRequestException, |
| 242 | + APIConnectionException, APIException, ChannelException, RateLimitException { |
| 243 | + return list(params, null); |
| 244 | + } |
| 245 | + |
| 246 | + /** |
| 247 | + * 查询签约列表 |
| 248 | + * |
| 249 | + * @param apiKey Ping++ APiKey |
| 250 | + * @param params 分页参数等 |
| 251 | + * @return AgreementCollection |
| 252 | + * @throws AuthenticationException |
| 253 | + * @throws InvalidRequestException |
| 254 | + * @throws APIConnectionException |
| 255 | + * @throws APIException |
| 256 | + * @throws ChannelException |
| 257 | + * @throws RateLimitException |
| 258 | + */ |
| 259 | + public static AgreementCollection list(Map<String, Object> params, String apiKey) |
| 260 | + throws AuthenticationException, InvalidRequestException, |
| 261 | + APIConnectionException, APIException, ChannelException, RateLimitException { |
| 262 | + return request(RequestMethod.GET, classURL(Agreement.class), apiKey, params, AgreementCollection.class); |
| 263 | + } |
| 264 | +} |
0 commit comments