UNPKG

@space-cow-media/spellbook-client

Version:

An Open Api generated client for the Commander Spellbook backend REST API.

192 lines (141 loc) 6.28 kB
# FindMyCombosApi All URIs are relative to *http://localhost* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**findMyCombosCreate**](FindMyCombosApi.md#findmycomboscreate) | **POST** /find-my-combos | | | [**findMyCombosList**](FindMyCombosApi.md#findmycomboslist) | **GET** /find-my-combos | | ## findMyCombosCreate > PaginatedFindMyCombosResponseList findMyCombosCreate(groupByCombo, limit, offset, ordering, q, variant, deckRequest) ### Example ```ts import { Configuration, FindMyCombosApi, } from ''; import type { FindMyCombosCreateRequest } from ''; async function example() { console.log("🚀 Testing SDK..."); const config = new Configuration({ // To configure HTTP basic authorization: basicAuth username: "YOUR USERNAME", password: "YOUR PASSWORD", // To configure API key authorization: cookieAuth apiKey: "YOUR API KEY", // Configure HTTP bearer authorization: jwtAuth accessToken: "YOUR BEARER TOKEN", }); const api = new FindMyCombosApi(config); const body = { // boolean | Group variants by combo (optional) groupByCombo: true, // number | Number of results to return per page. (optional) limit: 56, // number | The initial index from which to return the results. (optional) offset: 56, // string | Which field to use when ordering the results. (optional) ordering: ordering_example, // string | A search query. (optional) q: q_example, // string | Filters for variants of the same combos that generated the given variant id. (optional) variant: variant_example, // DeckRequest (optional) deckRequest: ..., } satisfies FindMyCombosCreateRequest; try { const data = await api.findMyCombosCreate(body); console.log(data); } catch (error) { console.error(error); } } // Run the test example().catch(console.error); ``` ### Parameters | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **groupByCombo** | `boolean` | Group variants by combo | [Optional] [Defaults to `undefined`] | | **limit** | `number` | Number of results to return per page. | [Optional] [Defaults to `undefined`] | | **offset** | `number` | The initial index from which to return the results. | [Optional] [Defaults to `undefined`] | | **ordering** | `string` | Which field to use when ordering the results. | [Optional] [Defaults to `undefined`] | | **q** | `string` | A search query. | [Optional] [Defaults to `undefined`] | | **variant** | `string` | Filters for variants of the same combos that generated the given variant id. | [Optional] [Defaults to `undefined`] | | **deckRequest** | [DeckRequest](DeckRequest.md) | | [Optional] | ### Return type [**PaginatedFindMyCombosResponseList**](PaginatedFindMyCombosResponseList.md) ### Authorization [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [jwtAuth](../README.md#jwtAuth) ### HTTP request headers - **Content-Type**: `application/json`, `text/plain` - **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | | - | [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) ## findMyCombosList > PaginatedFindMyCombosResponseList findMyCombosList(groupByCombo, limit, offset, ordering, q, variant) ### Example ```ts import { Configuration, FindMyCombosApi, } from ''; import type { FindMyCombosListRequest } from ''; async function example() { console.log("🚀 Testing SDK..."); const config = new Configuration({ // To configure HTTP basic authorization: basicAuth username: "YOUR USERNAME", password: "YOUR PASSWORD", // To configure API key authorization: cookieAuth apiKey: "YOUR API KEY", // Configure HTTP bearer authorization: jwtAuth accessToken: "YOUR BEARER TOKEN", }); const api = new FindMyCombosApi(config); const body = { // boolean | Group variants by combo (optional) groupByCombo: true, // number | Number of results to return per page. (optional) limit: 56, // number | The initial index from which to return the results. (optional) offset: 56, // string | Which field to use when ordering the results. (optional) ordering: ordering_example, // string | A search query. (optional) q: q_example, // string | Filters for variants of the same combos that generated the given variant id. (optional) variant: variant_example, } satisfies FindMyCombosListRequest; try { const data = await api.findMyCombosList(body); console.log(data); } catch (error) { console.error(error); } } // Run the test example().catch(console.error); ``` ### Parameters | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **groupByCombo** | `boolean` | Group variants by combo | [Optional] [Defaults to `undefined`] | | **limit** | `number` | Number of results to return per page. | [Optional] [Defaults to `undefined`] | | **offset** | `number` | The initial index from which to return the results. | [Optional] [Defaults to `undefined`] | | **ordering** | `string` | Which field to use when ordering the results. | [Optional] [Defaults to `undefined`] | | **q** | `string` | A search query. | [Optional] [Defaults to `undefined`] | | **variant** | `string` | Filters for variants of the same combos that generated the given variant id. | [Optional] [Defaults to `undefined`] | ### Return type [**PaginatedFindMyCombosResponseList**](PaginatedFindMyCombosResponseList.md) ### Authorization [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [jwtAuth](../README.md#jwtAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | | - | [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)