22
22
import com .messagemedia .webhooks .http .client .APICallBack ;
23
23
import com .messagemedia .webhooks .controllers .syncwrapper .APICallBackCatcher ;
24
24
25
- public class APIController extends BaseController {
25
+ public class APIController extends BaseController {
26
26
//private static variables for the singleton pattern
27
27
private static Object syncObject = new Object ();
28
28
private static APIController instance = null ;
29
29
30
30
/**
31
- * Singleton pattern implementation
32
- * @return The singleton instance of the APIController class
31
+ * Singleton pattern implementation
32
+ * @return The singleton instance of the APIController class
33
33
*/
34
34
public static APIController getInstance () {
35
35
synchronized (syncObject ) {
@@ -84,9 +84,9 @@ public static APIController getInstance() {
84
84
* <li>the `method` is null </li>
85
85
* <li>the `headers` has a `ContentType` attribute </li>
86
86
* </ul>
87
- * @param contentType Required parameter: Example:
88
- * @param body Required parameter: Example:
89
- * @return Returns the DynamicResponse response from the API call
87
+ * @param contentType Required parameter: Example:
88
+ * @param body Required parameter: Example:
89
+ * @return Returns the DynamicResponse response from the API call
90
90
*/
91
91
public DynamicResponse create (
92
92
final String contentType ,
@@ -143,9 +143,9 @@ public DynamicResponse create(
143
143
* <li>the `method` is null </li>
144
144
* <li>the `headers` has a `ContentType` attribute </li>
145
145
* </ul>
146
- * @param contentType Required parameter: Example:
147
- * @param body Required parameter: Example:
148
- * @return Returns the void response from the API call
146
+ * @param contentType Required parameter: Example:
147
+ * @param body Required parameter: Example:
148
+ * @return Returns the void response from the API call
149
149
*/
150
150
public void createAsync (
151
151
final String contentType ,
@@ -168,7 +168,7 @@ public void run() {
168
168
private static final long serialVersionUID = 5307147615583971842L ;
169
169
{
170
170
put ( "Content-Type" , contentType );
171
- put ( "user-agent" , "messagesmedia -webhooks" );
171
+ put ( "user-agent" , "messagemedia -webhooks-java-sdk-1.0.0 " );
172
172
put ( "accept" , "application/json" );
173
173
}
174
174
};
@@ -195,7 +195,7 @@ public void onSuccess(HttpContext _context, HttpResponse _response) {
195
195
try {
196
196
197
197
//invoke the callback after response if its not null
198
- if (getHttpCallBack () != null )
198
+ if (getHttpCallBack () != null )
199
199
{
200
200
getHttpCallBack ().OnAfterResponse (_context );
201
201
}
@@ -244,8 +244,8 @@ public void onFailure(HttpContext _context, Throwable _error) {
244
244
* <ul>
245
245
* <li>there is no webhook with this `webhookId` </li>
246
246
* </ul>
247
- * @param webhookId Required parameter: Example:
248
- * @return Returns the void response from the API call
247
+ * @param webhookId Required parameter: Example:
248
+ * @return Returns the void response from the API call
249
249
*/
250
250
public void deleteDeleteAndUpdateWebhook (
251
251
final UUID webhookId
@@ -263,8 +263,8 @@ public void deleteDeleteAndUpdateWebhook(
263
263
* <ul>
264
264
* <li>there is no webhook with this `webhookId` </li>
265
265
* </ul>
266
- * @param webhookId Required parameter: Example:
267
- * @return Returns the void response from the API call
266
+ * @param webhookId Required parameter: Example:
267
+ * @return Returns the void response from the API call
268
268
*/
269
269
public void deleteDeleteAndUpdateWebhookAsync (
270
270
final UUID webhookId ,
@@ -312,7 +312,7 @@ public void onSuccess(HttpContext _context, HttpResponse _response) {
312
312
try {
313
313
314
314
//invoke the callback after response if its not null
315
- if (getHttpCallBack () != null )
315
+ if (getHttpCallBack () != null )
316
316
{
317
317
getHttpCallBack ().OnAfterResponse (_context );
318
318
}
@@ -360,9 +360,9 @@ public void onFailure(HttpContext _context, Throwable _error) {
360
360
* <li>the `page` query parameter is not valid </li>
361
361
* <li>the `pageSize` query parameter is not valid </li>
362
362
* </ul>
363
- * @param page Optional parameter: Example:
364
- * @param pageSize Optional parameter: Example:
365
- * @return Returns the RetrieveResponse response from the API call
363
+ * @param page Optional parameter: Example:
364
+ * @param pageSize Optional parameter: Example:
365
+ * @return Returns the RetrieveResponse response from the API call
366
366
*/
367
367
public RetrieveResponse retrieve (
368
368
final Integer page ,
@@ -382,9 +382,9 @@ public RetrieveResponse retrieve(
382
382
* <li>the `page` query parameter is not valid </li>
383
383
* <li>the `pageSize` query parameter is not valid </li>
384
384
* </ul>
385
- * @param page Optional parameter: Example:
386
- * @param pageSize Optional parameter: Example:
387
- * @return Returns the void response from the API call
385
+ * @param page Optional parameter: Example:
386
+ * @param pageSize Optional parameter: Example:
387
+ * @return Returns the void response from the API call
388
388
*/
389
389
public void retrieveAsync (
390
390
final Integer page ,
@@ -435,7 +435,7 @@ public void onSuccess(HttpContext _context, HttpResponse _response) {
435
435
try {
436
436
437
437
//invoke the callback after response if its not null
438
- if (getHttpCallBack () != null )
438
+ if (getHttpCallBack () != null )
439
439
{
440
440
getHttpCallBack ().OnAfterResponse (_context );
441
441
}
@@ -485,25 +485,25 @@ public void onFailure(HttpContext _context, Throwable _error) {
485
485
}
486
486
487
487
/**
488
- * This will update a webhook and returned the updated Webhook.
488
+ * This will update a webhook and returned the updated Webhook.
489
489
* you can update all the attributes individually or together.
490
490
* PS : the new value will override the previous one.
491
491
* ### Parameters
492
492
* + same parameters rules as create webhook apply
493
493
* a **Response 404 is returned when** :
494
494
* <ul>
495
495
* <li>there is no webhook with this `webhookId` </li>
496
- * </ul>
496
+ * </ul>
497
497
* a **Response 400 is returned when** :
498
498
* <ul>
499
499
* <li>all attributes are null </li>
500
500
* <li>events array is empty </li>
501
501
* <li>content-Type is set in the headers instead of using the `encoding` attribute </li>
502
502
* </ul>
503
- * @param webhookId Required parameter: Example:
504
- * @param contentType Required parameter: Example:
505
- * @param body Required parameter: Example:
506
- * @return Returns the void response from the API call
503
+ * @param webhookId Required parameter: Example:
504
+ * @param contentType Required parameter: Example:
505
+ * @param body Required parameter: Example:
506
+ * @return Returns the void response from the API call
507
507
*/
508
508
public void update (
509
509
final UUID webhookId ,
@@ -518,25 +518,25 @@ public void update(
518
518
}
519
519
520
520
/**
521
- * This will update a webhook and returned the updated Webhook.
521
+ * This will update a webhook and returned the updated Webhook.
522
522
* you can update all the attributes individually or together.
523
523
* PS : the new value will override the previous one.
524
524
* ### Parameters
525
525
* + same parameters rules as create webhook apply
526
526
* a **Response 404 is returned when** :
527
527
* <ul>
528
528
* <li>there is no webhook with this `webhookId` </li>
529
- * </ul>
529
+ * </ul>
530
530
* a **Response 400 is returned when** :
531
531
* <ul>
532
532
* <li>all attributes are null </li>
533
533
* <li>events array is empty </li>
534
534
* <li>content-Type is set in the headers instead of using the `encoding` attribute </li>
535
535
* </ul>
536
- * @param webhookId Required parameter: Example:
537
- * @param contentType Required parameter: Example:
538
- * @param body Required parameter: Example:
539
- * @return Returns the void response from the API call
536
+ * @param webhookId Required parameter: Example:
537
+ * @param contentType Required parameter: Example:
538
+ * @param body Required parameter: Example:
539
+ * @return Returns the void response from the API call
540
540
*/
541
541
public void updateAsync (
542
542
final UUID webhookId ,
@@ -593,7 +593,7 @@ public void onSuccess(HttpContext _context, HttpResponse _response) {
593
593
try {
594
594
595
595
//invoke the callback after response if its not null
596
- if (getHttpCallBack () != null )
596
+ if (getHttpCallBack () != null )
597
597
{
598
598
getHttpCallBack ().OnAfterResponse (_context );
599
599
}
@@ -634,4 +634,4 @@ public void onFailure(HttpContext _context, Throwable _error) {
634
634
APIHelper .getScheduler ().execute (_responseTask );
635
635
}
636
636
637
- }
637
+ }
0 commit comments