-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #233 from razorpay/item_entity_nmock
Item entity nmock
- Loading branch information
Showing
2 changed files
with
62 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,39 @@ | ||
package com.razorpay; | ||
|
||
import java.io.IOException; | ||
import java.net.URISyntaxException; | ||
import java.util.List; | ||
|
||
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
|
||
public class ItemClient extends ApiClient{ | ||
|
||
ItemClient(String auth) { | ||
super(auth); | ||
ItemClient(String auth, ApiUtils apiUtils) { | ||
super(auth,apiUtils); | ||
} | ||
|
||
public Item create(JSONObject request) throws RazorpayException { | ||
public Item create(JSONObject request) throws RazorpayException, JSONException, IOException, URISyntaxException { | ||
return post(Constants.ITEMS, request); | ||
} | ||
|
||
public Item fetch(String id) throws RazorpayException { | ||
public Item fetch(String id) throws RazorpayException, JSONException, IOException, URISyntaxException { | ||
return get(String.format(Constants.ITEM, id), null); | ||
} | ||
|
||
public List<Item> fetchAll() throws RazorpayException { | ||
public List<Item> fetchAll() throws RazorpayException, JSONException, IOException, URISyntaxException { | ||
return fetchAll(null); | ||
} | ||
|
||
public Item edit(String id, JSONObject request) throws RazorpayException { | ||
public Item edit(String id, JSONObject request) throws RazorpayException, JSONException, IOException, URISyntaxException { | ||
return patch(String.format(Constants.ITEM, id), request); | ||
} | ||
|
||
public List<Item> fetchAll(JSONObject request) throws RazorpayException { | ||
public List<Item> fetchAll(JSONObject request) throws RazorpayException, JSONException, IOException, URISyntaxException { | ||
return getCollection(Constants.ITEMS, request); | ||
} | ||
|
||
public List<Item> delete(String id) throws RazorpayException { | ||
public List<Item> delete(String id) throws RazorpayException, JSONException, IOException, URISyntaxException { | ||
return delete(String.format(Constants.ITEM, id), null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters