11// This file is auto-generated by @hey-api/openapi-ts
22
3- import type { Options as ClientOptions , TDataShape , Client } from '@hey-api/client-fetch' ;
4- import type { GetContentTypesData , GetContentTypesResponse , GetSearchContentTypeIndexByIdData , GetSearchContentTypeIndexByIdResponse , GetIndicesData , GetIndicesResponse , PostSaveIndexData , PostSaveIndexResponse , DeleteSearchIndexData , DeleteSearchIndexResponse , GetSearchIndexByIdData , GetSearchIndexByIdResponse , GetSearchIndexData , GetSearchIndexResponse , PostBuildSearchIndexData , PostBuildSearchIndexResponse } from './types.gen' ;
5- import { client as _heyApiClient } from './client.gen' ;
3+ import type { Client , Options as Options2 , TDataShape } from '@hey-api/client-fetch' ;
64
7- export type Options < TData extends TDataShape = TDataShape , ThrowOnError extends boolean = boolean > = ClientOptions < TData , ThrowOnError > & {
5+ import { client } from './client.gen' ;
6+ import type { DeleteSearchIndexData , DeleteSearchIndexErrors , DeleteSearchIndexResponses , GetContentTypesData , GetContentTypesErrors , GetContentTypesResponses , GetIndicesData , GetIndicesErrors , GetIndicesResponses , GetSearchContentTypeIndexByIdData , GetSearchContentTypeIndexByIdErrors , GetSearchContentTypeIndexByIdResponses , GetSearchIndexByIdData , GetSearchIndexByIdErrors , GetSearchIndexByIdResponses , GetSearchIndexData , GetSearchIndexErrors , GetSearchIndexResponses , PostBuildSearchIndexData , PostBuildSearchIndexErrors , PostBuildSearchIndexResponses , PostSaveIndexData , PostSaveIndexErrors , PostSaveIndexResponses } from './types.gen' ;
7+
8+ export type Options < TData extends TDataShape = TDataShape , ThrowOnError extends boolean = boolean > = Options2 < TData , ThrowOnError > & {
89 /**
910 * You can provide a client instance returned by `createClient()` instead of
1011 * individual options. This might be also useful if you want to implement a
@@ -18,9 +19,9 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
1819 meta ?: Record < string , unknown > ;
1920} ;
2021
21- export class AlgoliaSearchService {
22+ export class AlgoliaSearch {
2223 public static getContentTypes < ThrowOnError extends boolean = true > ( options ?: Options < GetContentTypesData , ThrowOnError > ) {
23- return ( options ?. client ?? _heyApiClient ) . get < GetContentTypesResponse , unknown , ThrowOnError > ( {
24+ return ( options ?. client ?? client ) . get < GetContentTypesResponses , GetContentTypesErrors , ThrowOnError > ( {
2425 security : [
2526 {
2627 scheme : 'bearer' ,
@@ -33,7 +34,7 @@ export class AlgoliaSearchService {
3334 }
3435
3536 public static getSearchContentTypeIndexById < ThrowOnError extends boolean = true > ( options : Options < GetSearchContentTypeIndexByIdData , ThrowOnError > ) {
36- return ( options . client ?? _heyApiClient ) . get < GetSearchContentTypeIndexByIdResponse , unknown , ThrowOnError > ( {
37+ return ( options . client ?? client ) . get < GetSearchContentTypeIndexByIdResponses , GetSearchContentTypeIndexByIdErrors , ThrowOnError > ( {
3738 security : [
3839 {
3940 scheme : 'bearer' ,
@@ -46,7 +47,7 @@ export class AlgoliaSearchService {
4647 }
4748
4849 public static getIndices < ThrowOnError extends boolean = true > ( options ?: Options < GetIndicesData , ThrowOnError > ) {
49- return ( options ?. client ?? _heyApiClient ) . get < GetIndicesResponse , unknown , ThrowOnError > ( {
50+ return ( options ?. client ?? client ) . get < GetIndicesResponses , GetIndicesErrors , ThrowOnError > ( {
5051 security : [
5152 {
5253 scheme : 'bearer' ,
@@ -59,7 +60,7 @@ export class AlgoliaSearchService {
5960 }
6061
6162 public static postSaveIndex < ThrowOnError extends boolean = true > ( options ?: Options < PostSaveIndexData , ThrowOnError > ) {
62- return ( options ?. client ?? _heyApiClient ) . post < PostSaveIndexResponse , unknown , ThrowOnError > ( {
63+ return ( options ?. client ?? client ) . post < PostSaveIndexResponses , PostSaveIndexErrors , ThrowOnError > ( {
6364 security : [
6465 {
6566 scheme : 'bearer' ,
@@ -76,7 +77,7 @@ export class AlgoliaSearchService {
7677 }
7778
7879 public static deleteSearchIndex < ThrowOnError extends boolean = true > ( options : Options < DeleteSearchIndexData , ThrowOnError > ) {
79- return ( options . client ?? _heyApiClient ) . delete < DeleteSearchIndexResponse , unknown , ThrowOnError > ( {
80+ return ( options . client ?? client ) . delete < DeleteSearchIndexResponses , DeleteSearchIndexErrors , ThrowOnError > ( {
8081 security : [
8182 {
8283 scheme : 'bearer' ,
@@ -89,7 +90,7 @@ export class AlgoliaSearchService {
8990 }
9091
9192 public static getSearchIndexById < ThrowOnError extends boolean = true > ( options : Options < GetSearchIndexByIdData , ThrowOnError > ) {
92- return ( options . client ?? _heyApiClient ) . get < GetSearchIndexByIdResponse , unknown , ThrowOnError > ( {
93+ return ( options . client ?? client ) . get < GetSearchIndexByIdResponses , GetSearchIndexByIdErrors , ThrowOnError > ( {
9394 security : [
9495 {
9596 scheme : 'bearer' ,
@@ -102,7 +103,7 @@ export class AlgoliaSearchService {
102103 }
103104
104105 public static getSearchIndex < ThrowOnError extends boolean = true > ( options : Options < GetSearchIndexData , ThrowOnError > ) {
105- return ( options . client ?? _heyApiClient ) . get < GetSearchIndexResponse , unknown , ThrowOnError > ( {
106+ return ( options . client ?? client ) . get < GetSearchIndexResponses , GetSearchIndexErrors , ThrowOnError > ( {
106107 security : [
107108 {
108109 scheme : 'bearer' ,
@@ -115,7 +116,7 @@ export class AlgoliaSearchService {
115116 }
116117
117118 public static postBuildSearchIndex < ThrowOnError extends boolean = true > ( options ?: Options < PostBuildSearchIndexData , ThrowOnError > ) {
118- return ( options ?. client ?? _heyApiClient ) . post < PostBuildSearchIndexResponse , unknown , ThrowOnError > ( {
119+ return ( options ?. client ?? client ) . post < PostBuildSearchIndexResponses , PostBuildSearchIndexErrors , ThrowOnError > ( {
119120 security : [
120121 {
121122 scheme : 'bearer' ,
@@ -130,5 +131,4 @@ export class AlgoliaSearchService {
130131 }
131132 } ) ;
132133 }
133-
134- }
134+ }
0 commit comments