Skip to content

Commit

Permalink
Bring back the suggestedFollows API that was incorrectly removed
Browse files Browse the repository at this point in the history
  • Loading branch information
tybook committed Oct 29, 2024
1 parent afd3a6c commit e36fc68
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<RequestArgs> => {
// 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};
Expand Down Expand Up @@ -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\&#39;s mutes and blocks and includes &#x60;viewer_context&#x60;.
* @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<UsersResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.suggestedFollows(apiKey, fid, viewerFid, limit, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};

Expand Down Expand Up @@ -321,6 +391,19 @@ export const FollowsApiFactory = function (configuration?: Configuration, basePa
relevantFollowers(apiKey: string, targetFid: number, viewerFid: number, options?: any): AxiosPromise<RelevantFollowersResponse> {
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\&#39;s mutes and blocks and includes &#x60;viewer_context&#x60;.
* @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<UsersResponse> {
return localVarFp.suggestedFollows(apiKey, fid, viewerFid, limit, options).then((request) => request(axios, basePath));
},
};
};

Expand Down Expand Up @@ -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\&#39;s mutes and blocks and includes &#x60;viewer_context&#x60;.
* @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));
}
}

0 comments on commit e36fc68

Please sign in to comment.