|
1 |
| -import { RelewiseClient, RelewiseClientOptions } from './relewise.client'; |
| 1 | +import { RelewiseClient, RelewiseClientOptions, RelewiseRequestOptions } from './relewise.client'; |
2 | 2 | import {
|
3 | 3 | ProductRecommendationResponse,
|
4 | 4 | ContentRecommendationResponse,
|
@@ -46,139 +46,139 @@ export class Recommender extends RelewiseClient {
|
46 | 46 | super(datasetId, apiKey, options);
|
47 | 47 | }
|
48 | 48 |
|
49 |
| - public async recommendPopularSearchTerms(request: PopularSearchTermsRecommendationRequest): Promise<SearchTermRecommendationResponse | undefined> { |
50 |
| - return this.request<PopularSearchTermsRecommendationRequest, SearchTermRecommendationResponse>('PopularSearchTermsRecommendationRequest', request); |
| 49 | + public async recommendPopularSearchTerms(request: PopularSearchTermsRecommendationRequest, options?: RelewiseRequestOptions): Promise<SearchTermRecommendationResponse | undefined> { |
| 50 | + return this.request<PopularSearchTermsRecommendationRequest, SearchTermRecommendationResponse>('PopularSearchTermsRecommendationRequest', request, options); |
51 | 51 | }
|
52 | 52 |
|
53 | 53 | //#region Brands
|
54 | 54 |
|
55 |
| - public async recommendPersonalBrands(request: PersonalBrandRecommendationRequest): Promise<BrandRecommendationResponse | undefined> { |
56 |
| - return this.request<PersonalBrandRecommendationRequest, BrandRecommendationResponse>('PersonalBrandRecommendationRequest', request); |
| 55 | + public async recommendPersonalBrands(request: PersonalBrandRecommendationRequest, options?: RelewiseRequestOptions): Promise<BrandRecommendationResponse | undefined> { |
| 56 | + return this.request<PersonalBrandRecommendationRequest, BrandRecommendationResponse>('PersonalBrandRecommendationRequest', request, options); |
57 | 57 | }
|
58 | 58 |
|
59 |
| - public async recommendPopularBrands(request: PopularBrandsRecommendationRequest): Promise<BrandRecommendationResponse | undefined> { |
60 |
| - return this.request<PopularBrandsRecommendationRequest, BrandRecommendationResponse>('PopularBrandsRecommendationRequest', request); |
| 59 | + public async recommendPopularBrands(request: PopularBrandsRecommendationRequest, options?: RelewiseRequestOptions): Promise<BrandRecommendationResponse | undefined> { |
| 60 | + return this.request<PopularBrandsRecommendationRequest, BrandRecommendationResponse>('PopularBrandsRecommendationRequest', request, options); |
61 | 61 | }
|
62 | 62 |
|
63 | 63 | //#endregion
|
64 | 64 |
|
65 | 65 | //#region Content Categories
|
66 |
| - public async recommendPersonalContentCategories(request: PersonalContentCategoryRecommendationRequest): Promise<ContentCategoryRecommendationResponse | undefined> { |
67 |
| - return this.request<PersonalContentCategoryRecommendationRequest, ContentCategoryRecommendationResponse>('PersonalContentCategoryRecommendationRequest', request); |
| 66 | + public async recommendPersonalContentCategories(request: PersonalContentCategoryRecommendationRequest, options?: RelewiseRequestOptions): Promise<ContentCategoryRecommendationResponse | undefined> { |
| 67 | + return this.request<PersonalContentCategoryRecommendationRequest, ContentCategoryRecommendationResponse>('PersonalContentCategoryRecommendationRequest', request, options); |
68 | 68 | }
|
69 | 69 |
|
70 |
| - public async recommendPopularContentCategories(request: PopularContentCategoriesRecommendationRequest): Promise<ContentCategoryRecommendationResponse | undefined> { |
71 |
| - return this.request<PopularContentCategoriesRecommendationRequest, ContentCategoryRecommendationResponse>('PopularContentCategoriesRecommendationRequest', request); |
| 70 | + public async recommendPopularContentCategories(request: PopularContentCategoriesRecommendationRequest, options?: RelewiseRequestOptions): Promise<ContentCategoryRecommendationResponse | undefined> { |
| 71 | + return this.request<PopularContentCategoriesRecommendationRequest, ContentCategoryRecommendationResponse>('PopularContentCategoriesRecommendationRequest', request, options); |
72 | 72 | }
|
73 | 73 |
|
74 | 74 | //#endregion
|
75 | 75 |
|
76 | 76 | //#region Product Categories
|
77 |
| - public async recommendPersonalProductCategories(request: PersonalProductCategoryRecommendationRequest): Promise<ProductCategoryRecommendationResponse | undefined> { |
78 |
| - return this.request<PersonalProductCategoryRecommendationRequest, ProductCategoryRecommendationResponse>('PersonalProductCategoryRecommendationRequest', request); |
| 77 | + public async recommendPersonalProductCategories(request: PersonalProductCategoryRecommendationRequest, options?: RelewiseRequestOptions): Promise<ProductCategoryRecommendationResponse | undefined> { |
| 78 | + return this.request<PersonalProductCategoryRecommendationRequest, ProductCategoryRecommendationResponse>('PersonalProductCategoryRecommendationRequest', request, options); |
79 | 79 | }
|
80 | 80 |
|
81 |
| - public async recommendPopularProductCategories(request: PopularProductCategoriesRecommendationRequest): Promise<ProductCategoryRecommendationResponse | undefined> { |
82 |
| - return this.request<PopularProductCategoriesRecommendationRequest, ProductCategoryRecommendationResponse>('PopularProductCategoriesRecommendationRequest', request); |
| 81 | + public async recommendPopularProductCategories(request: PopularProductCategoriesRecommendationRequest, options?: RelewiseRequestOptions): Promise<ProductCategoryRecommendationResponse | undefined> { |
| 82 | + return this.request<PopularProductCategoriesRecommendationRequest, ProductCategoryRecommendationResponse>('PopularProductCategoriesRecommendationRequest', request, options); |
83 | 83 | }
|
84 | 84 |
|
85 | 85 | //#endregion
|
86 | 86 |
|
87 | 87 | //#region Products
|
88 | 88 |
|
89 |
| - public async recommendPurchasedWithProduct(request: PurchasedWithProductRequest): Promise<ProductRecommendationResponse | undefined> { |
90 |
| - return this.request<PurchasedWithProductRequest, ProductRecommendationResponse>('PurchasedWithProductRequest', request); |
| 89 | + public async recommendPurchasedWithProduct(request: PurchasedWithProductRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 90 | + return this.request<PurchasedWithProductRequest, ProductRecommendationResponse>('PurchasedWithProductRequest', request, options); |
91 | 91 | }
|
92 | 92 |
|
93 |
| - public async recommendPurchasedWithMultipleProducts(request: PurchasedWithMultipleProductsRequest): Promise<ProductRecommendationResponse | undefined> { |
94 |
| - return this.request<PurchasedWithMultipleProductsRequest, ProductRecommendationResponse>('PurchasedWithMultipleProductsRequest', request); |
| 93 | + public async recommendPurchasedWithMultipleProducts(request: PurchasedWithMultipleProductsRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 94 | + return this.request<PurchasedWithMultipleProductsRequest, ProductRecommendationResponse>('PurchasedWithMultipleProductsRequest', request, options); |
95 | 95 | }
|
96 | 96 |
|
97 |
| - public async sortVariants(request: SortVariantsRequest): Promise<ProductRecommendationResponse | undefined> { |
98 |
| - return this.request<SortVariantsRequest, ProductRecommendationResponse>('SortVariantsRequest', request); |
| 97 | + public async sortVariants(request: SortVariantsRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 98 | + return this.request<SortVariantsRequest, ProductRecommendationResponse>('SortVariantsRequest', request, options); |
99 | 99 | }
|
100 | 100 |
|
101 |
| - public async sortProducts(request: SortProductsRequest): Promise<ProductRecommendationResponse | undefined> { |
102 |
| - return this.request<SortProductsRequest, ProductRecommendationResponse>('SortProductsRequest', request); |
| 101 | + public async sortProducts(request: SortProductsRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 102 | + return this.request<SortProductsRequest, ProductRecommendationResponse>('SortProductsRequest', request, options); |
103 | 103 | }
|
104 | 104 |
|
105 |
| - public async recommendSimilarProducts(request: SimilarProductsRequest): Promise<ProductRecommendationResponse | undefined> { |
106 |
| - return this.request<SimilarProductsRequest, ProductRecommendationResponse>('SimilarProductsRequest', request); |
| 105 | + public async recommendSimilarProducts(request: SimilarProductsRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 106 | + return this.request<SimilarProductsRequest, ProductRecommendationResponse>('SimilarProductsRequest', request, options); |
107 | 107 | }
|
108 | 108 |
|
109 |
| - public async recommendSearchTermBasedProducts(request: SearchTermBasedProductRecommendationRequest): Promise<ProductRecommendationResponse | undefined> { |
110 |
| - return this.request<SearchTermBasedProductRecommendationRequest, ProductRecommendationResponse>('SearchTermBasedProductRecommendationRequest', request); |
| 109 | + public async recommendSearchTermBasedProducts(request: SearchTermBasedProductRecommendationRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 110 | + return this.request<SearchTermBasedProductRecommendationRequest, ProductRecommendationResponse>('SearchTermBasedProductRecommendationRequest', request, options); |
111 | 111 | }
|
112 | 112 |
|
113 |
| - public async recentlyViewedProducts(request: RecentlyViewedProductsRequest): Promise<ProductRecommendationResponse | undefined> { |
114 |
| - return this.request<RecentlyViewedProductsRequest, ProductRecommendationResponse>('RecentlyViewedProductsRequest', request); |
| 113 | + public async recentlyViewedProducts(request: RecentlyViewedProductsRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 114 | + return this.request<RecentlyViewedProductsRequest, ProductRecommendationResponse>('RecentlyViewedProductsRequest', request, options); |
115 | 115 | }
|
116 | 116 |
|
117 |
| - public async recommendPurchasedWithCurrentCart(request: PurchasedWithCurrentCartRequest): Promise<ProductRecommendationResponse | undefined> { |
118 |
| - return this.request<PurchasedWithCurrentCartRequest, ProductRecommendationResponse>('PurchasedWithCurrentCartRequest', request); |
| 117 | + public async recommendPurchasedWithCurrentCart(request: PurchasedWithCurrentCartRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 118 | + return this.request<PurchasedWithCurrentCartRequest, ProductRecommendationResponse>('PurchasedWithCurrentCartRequest', request, options); |
119 | 119 | }
|
120 | 120 |
|
121 |
| - public async recommendProductsViewedAfterViewingProduct(request: ProductsViewedAfterViewingProductRequest): Promise<ProductRecommendationResponse | undefined> { |
122 |
| - return this.request<ProductsViewedAfterViewingProductRequest, ProductRecommendationResponse>('ProductsViewedAfterViewingProductRequest', request); |
| 121 | + public async recommendProductsViewedAfterViewingProduct(request: ProductsViewedAfterViewingProductRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 122 | + return this.request<ProductsViewedAfterViewingProductRequest, ProductRecommendationResponse>('ProductsViewedAfterViewingProductRequest', request, options); |
123 | 123 | }
|
124 | 124 |
|
125 |
| - public async recommendProductsViewedAfterViewingContent(request: ProductsViewedAfterViewingContentRequest): Promise<ProductRecommendationResponse | undefined> { |
126 |
| - return this.request<ProductsViewedAfterViewingContentRequest, ProductRecommendationResponse>('ProductsViewedAfterViewingContentRequest', request); |
| 125 | + public async recommendProductsViewedAfterViewingContent(request: ProductsViewedAfterViewingContentRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 126 | + return this.request<ProductsViewedAfterViewingContentRequest, ProductRecommendationResponse>('ProductsViewedAfterViewingContentRequest', request, options); |
127 | 127 | }
|
128 | 128 |
|
129 |
| - public async recommendPopularProducts(request: PopularProductsRequest): Promise<ProductRecommendationResponse | undefined> { |
130 |
| - return this.request<PopularProductsRequest, ProductRecommendationResponse>('PopularProductsRequest', request); |
| 129 | + public async recommendPopularProducts(request: PopularProductsRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 130 | + return this.request<PopularProductsRequest, ProductRecommendationResponse>('PopularProductsRequest', request, options); |
131 | 131 | }
|
132 | 132 |
|
133 |
| - public async recommendPersonalProducts(request: PersonalProductRecommendationRequest): Promise<ProductRecommendationResponse | undefined> { |
134 |
| - return this.request<PersonalProductRecommendationRequest, ProductRecommendationResponse>('PersonalProductRecommendationRequest', request); |
| 133 | + public async recommendPersonalProducts(request: PersonalProductRecommendationRequest, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponse | undefined> { |
| 134 | + return this.request<PersonalProductRecommendationRequest, ProductRecommendationResponse>('PersonalProductRecommendationRequest', request, options); |
135 | 135 | }
|
136 | 136 |
|
137 | 137 | //#endregion
|
138 | 138 |
|
139 | 139 | //#region Content
|
140 | 140 |
|
141 |
| - public async recommendPopularContents(request: PopularContentsRequest): Promise<ContentRecommendationResponse | undefined> { |
142 |
| - return this.request<PopularContentsRequest, ContentRecommendationResponse>('PopularContentsRequest', request); |
| 141 | + public async recommendPopularContents(request: PopularContentsRequest, options?: RelewiseRequestOptions): Promise<ContentRecommendationResponse | undefined> { |
| 142 | + return this.request<PopularContentsRequest, ContentRecommendationResponse>('PopularContentsRequest', request, options); |
143 | 143 | }
|
144 | 144 |
|
145 |
| - public async recommendPersonalContents(request: PersonalContentRecommendationRequest): Promise<ContentRecommendationResponse | undefined> { |
146 |
| - return this.request<PersonalContentRecommendationRequest, ContentRecommendationResponse>('PopularContentsRequest', request); |
| 145 | + public async recommendPersonalContents(request: PersonalContentRecommendationRequest, options?: RelewiseRequestOptions): Promise<ContentRecommendationResponse | undefined> { |
| 146 | + return this.request<PersonalContentRecommendationRequest, ContentRecommendationResponse>('PopularContentsRequest', request, options); |
147 | 147 | }
|
148 | 148 |
|
149 |
| - public async recommendContentsViewedAfterViewingProduct(request: ContentsViewedAfterViewingProductRequest): Promise<ContentRecommendationResponse | undefined> { |
150 |
| - return this.request<ContentsViewedAfterViewingProductRequest, ContentRecommendationResponse>('ContentsViewedAfterViewingProductRequest', request); |
| 149 | + public async recommendContentsViewedAfterViewingProduct(request: ContentsViewedAfterViewingProductRequest, options?: RelewiseRequestOptions): Promise<ContentRecommendationResponse | undefined> { |
| 150 | + return this.request<ContentsViewedAfterViewingProductRequest, ContentRecommendationResponse>('ContentsViewedAfterViewingProductRequest', request, options); |
151 | 151 | }
|
152 | 152 |
|
153 |
| - public async recommendContentsViewedAfterViewingMultipleProducts(request: ContentsViewedAfterViewingMultipleProductsRequest): Promise<ContentRecommendationResponse | undefined> { |
154 |
| - return this.request<ContentsViewedAfterViewingMultipleProductsRequest, ContentRecommendationResponse>('ContentsViewedAfterViewingProductRequest', request); |
| 153 | + public async recommendContentsViewedAfterViewingMultipleProducts(request: ContentsViewedAfterViewingMultipleProductsRequest, options?: RelewiseRequestOptions): Promise<ContentRecommendationResponse | undefined> { |
| 154 | + return this.request<ContentsViewedAfterViewingMultipleProductsRequest, ContentRecommendationResponse>('ContentsViewedAfterViewingProductRequest', request, options); |
155 | 155 | }
|
156 | 156 |
|
157 |
| - public async recommendContentsViewedAfterViewingMultipleContents(request: ContentsViewedAfterViewingMultipleContentsRequest): Promise<ContentRecommendationResponse | undefined> { |
158 |
| - return this.request<ContentsViewedAfterViewingMultipleContentsRequest, ContentRecommendationResponse>('ContentsViewedAfterViewingMultipleContentsRequest', request); |
| 157 | + public async recommendContentsViewedAfterViewingMultipleContents(request: ContentsViewedAfterViewingMultipleContentsRequest, options?: RelewiseRequestOptions): Promise<ContentRecommendationResponse | undefined> { |
| 158 | + return this.request<ContentsViewedAfterViewingMultipleContentsRequest, ContentRecommendationResponse>('ContentsViewedAfterViewingMultipleContentsRequest', request, options); |
159 | 159 | }
|
160 | 160 |
|
161 |
| - public async recommendContentsViewedAfterViewingContent(request: ContentsViewedAfterViewingContentRequest): Promise<ContentRecommendationResponse | undefined> { |
162 |
| - return this.request<ContentsViewedAfterViewingContentRequest, ContentRecommendationResponse>('ContentsViewedAfterViewingContentRequest', request); |
| 161 | + public async recommendContentsViewedAfterViewingContent(request: ContentsViewedAfterViewingContentRequest, options?: RelewiseRequestOptions): Promise<ContentRecommendationResponse | undefined> { |
| 162 | + return this.request<ContentsViewedAfterViewingContentRequest, ContentRecommendationResponse>('ContentsViewedAfterViewingContentRequest', request, options); |
163 | 163 | }
|
164 | 164 |
|
165 | 165 | //#endregion
|
166 | 166 |
|
167 | 167 | //#region Batching
|
168 |
| - public async batchProductRecommendations(request: ProductRecommendationRequestCollection): Promise<ProductRecommendationResponseCollection | undefined> { |
169 |
| - return this.request<ProductRecommendationRequestCollection, ProductRecommendationResponseCollection>('ProductRecommendationRequestCollection', request); |
| 168 | + public async batchProductRecommendations(request: ProductRecommendationRequestCollection, options?: RelewiseRequestOptions): Promise<ProductRecommendationResponseCollection | undefined> { |
| 169 | + return this.request<ProductRecommendationRequestCollection, ProductRecommendationResponseCollection>('ProductRecommendationRequestCollection', request, options); |
170 | 170 | }
|
171 | 171 |
|
172 |
| - public async batchContentRecommendations(request: ContentRecommendationRequestCollection): Promise<ContentRecommendationResponseCollection | undefined> { |
173 |
| - return this.request<ContentRecommendationRequestCollection, ContentRecommendationResponseCollection>('ContentRecommendationRequestCollection', request); |
| 172 | + public async batchContentRecommendations(request: ContentRecommendationRequestCollection, options?: RelewiseRequestOptions): Promise<ContentRecommendationResponseCollection | undefined> { |
| 173 | + return this.request<ContentRecommendationRequestCollection, ContentRecommendationResponseCollection>('ContentRecommendationRequestCollection', request, options); |
174 | 174 | }
|
175 | 175 |
|
176 |
| - public async batchContentCategoryRecommendations(request: ContentCategoryRecommendationRequestCollection): Promise<ContentCategoryRecommendationResponseCollection | undefined> { |
177 |
| - return this.request<ContentCategoryRecommendationRequestCollection, ContentCategoryRecommendationResponseCollection>('ContentCategoryRecommendationRequestCollection', request); |
| 176 | + public async batchContentCategoryRecommendations(request: ContentCategoryRecommendationRequestCollection, options?: RelewiseRequestOptions): Promise<ContentCategoryRecommendationResponseCollection | undefined> { |
| 177 | + return this.request<ContentCategoryRecommendationRequestCollection, ContentCategoryRecommendationResponseCollection>('ContentCategoryRecommendationRequestCollection', request, options); |
178 | 178 | }
|
179 | 179 |
|
180 |
| - public async batchProductCategoryRecommendations(request: ProductCategoryRecommendationRequestCollection): Promise<ProductCategoryRecommendationResponseCollection | undefined> { |
181 |
| - return this.request<ProductCategoryRecommendationRequestCollection, ProductCategoryRecommendationResponseCollection>('ProductCategoryRecommendationRequestCollection', request); |
| 180 | + public async batchProductCategoryRecommendations(request: ProductCategoryRecommendationRequestCollection, options?: RelewiseRequestOptions): Promise<ProductCategoryRecommendationResponseCollection | undefined> { |
| 181 | + return this.request<ProductCategoryRecommendationRequestCollection, ProductCategoryRecommendationResponseCollection>('ProductCategoryRecommendationRequestCollection', request, options); |
182 | 182 | }
|
183 | 183 |
|
184 | 184 | //#endregion
|
|
0 commit comments