@@ -6,6 +6,7 @@ import * as environments from "../../../../environments.js";
66import * as core from "../../../../core/index.js" ;
77import * as Pipedream from "../../../index.js" ;
88import { mergeHeaders , mergeOnlyDefinedHeaders } from "../../../../core/headers.js" ;
9+ import * as serializers from "../../../../serialization/index.js" ;
910import * as errors from "../../../../errors/index.js" ;
1011
1112export declare namespace Accounts {
@@ -59,15 +60,7 @@ export class Accounts {
5960 async (
6061 request : Pipedream . AccountsListRequest ,
6162 ) : Promise < core . WithRawResponse < Pipedream . ListAccountsResponse > > => {
62- const {
63- app_id : appId ,
64- external_user_id : externalUserId ,
65- oauth_app_id : oauthAppId ,
66- after,
67- before,
68- limit,
69- include_credentials : includeCredentials ,
70- } = request ;
63+ const { appId, externalUserId, oauthAppId, after, before, limit, includeCredentials } = request ;
7164 const _queryParams : Record < string , string | string [ ] | object | object [ ] | null > = { } ;
7265 if ( appId != null ) {
7366 _queryParams [ "app_id" ] = appId ;
@@ -114,7 +107,13 @@ export class Accounts {
114107 } ) ;
115108 if ( _response . ok ) {
116109 return {
117- data : _response . body as Pipedream . ListAccountsResponse ,
110+ data : serializers . ListAccountsResponse . parseOrThrow ( _response . body , {
111+ unrecognizedObjectKeys : "passthrough" ,
112+ allowUnrecognizedUnionMembers : true ,
113+ allowUnrecognizedEnumValues : true ,
114+ skipValidation : true ,
115+ breadcrumbsPrefix : [ "response" ] ,
116+ } ) ,
118117 rawResponse : _response . rawResponse ,
119118 } ;
120119 }
@@ -149,11 +148,11 @@ export class Accounts {
149148 response : dataWithRawResponse . data ,
150149 rawResponse : dataWithRawResponse . rawResponse ,
151150 hasNextPage : ( response ) =>
152- response ?. page_info ?. end_cursor != null &&
153- ! ( typeof response ?. page_info ?. end_cursor === "string" && response ?. page_info ?. end_cursor === "" ) ,
151+ response ?. pageInfo ?. endCursor != null &&
152+ ! ( typeof response ?. pageInfo ?. endCursor === "string" && response ?. pageInfo ?. endCursor === "" ) ,
154153 getItems : ( response ) => response ?. data ?? [ ] ,
155154 loadPage : ( response ) => {
156- return list ( core . setObjectProperty ( request , "after" , response ?. page_info ?. end_cursor ) ) ;
155+ return list ( core . setObjectProperty ( request , "after" , response ?. pageInfo ?. endCursor ) ) ;
157156 } ,
158157 } ) ;
159158 }
@@ -164,9 +163,9 @@ export class Accounts {
164163 *
165164 * @example
166165 * await client.accounts.create({
167- * app_slug : "app_slug",
168- * cfmap_json : "cfmap_json",
169- * connect_token : "connect_token"
166+ * appSlug : "app_slug",
167+ * cfmapJson : "cfmap_json",
168+ * connectToken : "connect_token"
170169 * })
171170 */
172171 public create (
@@ -180,7 +179,7 @@ export class Accounts {
180179 request : Pipedream . CreateAccountOpts ,
181180 requestOptions ?: Accounts . RequestOptions ,
182181 ) : Promise < core . WithRawResponse < Pipedream . Account > > {
183- const { app_id : appId , external_user_id : externalUserId , oauth_app_id : oauthAppId , ..._body } = request ;
182+ const { appId, externalUserId, oauthAppId, ..._body } = request ;
184183 const _queryParams : Record < string , string | string [ ] | object | object [ ] | null > = { } ;
185184 if ( appId != null ) {
186185 _queryParams [ "app_id" ] = appId ;
@@ -213,13 +212,25 @@ export class Accounts {
213212 contentType : "application/json" ,
214213 queryParameters : { ..._queryParams , ...requestOptions ?. queryParams } ,
215214 requestType : "json" ,
216- body : _body ,
215+ body : serializers . CreateAccountOpts . jsonOrThrow ( _body , {
216+ unrecognizedObjectKeys : "strip" ,
217+ omitUndefined : true ,
218+ } ) ,
217219 timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 60000 ,
218220 maxRetries : requestOptions ?. maxRetries ,
219221 abortSignal : requestOptions ?. abortSignal ,
220222 } ) ;
221223 if ( _response . ok ) {
222- return { data : _response . body as Pipedream . Account , rawResponse : _response . rawResponse } ;
224+ return {
225+ data : serializers . Account . parseOrThrow ( _response . body , {
226+ unrecognizedObjectKeys : "passthrough" ,
227+ allowUnrecognizedUnionMembers : true ,
228+ allowUnrecognizedEnumValues : true ,
229+ skipValidation : true ,
230+ breadcrumbsPrefix : [ "response" ] ,
231+ } ) ,
232+ rawResponse : _response . rawResponse ,
233+ } ;
223234 }
224235
225236 if ( _response . error . reason === "status-code" ) {
@@ -270,7 +281,7 @@ export class Accounts {
270281 request : Pipedream . AccountsRetrieveRequest = { } ,
271282 requestOptions ?: Accounts . RequestOptions ,
272283 ) : Promise < core . WithRawResponse < Pipedream . Account > > {
273- const { include_credentials : includeCredentials } = request ;
284+ const { includeCredentials } = request ;
274285 const _queryParams : Record < string , string | string [ ] | object | object [ ] | null > = { } ;
275286 if ( includeCredentials != null ) {
276287 _queryParams [ "include_credentials" ] = includeCredentials . toString ( ) ;
@@ -298,7 +309,16 @@ export class Accounts {
298309 abortSignal : requestOptions ?. abortSignal ,
299310 } ) ;
300311 if ( _response . ok ) {
301- return { data : _response . body as Pipedream . Account , rawResponse : _response . rawResponse } ;
312+ return {
313+ data : serializers . Account . parseOrThrow ( _response . body , {
314+ unrecognizedObjectKeys : "passthrough" ,
315+ allowUnrecognizedUnionMembers : true ,
316+ allowUnrecognizedEnumValues : true ,
317+ skipValidation : true ,
318+ breadcrumbsPrefix : [ "response" ] ,
319+ } ) ,
320+ rawResponse : _response . rawResponse ,
321+ } ;
302322 }
303323
304324 if ( _response . error . reason === "status-code" ) {
0 commit comments