export type GetApiApplicationApplicationIdAnalyticsV1CohortsCohortIdMemberCountArgs = {applicationId: number, cohortId: number, environment_id: number}; export type GetApiApplicationApplicationIdAnalyticsV1CohortsCohortIdMemberCountOptions = {baseUrl?: string | undefined, personalAccessTokenAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get the member count for a cohort * * GET /application/{applicationId}/analytics/v1/cohorts/{cohortId}/member-count */ export const getApiApplicationApplicationIdAnalyticsV1CohortsCohortIdMemberCount = async (args: GetApiApplicationApplicationIdAnalyticsV1CohortsCohortIdMemberCountArgs, options?: GetApiApplicationApplicationIdAnalyticsV1CohortsCohortIdMemberCountOptions) => { const {baseUrl = "https://api.gamebeast.gg", fetch: fetchFn = fetch, personalAccessTokenAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.environment_id != null) headers.set("environment_id", String(args.environment_id)) if (personalAccessTokenAuth !== undefined) headers.set('authorization', `Bearer ${personalAccessTokenAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/application/${encodeURIComponent(String(args.applicationId))}/analytics/v1/cohorts/${encodeURIComponent(String(args.cohortId))}/member-count${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };