@standard-crypto/farcaster-js-warpcast
Version:
A tool for interacting with the private APIs of the Warpcast client.
253 lines • 12 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* Warpcast API
* Private API used by the Warpcast client
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setBearerAuthToObject, setSearchParams, toPathString, createRequestFunction } from '../common.js';
// @ts-ignore
import { BASE_PATH, BaseAPI } from '../base.js';
/**
* DirectCastsApi - axios parameter creator
* @export
*/
export const DirectCastsApiAxiosParamCreator = function (configuration) {
return {
/**
*
* @param {string} conversationId
* @param {number} [limit] Maximum number of items to return in a single response
* @param {string} [cursor] Cursor to paginate through results
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationDetailsGet: async (conversationId, limit, cursor, options = {}) => {
// verify required parameter 'conversationId' is not null or undefined
assertParamExists('v2DirectCastConversationDetailsGet', 'conversationId', conversationId);
const localVarPath = `/v2/direct-cast-conversation-details`;
// 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 = {};
const localVarQueryParameter = {};
// authentication TokenCredentials required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
if (conversationId !== undefined) {
localVarQueryParameter['conversationId'] = conversationId;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} conversationId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationGet: async (conversationId, options = {}) => {
// verify required parameter 'conversationId' is not null or undefined
assertParamExists('v2DirectCastConversationGet', 'conversationId', conversationId);
const localVarPath = `/v2/direct-cast-conversation`;
// 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 = {};
const localVarQueryParameter = {};
// authentication TokenCredentials required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
if (conversationId !== undefined) {
localVarQueryParameter['conversationId'] = conversationId;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {number} [limit] Maximum number of items to return in a single response
* @param {string} [cursor] Cursor to paginate through results
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationListGet: async (limit, cursor, options = {}) => {
const localVarPath = `/v2/direct-cast-conversation-list`;
// 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 = {};
const localVarQueryParameter = {};
// authentication TokenCredentials required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* DirectCastsApi - functional programming interface
* @export
*/
export const DirectCastsApiFp = function (configuration) {
const localVarAxiosParamCreator = DirectCastsApiAxiosParamCreator(configuration);
return {
/**
*
* @param {string} conversationId
* @param {number} [limit] Maximum number of items to return in a single response
* @param {string} [cursor] Cursor to paginate through results
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v2DirectCastConversationDetailsGet(conversationId, limit, cursor, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v2DirectCastConversationDetailsGet(conversationId, limit, cursor, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} conversationId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v2DirectCastConversationGet(conversationId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v2DirectCastConversationGet(conversationId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {number} [limit] Maximum number of items to return in a single response
* @param {string} [cursor] Cursor to paginate through results
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v2DirectCastConversationListGet(limit, cursor, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v2DirectCastConversationListGet(limit, cursor, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* DirectCastsApi - factory interface
* @export
*/
export const DirectCastsApiFactory = function (configuration, basePath, axios) {
const localVarFp = DirectCastsApiFp(configuration);
return {
/**
*
* @param {DirectCastsApiV2DirectCastConversationDetailsGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationDetailsGet(requestParameters, options) {
return localVarFp.v2DirectCastConversationDetailsGet(requestParameters.conversationId, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath));
},
/**
*
* @param {DirectCastsApiV2DirectCastConversationGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationGet(requestParameters, options) {
return localVarFp.v2DirectCastConversationGet(requestParameters.conversationId, options).then((request) => request(axios, basePath));
},
/**
*
* @param {DirectCastsApiV2DirectCastConversationListGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationListGet(requestParameters = {}, options) {
return localVarFp.v2DirectCastConversationListGet(requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath));
},
};
};
/**
* DirectCastsApi - object-oriented interface
* @export
* @class DirectCastsApi
* @extends {BaseAPI}
*/
export class DirectCastsApi extends BaseAPI {
/**
*
* @param {DirectCastsApiV2DirectCastConversationDetailsGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DirectCastsApi
*/
v2DirectCastConversationDetailsGet(requestParameters, options) {
return DirectCastsApiFp(this.configuration).v2DirectCastConversationDetailsGet(requestParameters.conversationId, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {DirectCastsApiV2DirectCastConversationGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DirectCastsApi
*/
v2DirectCastConversationGet(requestParameters, options) {
return DirectCastsApiFp(this.configuration).v2DirectCastConversationGet(requestParameters.conversationId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {DirectCastsApiV2DirectCastConversationListGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DirectCastsApi
*/
v2DirectCastConversationListGet(requestParameters = {}, options) {
return DirectCastsApiFp(this.configuration).v2DirectCastConversationListGet(requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath));
}
}
//# sourceMappingURL=direct-casts-api.js.map