/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { featuresGetHistoricalValues } from "../funcs/featuresGetHistoricalValues.js"; import { featuresGetTransformedValues } from "../funcs/featuresGetTransformedValues.js"; import { featuresGetTree } from "../funcs/featuresGetTree.js"; import { featuresGetWeightedIndex } from "../funcs/featuresGetWeightedIndex.js"; import { featuresList } from "../funcs/featuresList.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Features extends ClientSDK { /** * Provide the tree structure of the features faceting panel * * @remarks * Provide the organization of a search tree over the features organization */ async getTree( options?: RequestOptions, ): Promise { return unwrapAsync(featuresGetTree( this, options, )); } /** * List available features * * @remarks * Returns the list of all available features that Hedgewise * tracks or produces. Some of these are used to produce our price and * commodity production forecasts. The returned features can be filtered by futures contract symbol they can relate or by the dataset they belong to. */ async list( request: operations.GetAvailableFeaturesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(featuresList( this, request, options, )); } /** * Get historical values for a feature * * @remarks * Returns historical values for a given feature code. The * feature code is a unique identifier for a specific feature, such as * weather or crop health data. Feature codes can be obtained with the * `/v1/features` endpoint. */ async getHistoricalValues( request: operations.GetFeaturesHistoricalValuesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(featuresGetHistoricalValues( this, request, options, )); } /** * Get the historical values for a feature transformed via the specified transformation * * @remarks * Provides a facility to apply transformation like computing the average of 5 years or * transpose the features time-series to create a year-on-year representation of the time-series * of the features Feature codes can be obtained with the `/v1/features` endpoint. */ async getTransformedValues( request: operations.GetTransformedFeatureValuesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(featuresGetTransformedValues( this, request, options, )); } /** * Returns the values of a user-definable index by creating a linear combination of features * * @remarks * Provides a facility to create an index formed as a weighted basket of the list of features provided. * The features provided must exist and listed as available at the `/v1/features` endpoint. */ async getWeightedIndex( request: operations.GetWeightedIndexRequest, options?: RequestOptions, ): Promise { return unwrapAsync(featuresGetWeightedIndex( this, request, options, )); } }