1010import com .pipedream .api .resources .proxy .requests .ProxyPatchRequest ;
1111import com .pipedream .api .resources .proxy .requests .ProxyPostRequest ;
1212import com .pipedream .api .resources .proxy .requests .ProxyPutRequest ;
13+ import com .pipedream .api .resources .proxy .types .ProxyResponse ;
1314import java .util .Base64 ;
1415import java .util .concurrent .CompletableFuture ;
16+ import okhttp3 .HttpUrl ;
1517
1618public class AsyncProxyClient {
1719 protected final ClientOptions clientOptions ;
@@ -37,80 +39,154 @@ public AsyncRawProxyClient withRawResponse() {
3739 /**
3840 * Forward an authenticated GET request to an external API using an external user's account credentials
3941 */
40- public CompletableFuture <Object > get (String url , ProxyGetRequest request ) {
42+ public CompletableFuture <ProxyResponse > get (String url , ProxyGetRequest request ) {
4143 final String url64 = encodeUrl (url );
4244 return this .rawClient .get (url64 , request ).thenApply (response -> response .body ());
4345 }
4446
4547 /**
4648 * Forward an authenticated GET request to an external API using an external user's account credentials
4749 */
48- public CompletableFuture <Object > get (String url , ProxyGetRequest request , RequestOptions requestOptions ) {
50+ public CompletableFuture <ProxyResponse > get (HttpUrl url , ProxyGetRequest request ) {
51+ return get (url .toString (), request );
52+ }
53+
54+ /**
55+ * Forward an authenticated GET request to an external API using an external user's account credentials
56+ */
57+ public CompletableFuture <ProxyResponse > get (String url , ProxyGetRequest request , RequestOptions requestOptions ) {
4958 final String url64 = encodeUrl (url );
5059 return this .rawClient .get (url64 , request , requestOptions ).thenApply (response -> response .body ());
5160 }
5261
62+ /**
63+ * Forward an authenticated GET request to an external API using an external user's account credentials
64+ */
65+ public CompletableFuture <ProxyResponse > get (HttpUrl url , ProxyGetRequest request , RequestOptions requestOptions ) {
66+ return get (url .toString (), request , requestOptions );
67+ }
68+
5369 /**
5470 * Forward an authenticated POST request to an external API using an external user's account credentials
5571 */
56- public CompletableFuture <Object > post (String url , ProxyPostRequest request ) {
72+ public CompletableFuture <ProxyResponse > post (String url , ProxyPostRequest request ) {
5773 final String url64 = encodeUrl (url );
5874 return this .rawClient .post (url64 , request ).thenApply (response -> response .body ());
5975 }
6076
6177 /**
6278 * Forward an authenticated POST request to an external API using an external user's account credentials
6379 */
64- public CompletableFuture <Object > post (String url , ProxyPostRequest request , RequestOptions requestOptions ) {
80+ public CompletableFuture <ProxyResponse > post (HttpUrl url , ProxyPostRequest request ) {
81+ return post (url .toString (), request );
82+ }
83+
84+ /**
85+ * Forward an authenticated POST request to an external API using an external user's account credentials
86+ */
87+ public CompletableFuture <ProxyResponse > post (String url , ProxyPostRequest request , RequestOptions requestOptions ) {
6588 final String url64 = encodeUrl (url );
6689 return this .rawClient .post (url64 , request , requestOptions ).thenApply (response -> response .body ());
6790 }
6891
92+ /**
93+ * Forward an authenticated POST request to an external API using an external user's account credentials
94+ */
95+ public CompletableFuture <ProxyResponse > post (HttpUrl url , ProxyPostRequest request , RequestOptions requestOptions ) {
96+ return post (url .toString (), request , requestOptions );
97+ }
98+
6999 /**
70100 * Forward an authenticated PUT request to an external API using an external user's account credentials
71101 */
72- public CompletableFuture <Object > put (String url , ProxyPutRequest request ) {
102+ public CompletableFuture <ProxyResponse > put (String url , ProxyPutRequest request ) {
73103 final String url64 = encodeUrl (url );
74104 return this .rawClient .put (url64 , request ).thenApply (response -> response .body ());
75105 }
76106
77107 /**
78108 * Forward an authenticated PUT request to an external API using an external user's account credentials
79109 */
80- public CompletableFuture <Object > put (String url , ProxyPutRequest request , RequestOptions requestOptions ) {
110+ public CompletableFuture <ProxyResponse > put (HttpUrl url , ProxyPutRequest request ) {
111+ return put (url .toString (), request );
112+ }
113+
114+ /**
115+ * Forward an authenticated PUT request to an external API using an external user's account credentials
116+ */
117+ public CompletableFuture <ProxyResponse > put (String url , ProxyPutRequest request , RequestOptions requestOptions ) {
81118 final String url64 = encodeUrl (url );
82119 return this .rawClient .put (url64 , request , requestOptions ).thenApply (response -> response .body ());
83120 }
84121
122+ /**
123+ * Forward an authenticated PUT request to an external API using an external user's account credentials
124+ */
125+ public CompletableFuture <ProxyResponse > put (HttpUrl url , ProxyPutRequest request , RequestOptions requestOptions ) {
126+ return put (url .toString (), request , requestOptions );
127+ }
128+
85129 /**
86130 * Forward an authenticated DELETE request to an external API using an external user's account credentials
87131 */
88- public CompletableFuture <Object > delete (String url , ProxyDeleteRequest request ) {
132+ public CompletableFuture <ProxyResponse > delete (String url , ProxyDeleteRequest request ) {
89133 final String url64 = encodeUrl (url );
90134 return this .rawClient .delete (url64 , request ).thenApply (response -> response .body ());
91135 }
92136
93137 /**
94138 * Forward an authenticated DELETE request to an external API using an external user's account credentials
95139 */
96- public CompletableFuture <Object > delete (String url , ProxyDeleteRequest request , RequestOptions requestOptions ) {
140+ public CompletableFuture <ProxyResponse > delete (HttpUrl url , ProxyDeleteRequest request ) {
141+ return delete (url .toString (), request );
142+ }
143+
144+ /**
145+ * Forward an authenticated DELETE request to an external API using an external user's account credentials
146+ */
147+ public CompletableFuture <ProxyResponse > delete (
148+ String url , ProxyDeleteRequest request , RequestOptions requestOptions ) {
97149 final String url64 = encodeUrl (url );
98150 return this .rawClient .delete (url64 , request , requestOptions ).thenApply (response -> response .body ());
99151 }
100152
153+ /**
154+ * Forward an authenticated DELETE request to an external API using an external user's account credentials
155+ */
156+ public CompletableFuture <ProxyResponse > delete (
157+ HttpUrl url , ProxyDeleteRequest request , RequestOptions requestOptions ) {
158+ return delete (url .toString (), request , requestOptions );
159+ }
160+
101161 /**
102162 * Forward an authenticated PATCH request to an external API using an external user's account credentials
103163 */
104- public CompletableFuture <Object > patch (String url , ProxyPatchRequest request ) {
164+ public CompletableFuture <ProxyResponse > patch (String url , ProxyPatchRequest request ) {
105165 final String url64 = encodeUrl (url );
106166 return this .rawClient .patch (url64 , request ).thenApply (response -> response .body ());
107167 }
108168
109169 /**
110170 * Forward an authenticated PATCH request to an external API using an external user's account credentials
111171 */
112- public CompletableFuture <Object > patch (String url , ProxyPatchRequest request , RequestOptions requestOptions ) {
172+ public CompletableFuture <ProxyResponse > patch (HttpUrl url , ProxyPatchRequest request ) {
173+ return patch (url .toString (), request );
174+ }
175+
176+ /**
177+ * Forward an authenticated PATCH request to an external API using an external user's account credentials
178+ */
179+ public CompletableFuture <ProxyResponse > patch (
180+ String url , ProxyPatchRequest request , RequestOptions requestOptions ) {
113181 final String url64 = encodeUrl (url );
114182 return this .rawClient .patch (url64 , request , requestOptions ).thenApply (response -> response .body ());
115183 }
184+
185+ /**
186+ * Forward an authenticated PATCH request to an external API using an external user's account credentials
187+ */
188+ public CompletableFuture <ProxyResponse > patch (
189+ HttpUrl url , ProxyPatchRequest request , RequestOptions requestOptions ) {
190+ return patch (url .toString (), request , requestOptions );
191+ }
116192}
0 commit comments