From e36fc68e111941df66ccb5bfaeb4302503a9675f Mon Sep 17 00:00:00 2001 From: Ty Book Date: Mon, 28 Oct 2024 22:53:58 -0400 Subject: [PATCH] Bring back the suggestedFollows API that was incorrectly removed --- .../v2/openapi-farcaster/apis/follows-api.ts | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts index 73c0c30..705b44c 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts @@ -29,6 +29,8 @@ import { FollowSortType } from '../models'; import { FollowersResponse } from '../models'; // @ts-ignore import { RelevantFollowersResponse } from '../models'; +// @ts-ignore +import { UsersResponse } from '../models'; /** * FollowsApi - axios parameter creator * @export @@ -205,6 +207,60 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetch a list of suggested users to follow. Used to help users discover new users to follow + * @summary Suggest Follows + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user whose following you want to fetch. + * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (default 25, max 100) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + suggestedFollows: async (apiKey: string, fid: number, viewerFid?: number, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('suggestedFollows', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('suggestedFollows', 'fid', fid) + const localVarPath = `/farcaster/following/suggested`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -269,6 +325,20 @@ export const FollowsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.relevantFollowers(apiKey, targetFid, viewerFid, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Fetch a list of suggested users to follow. Used to help users discover new users to follow + * @summary Suggest Follows + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user whose following you want to fetch. + * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (default 25, max 100) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async suggestedFollows(apiKey: string, fid: number, viewerFid?: number, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.suggestedFollows(apiKey, fid, viewerFid, limit, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, } }; @@ -321,6 +391,19 @@ export const FollowsApiFactory = function (configuration?: Configuration, basePa relevantFollowers(apiKey: string, targetFid: number, viewerFid: number, options?: any): AxiosPromise { return localVarFp.relevantFollowers(apiKey, targetFid, viewerFid, options).then((request) => request(axios, basePath)); }, + /** + * Fetch a list of suggested users to follow. Used to help users discover new users to follow + * @summary Suggest Follows + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user whose following you want to fetch. + * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (default 25, max 100) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + suggestedFollows(apiKey: string, fid: number, viewerFid?: number, limit?: number, options?: any): AxiosPromise { + return localVarFp.suggestedFollows(apiKey, fid, viewerFid, limit, options).then((request) => request(axios, basePath)); + }, }; }; @@ -378,4 +461,19 @@ export class FollowsApi extends BaseAPI { public relevantFollowers(apiKey: string, targetFid: number, viewerFid: number, options?: AxiosRequestConfig) { return FollowsApiFp(this.configuration).relevantFollowers(apiKey, targetFid, viewerFid, options).then((request) => request(this.axios, this.basePath)); } + + /** + * Fetch a list of suggested users to follow. Used to help users discover new users to follow + * @summary Suggest Follows + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user whose following you want to fetch. + * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (default 25, max 100) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FollowsApi + */ + public suggestedFollows(apiKey: string, fid: number, viewerFid?: number, limit?: number, options?: AxiosRequestConfig) { + return FollowsApiFp(this.configuration).suggestedFollows(apiKey, fid, viewerFid, limit, options).then((request) => request(this.axios, this.basePath)); + } }