Skip to content

Commit d863dee

Browse files
authored
Merge pull request #95 from starkbank/fix/request-docs-string
Fix Request docString
2 parents 162e3ab + ae9ea1f commit d863dee

File tree

2 files changed

+53
-65
lines changed

2 files changed

+53
-65
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Given a version number MAJOR.MINOR.PATCH, increment:
1313

1414

1515
## [Unreleased]
16+
### Fixed
17+
- request docString
1618

1719
## [2.18.0] - 2024-07-18
1820
### Added

src/main/java/com/starkbank/Request.java

+51-65
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static Response get(String path, User user) throws Exception {
4949
* <p>
5050
* Parameters:
5151
* path [String]: StarkBank resource's route. Example: "/invoice/"
52-
* query [Map<String, Object>]: Query parameters. Example: new HashMap<String, Object>() {{ put("limit", 1); put("status", "paid"); }}
52+
* @param query map of parameters for the query ex: {{ put("limit", 1); put("status", "paid"); }}
5353
*/
5454

5555
public static Response get(String path, Map<String, Object> query) throws Exception {
@@ -63,7 +63,7 @@ public static Response get(String path, Map<String, Object> query) throws Except
6363
* <p>
6464
* Parameters:
6565
* path [String]: StarkBank resource's route. Example: "/invoice/"
66-
* query [Map<String, Object>]: Query parameters. Example: new HashMap<String, Object>() {{ put("limit", 1); put("status", "paid"); }}
66+
* @param query map of parameters for the query ex: {{ put("limit", 1); put("status", "paid"); }}
6767
* user [Organization/Project object]: Organization or Project object. Not necessary if StarkBank.Settings.User was set before function call.
6868
*/
6969

@@ -78,19 +78,18 @@ public static Response get(String path, Map<String, Object> query, User user ) t
7878
* <p>
7979
* Parameters:
8080
* path [String]: StarkBank resource's route. Example: "/invoice/"
81-
* body [Map<String, Object>]: Request parameters. Example:
81+
* @param payload map of parameters for the payload ex:
8282
* <pre>
83-
* new HashMap<String, Object>() {{
84-
* put("invoices", new ArrayList<Map<String, Object>>() {{
85-
* add(new HashMap<String, Object>() {{
86-
* put("amount", 100);
87-
* put("name", "Iron Bank S.A.");
88-
* put("taxId", "20.018.183/0001-80");
89-
* }});
90-
* }});
91-
* }});
83+
* put("invoices", {
84+
* add(
85+
* {
86+
* put("amount", 100);
87+
* put("name", "Iron Bank S.A.");
88+
* put("taxId", "20.018.183/0001-80");
89+
* }
90+
* );
91+
* });
9292
* </pre>
93-
* query [Map<String, Object>]: Query parameters. Example: new HashMap<String, Object>() {{ put("limit", 1); put("status", "paid"); }}
9493
*/
9594

9695
public static Response post(String path, Map<String, Object> payload) throws Exception {
@@ -104,19 +103,18 @@ public static Response post(String path, Map<String, Object> payload) throws Exc
104103
* <p>
105104
* Parameters:
106105
* path [String]: StarkBank resource's route. Example: "/invoice/"
107-
* body [Map<String, Object>]: Request parameters. Example:
106+
* @param payload map of parameters for the payload ex:
108107
* <pre>
109-
* new HashMap<String, Object>() {{
110-
* put("invoices", new ArrayList<Map<String, Object>>() {{
111-
* add(new HashMap<String, Object>() {{
112-
* put("amount", 100);
113-
* put("name", "Iron Bank S.A.");
114-
* put("taxId", "20.018.183/0001-80");
115-
* }});
116-
* }});
117-
* }});
108+
* put("invoices", {
109+
* add(
110+
* {
111+
* put("amount", 100);
112+
* put("name", "Iron Bank S.A.");
113+
* put("taxId", "20.018.183/0001-80");
114+
* }
115+
* );
116+
* });
118117
* </pre>
119-
* query [Map<String, Object>]: Query parameters. Example: new HashMap<String, Object>() {{ put("limit", 1); put("status", "paid"); }}
120118
* user [Organization/Project object]: Organization or Project object. Not necessary if StarkBank.Settings.User was set before function call.
121119
*/
122120

@@ -130,15 +128,13 @@ public static Response post(String path, Map<String, Object> payload, User user
130128
* Send a JSON with parameters of a single StarkBank resource object and update it.
131129
* <p>
132130
* Parameters:
133-
* path [String]: StarkBank resource's route. Example: "/invoice/"
131+
* path [String]: StarkBank resource's route. Example: "/invoice/:id"
134132
* <br>
135-
* - body [Map<String, Object>]: Request parameters. Example:
133+
* @param payload map of parameters for the payload ex:
136134
* <pre>
137-
* new HashMap<String, Object>() {{
138-
* put("invoices", new HashMap<String, Object>() {{
139-
* put("amount", 100);
140-
* }});
141-
* }});
135+
* {
136+
* put("amount", 100);
137+
* }
142138
* </pre>
143139
*/
144140

@@ -152,17 +148,13 @@ public static Response patch(String path, Map<String, Object> payload) throws Ex
152148
* Send a JSON with parameters of a single StarkBank resource object and update it.
153149
* <p>
154150
* Parameters:
155-
* path [String]: StarkBank resource's route. Example: "/invoice/"
151+
* path [String]: StarkBank resource's route. Example: "/invoice/:id"
156152
* <br>
157-
* - body [Map<String, Object>]: Request parameters. Example:
153+
* @param payload map of parameters for the payload ex:
158154
* <pre>
159-
* new HashMap<String, Object>() {{
160-
* put("invoices", new HashMap<String, Object>() {{
161-
* put("amount", 100);
162-
* put("name", "Iron Bank S.A.");
163-
* put("taxId", "20.018.183/0001-80");
164-
* }});
165-
* }});
155+
* {
156+
* put("amount", 100);
157+
* }
166158
* </pre>
167159
* user [Organization/Project object]: Organization or Project object. Not necessary if StarkBank.Settings.User was set before function call.
168160
*/
@@ -179,14 +171,16 @@ public static Response patch(String path, Map<String, Object> payload, User user
179171
* <p>
180172
* Parameters:
181173
* path [String]: StarkBank resource's route. Example: "/split-profie/"
182-
* body [Map<String, Object>]: Request parameters. Example:
174+
* @param payload map of parameters for the payload ex:
183175
* <pre>
184-
* new HashMap<String, Object>() {{
185-
* put("profiles", new HashMap<String, Object>() {{
186-
* put("interval", "day");
187-
* put("delay", 0);
188-
* }});
189-
* }});
176+
* put("profiles", {
177+
* add(
178+
* {
179+
* put("interval", "day");
180+
* put("delay", 0);;
181+
* }
182+
* );
183+
* });
190184
* </pre>
191185
* user [Organization/Project object]: Organization or Project object. Not necessary if StarkBank.Settings.User was set before function call.
192186
*/
@@ -203,14 +197,16 @@ public static Response put(String path, Map<String, Object> payload) throws Exce
203197
* <p>
204198
* Parameters:
205199
* path [String]: StarkBank resource's route. Example: "/split-profie/"
206-
* body [Map<String, Object>]: Request parameters. Example:
200+
* @param payload map of parameters for the payload ex:
207201
* <pre>
208-
* new HashMap<String, Object>() {{
209-
* put("profiles", new HashMap<String, Object>() {{
210-
* put("interval", "day");
211-
* put("delay", 0);
212-
* }});
213-
* }});
202+
* put("profiles", {
203+
* add(
204+
* {
205+
* put("interval", "day");
206+
* put("delay", 0);;
207+
* }
208+
* );
209+
* });
214210
* </pre>
215211
* user [Organization/Project object]: Organization or Project object. Not necessary if StarkBank.Settings.User was set before function call.
216212
*/
@@ -225,17 +221,7 @@ public static Response put(String path, Map<String, Object> payload, User user )
225221
* Send a JSON with parameters of a single StarkBank resource object and delete it.
226222
* <p>
227223
* Parameters:
228-
* path [String]: StarkBank resource's route. Example: "/invoice/"
229-
* body [Map<String, Object>]: Request parameters. Example:
230-
* <pre>
231-
* new HashMap<String, Object>() {{
232-
* put("invoices", new HashMap<String, Object>() {{
233-
* put("amount", 100);
234-
* put("name", "Iron Bank S.A.");
235-
* put("taxId", "20.018.183/0001-80");
236-
* }});
237-
* }});
238-
* </pre>
224+
* path [String]: StarkBank resource's route. Example: "/transfer/"
239225
*/
240226

241227
public static Response delete(String path) throws Exception {

0 commit comments

Comments
 (0)