@@ -30,7 +30,7 @@ const client = new Stainless({
3030});
3131
3232async function main () {
33- const output = await client .builds .outputs .retrieve ({ id : ' bui_123 ' , target : ' node ' });
33+ const output = await client .builds .outputs .retrieve (' node ' , { id : ' bui_123 ' });
3434
3535 console .log (output .commit );
3636}
@@ -51,8 +51,11 @@ const client = new Stainless({
5151});
5252
5353async function main() {
54- const params: Stainless .Builds .OutputRetrieveParams = { id: ' bui_123' , target: ' node' };
55- const output: Stainless .Builds .OutputRetrieveResponse = await client .builds .outputs .retrieve (params );
54+ const params: Stainless .Builds .OutputRetrieveParams = { id: ' bui_123' };
55+ const output: Stainless .Builds .OutputRetrieveResponse = await client .builds .outputs .retrieve (
56+ ' node' ,
57+ params ,
58+ );
5659}
5760
5861main ();
@@ -69,17 +72,15 @@ a subclass of `APIError` will be thrown:
6972<!-- prettier-ignore -->
7073``` ts
7174async function main() {
72- const output = await client .builds .outputs
73- .retrieve ({ id: ' bui_123' , target: ' node' })
74- .catch (async (err ) => {
75- if (err instanceof Stainless .APIError ) {
76- console .log (err .status ); // 400
77- console .log (err .name ); // BadRequestError
78- console .log (err .headers ); // {server: 'nginx', ...}
79- } else {
80- throw err ;
81- }
82- });
75+ const output = await client .builds .outputs .retrieve (' node' , { id: ' bui_123' }).catch (async (err ) => {
76+ if (err instanceof Stainless .APIError ) {
77+ console .log (err .status ); // 400
78+ console .log (err .name ); // BadRequestError
79+ console .log (err .headers ); // {server: 'nginx', ...}
80+ } else {
81+ throw err ;
82+ }
83+ });
8384}
8485
8586main ();
@@ -114,7 +115,7 @@ const client = new Stainless({
114115});
115116
116117// Or, configure per-request:
117- await client .builds .outputs .retrieve ({ id : ' bui_123 ' , target : ' node ' }, {
118+ await client .builds .outputs .retrieve (' node ' , { id : ' bui_123 ' }, {
118119 maxRetries: 5 ,
119120});
120121```
@@ -131,7 +132,7 @@ const client = new Stainless({
131132});
132133
133134// Override per-request:
134- await client .builds .outputs .retrieve ({ id: ' bui_123 ' , target : ' node ' }, {
135+ await client .builds .outputs .retrieve (' node ' , { id : ' bui_123 ' }, {
135136 timeout: 5 * 1000 ,
136137});
137138```
@@ -152,12 +153,12 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
152153``` ts
153154const client = new Stainless ();
154155
155- const response = await client .builds .outputs .retrieve ({ id: ' bui_123 ' , target : ' node ' }).asResponse ();
156+ const response = await client .builds .outputs .retrieve (' node ' , { id : ' bui_123 ' }).asResponse ();
156157console .log (response .headers .get (' X-My-Header' ));
157158console .log (response .statusText ); // access the underlying Response object
158159
159160const { data : output, response : raw } = await client .builds .outputs
160- .retrieve ({ id: ' bui_123 ' , target : ' node ' })
161+ .retrieve (' node ' , { id : ' bui_123 ' })
161162 .withResponse ();
162163console .log (raw .headers .get (' X-My-Header' ));
163164console .log (output .commit );
@@ -267,7 +268,8 @@ const client = new Stainless({
267268
268269// Override per-request:
269270await client .builds .outputs .retrieve (
270- { id: ' bui_123' , target: ' node' },
271+ ' node' ,
272+ { id: ' bui_123' },
271273 {
272274 httpAgent: new http .Agent ({ keepAlive: false }),
273275 },
0 commit comments