1313import com .pipedream .api .resources .proxy .types .ProxyResponse ;
1414import java .util .Base64 ;
1515import java .util .concurrent .CompletableFuture ;
16+ import okhttp3 .HttpUrl ;
1617
1718public class AsyncProxyClient {
1819 protected final ClientOptions clientOptions ;
@@ -43,6 +44,13 @@ public CompletableFuture<ProxyResponse> get(String url, ProxyGetRequest request)
4344 return this .rawClient .get (url64 , request ).thenApply (response -> response .body ());
4445 }
4546
47+ /**
48+ * Forward an authenticated GET request to an external API using an external user's account credentials
49+ */
50+ public CompletableFuture <ProxyResponse > get (HttpUrl url , ProxyGetRequest request ) {
51+ return get (url .toString (), request );
52+ }
53+
4654 /**
4755 * Forward an authenticated GET request to an external API using an external user's account credentials
4856 */
@@ -51,6 +59,13 @@ public CompletableFuture<ProxyResponse> get(String url, ProxyGetRequest request,
5159 return this .rawClient .get (url64 , request , requestOptions ).thenApply (response -> response .body ());
5260 }
5361
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+
5469 /**
5570 * Forward an authenticated POST request to an external API using an external user's account credentials
5671 */
@@ -59,6 +74,13 @@ public CompletableFuture<ProxyResponse> post(String url, ProxyPostRequest reques
5974 return this .rawClient .post (url64 , request ).thenApply (response -> response .body ());
6075 }
6176
77+ /**
78+ * Forward an authenticated POST request to an external API using an external user's account credentials
79+ */
80+ public CompletableFuture <ProxyResponse > post (HttpUrl url , ProxyPostRequest request ) {
81+ return post (url .toString (), request );
82+ }
83+
6284 /**
6385 * Forward an authenticated POST request to an external API using an external user's account credentials
6486 */
@@ -67,6 +89,13 @@ public CompletableFuture<ProxyResponse> post(String url, ProxyPostRequest reques
6789 return this .rawClient .post (url64 , request , requestOptions ).thenApply (response -> response .body ());
6890 }
6991
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+
7099 /**
71100 * Forward an authenticated PUT request to an external API using an external user's account credentials
72101 */
@@ -75,6 +104,13 @@ public CompletableFuture<ProxyResponse> put(String url, ProxyPutRequest request)
75104 return this .rawClient .put (url64 , request ).thenApply (response -> response .body ());
76105 }
77106
107+ /**
108+ * Forward an authenticated PUT request to an external API using an external user's account credentials
109+ */
110+ public CompletableFuture <ProxyResponse > put (HttpUrl url , ProxyPutRequest request ) {
111+ return put (url .toString (), request );
112+ }
113+
78114 /**
79115 * Forward an authenticated PUT request to an external API using an external user's account credentials
80116 */
@@ -83,6 +119,13 @@ public CompletableFuture<ProxyResponse> put(String url, ProxyPutRequest request,
83119 return this .rawClient .put (url64 , request , requestOptions ).thenApply (response -> response .body ());
84120 }
85121
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+
86129 /**
87130 * Forward an authenticated DELETE request to an external API using an external user's account credentials
88131 */
@@ -91,6 +134,13 @@ public CompletableFuture<ProxyResponse> delete(String url, ProxyDeleteRequest re
91134 return this .rawClient .delete (url64 , request ).thenApply (response -> response .body ());
92135 }
93136
137+ /**
138+ * Forward an authenticated DELETE request to an external API using an external user's account credentials
139+ */
140+ public CompletableFuture <ProxyResponse > delete (HttpUrl url , ProxyDeleteRequest request ) {
141+ return delete (url .toString (), request );
142+ }
143+
94144 /**
95145 * Forward an authenticated DELETE request to an external API using an external user's account credentials
96146 */
@@ -100,6 +150,14 @@ public CompletableFuture<ProxyResponse> delete(
100150 return this .rawClient .delete (url64 , request , requestOptions ).thenApply (response -> response .body ());
101151 }
102152
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+
103161 /**
104162 * Forward an authenticated PATCH request to an external API using an external user's account credentials
105163 */
@@ -108,6 +166,13 @@ public CompletableFuture<ProxyResponse> patch(String url, ProxyPatchRequest requ
108166 return this .rawClient .patch (url64 , request ).thenApply (response -> response .body ());
109167 }
110168
169+ /**
170+ * Forward an authenticated PATCH request to an external API using an external user's account credentials
171+ */
172+ public CompletableFuture <ProxyResponse > patch (HttpUrl url , ProxyPatchRequest request ) {
173+ return patch (url .toString (), request );
174+ }
175+
111176 /**
112177 * Forward an authenticated PATCH request to an external API using an external user's account credentials
113178 */
@@ -116,4 +181,12 @@ public CompletableFuture<ProxyResponse> patch(
116181 final String url64 = encodeUrl (url );
117182 return this .rawClient .patch (url64 , request , requestOptions ).thenApply (response -> response .body ());
118183 }
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+ }
119192}
0 commit comments