@@ -70,8 +70,8 @@ export class Offerings {
7070 headers : {
7171 "X-Fern-Language" : "JavaScript" ,
7272 "X-Fern-SDK-Name" : "@opengovsg/refx-ts-sdk" ,
73- "X-Fern-SDK-Version" : "0.0.0-develop-1748577388 " ,
74- "User-Agent" : "@opengovsg/refx-ts-sdk/0.0.0-develop-1748577388 " ,
73+ "X-Fern-SDK-Version" : "0.0.40 " ,
74+ "User-Agent" : "@opengovsg/refx-ts-sdk/0.0.40 " ,
7575 "X-Fern-Runtime" : core . RUNTIME . type ,
7676 "X-Fern-Runtime-Version" : core . RUNTIME . version ,
7777 ...( await this . _getCustomAuthorizationHeaders ( ) ) ,
@@ -115,6 +115,87 @@ export class Offerings {
115115 }
116116 }
117117
118+ /**
119+ * @param {ReferralExchange.ApiHoldingControllerGetRecommendedOfferingRequest } request
120+ * @param {Offerings.RequestOptions } requestOptions - Request-specific configuration.
121+ *
122+ * @throws {@link ReferralExchange.UnauthorizedError }
123+ * @throws {@link ReferralExchange.NotFoundError }
124+ *
125+ * @example
126+ * await client.offerings.apiHoldingControllerGetRecommendedOffering({
127+ * category: "aac service",
128+ * postalCode: "postalCode"
129+ * })
130+ */
131+ public async apiHoldingControllerGetRecommendedOffering (
132+ request : ReferralExchange . ApiHoldingControllerGetRecommendedOfferingRequest ,
133+ requestOptions ?: Offerings . RequestOptions ,
134+ ) : Promise < ReferralExchange . OfferingDto > {
135+ const { category, postalCode } = request ;
136+ const _queryParams : Record < string , string | string [ ] | object | object [ ] | null > = { } ;
137+ _queryParams [ "category" ] = category ;
138+ _queryParams [ "postalCode" ] = postalCode ;
139+ const _response = await ( this . _options . fetcher ?? core . fetcher ) ( {
140+ url : urlJoin (
141+ ( await core . Supplier . get ( this . _options . baseUrl ) ) ??
142+ ( await core . Supplier . get ( this . _options . environment ) ) ??
143+ environments . ReferralExchangeEnvironment . SmartCms ,
144+ "api/v1/offerings/recommended" ,
145+ ) ,
146+ method : "GET" ,
147+ headers : {
148+ "X-Fern-Language" : "JavaScript" ,
149+ "X-Fern-SDK-Name" : "@opengovsg/refx-ts-sdk" ,
150+ "X-Fern-SDK-Version" : "0.0.40" ,
151+ "User-Agent" : "@opengovsg/refx-ts-sdk/0.0.40" ,
152+ "X-Fern-Runtime" : core . RUNTIME . type ,
153+ "X-Fern-Runtime-Version" : core . RUNTIME . version ,
154+ ...( await this . _getCustomAuthorizationHeaders ( ) ) ,
155+ ...requestOptions ?. headers ,
156+ } ,
157+ contentType : "application/json" ,
158+ queryParameters : _queryParams ,
159+ requestType : "json" ,
160+ timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 60000 ,
161+ maxRetries : requestOptions ?. maxRetries ,
162+ abortSignal : requestOptions ?. abortSignal ,
163+ } ) ;
164+ if ( _response . ok ) {
165+ return _response . body as ReferralExchange . OfferingDto ;
166+ }
167+
168+ if ( _response . error . reason === "status-code" ) {
169+ switch ( _response . error . statusCode ) {
170+ case 401 :
171+ throw new ReferralExchange . UnauthorizedError ( _response . error . body as unknown ) ;
172+ case 404 :
173+ throw new ReferralExchange . NotFoundError ( _response . error . body as unknown ) ;
174+ default :
175+ throw new errors . ReferralExchangeError ( {
176+ statusCode : _response . error . statusCode ,
177+ body : _response . error . body ,
178+ } ) ;
179+ }
180+ }
181+
182+ switch ( _response . error . reason ) {
183+ case "non-json" :
184+ throw new errors . ReferralExchangeError ( {
185+ statusCode : _response . error . statusCode ,
186+ body : _response . error . rawBody ,
187+ } ) ;
188+ case "timeout" :
189+ throw new errors . ReferralExchangeTimeoutError (
190+ "Timeout exceeded when calling GET /api/v1/offerings/recommended." ,
191+ ) ;
192+ case "unknown" :
193+ throw new errors . ReferralExchangeError ( {
194+ message : _response . error . errorMessage ,
195+ } ) ;
196+ }
197+ }
198+
118199 /**
119200 * @param {string } offeringId
120201 * @param {ReferralExchange.OfferingsListTimeslotsRequest } request
@@ -150,8 +231,8 @@ export class Offerings {
150231 headers : {
151232 "X-Fern-Language" : "JavaScript" ,
152233 "X-Fern-SDK-Name" : "@opengovsg/refx-ts-sdk" ,
153- "X-Fern-SDK-Version" : "0.0.0-develop-1748577388 " ,
154- "User-Agent" : "@opengovsg/refx-ts-sdk/0.0.0-develop-1748577388 " ,
234+ "X-Fern-SDK-Version" : "0.0.40 " ,
235+ "User-Agent" : "@opengovsg/refx-ts-sdk/0.0.40 " ,
155236 "X-Fern-Runtime" : core . RUNTIME . type ,
156237 "X-Fern-Runtime-Version" : core . RUNTIME . version ,
157238 ...( await this . _getCustomAuthorizationHeaders ( ) ) ,
0 commit comments