@@ -76,6 +76,30 @@ trait KalixClient {
7676 */
7777 def post [P , R ](uri : String , body : P , returnType : Class [R ]): DeferredCall [Any , R ]
7878
79+ /**
80+ * Provides utility to do a POST HTTP request to a target endpoint belonging to a Kalix component. Such endpoint is
81+ * identified by a resource path (i.e. excluding authority and scheme).
82+ *
83+ * Example of use:
84+ * {{{
85+ * public Effect<Confirmation> createCounter() {
86+ * var serviceCall = kalixClient.post("/counter/create", Confirmation.class);
87+ * return effects().forward(serviceCall);
88+ * }
89+ * }}}
90+ *
91+ * @param uri
92+ * The resource path where the target endpoint will be reached at. Query parameters can be passed in as part of the
93+ * URI but should be encoded if containing special characters.
94+ * @param returnType
95+ * The type returned by the target endpoint
96+ * @tparam R
97+ * Type returned as response from the target endpoint
98+ * @return
99+ * a [[kalix.javasdk.DeferredCall ]] to be used in forwards and timers or to be executed in place
100+ */
101+ def post [R ](uri : String , returnType : Class [R ]): DeferredCall [Any , R ]
102+
79103 /**
80104 * Provides utility to do a PUT HTTP request to a target endpoint belonging to a Kalix component. Such endpoint is
81105 * identified by a resource path (i.e. excluding authority and scheme).
@@ -104,6 +128,30 @@ trait KalixClient {
104128 */
105129 def put [P , R ](uri : String , body : P , returnType : Class [R ]): DeferredCall [Any , R ]
106130
131+ /**
132+ * Provides utility to do a PUT HTTP request to a target endpoint belonging to a Kalix component. Such endpoint is
133+ * identified by a resource path (i.e. excluding authority and scheme).
134+ *
135+ * Example of use:
136+ * {{{
137+ * public Effect<Number> nextNumber(Number number) {
138+ * var serviceCall = kalixClient.put("/fibonacci/next", number, Number.class);
139+ * return effects().forward(serviceCall);
140+ * }
141+ * }}}
142+ *
143+ * @param uri
144+ * The resource path where the target endpoint will be reached at. Query parameters can be passed in as part of the
145+ * URI but should be encoded if containing special characters.
146+ * @param returnType
147+ * The type returned by the target endpoint
148+ * @tparam R
149+ * Type returned as response from the target endpoint
150+ * @return
151+ * a [[kalix.javasdk.DeferredCall ]] to be used in forwards and timers or to be executed in place
152+ */
153+ def put [R ](uri : String , returnType : Class [R ]): DeferredCall [Any , R ]
154+
107155 /**
108156 * Provides utility to do a PATCH HTTP request to a target endpoint belonging to a Kalix component. Such endpoint is
109157 * identified by a resource path (i.e. excluding authority and scheme).
@@ -132,31 +180,51 @@ trait KalixClient {
132180 */
133181 def patch [P , R ](uri : String , body : P , returnType : Class [R ]): DeferredCall [Any , R ]
134182
183+ /**
184+ * Provides utility to do a PATCH HTTP request to a target endpoint belonging to a Kalix component. Such endpoint is
185+ * identified by a resource path (i.e. excluding authority and scheme).
186+ *
187+ * Example of use:
188+ * {{{
189+ * public Effect<User> createUser(String email) {
190+ * var serviceCall = kalixClient.patch("/user/" + user.id + "/email", email, User.class);
191+ * return effects().forward(serviceCall);
192+ * }
193+ * }}}
194+ *
195+ * @param uri
196+ * The resource path where the target endpoint will be reached at. Query parameters can be passed in as part of the
197+ * URI but should be encoded if containing special characters.
198+ * @param returnType
199+ * The type returned by the target endpoint
200+ * @tparam R
201+ * Type returned as response from the target endpoint
202+ * @return
203+ * a [[kalix.javasdk.DeferredCall ]] to be used in forwards and timers or to be executed in place
204+ */
205+ def patch [R ](uri : String , returnType : Class [R ]): DeferredCall [Any , R ]
206+
135207 /**
136208 * Provides utility to do a DELETE HTTP request to a target endpoint belonging to a Kalix component. Such endpoint is
137209 * identified by a resource path (i.e. excluding authority and scheme).
138210 *
139211 * Example of use:
140212 * {{{
141213 * public Effect<String> deleteUser(@RequestBody String userId) {
142- * var serviceCall = kalixClient.delete("/user/"+userId, "", String.class);
214+ * var serviceCall = kalixClient.delete("/user/"+userId, String.class);
143215 * return effects().forward(serviceCall);
144216 * }
145217 * }}}
146218 *
147219 * @param uri
148220 * The resource path where the target endpoint will be reached at. Query parameters can be passed in as part of the
149221 * URI but should be encoded if containing special characters.
150- * @param body
151- * The HTTP body type expected by the target endpoint
152222 * @param returnType
153223 * The type returned by the target endpoint
154- * @tparam P
155- * Type used as a body for the request
156224 * @tparam R
157225 * Type returned as response from the target endpoint
158226 * @return
159227 * a [[kalix.javasdk.DeferredCall ]] to be used in forwards and timers or to be executed in place
160228 */
161- def delete [P , R ](uri : String , body : P , returnType : Class [R ]): DeferredCall [Any , R ]
229+ def delete [R ](uri : String , returnType : Class [R ]): DeferredCall [Any , R ]
162230}
0 commit comments