objectiveai_sdk/functions/
http.rs1use crate::{HttpClient, HttpError};
4
5pub async fn list_functions(
7 client: &HttpClient,
8 params: super::request::ListFunctionsRequest,
9) -> Result<super::response::ListFunctionResponse, HttpError> {
10 client
11 .send_unary(reqwest::Method::POST, "functions/list", Some(params))
12 .await
13}
14
15pub async fn get_function(
17 client: &HttpClient,
18 params: super::request::GetFunctionRequest,
19) -> Result<super::response::GetFunctionResponse, HttpError> {
20 client
21 .send_unary(reqwest::Method::POST, "functions", Some(params))
22 .await
23}
24
25pub async fn get_function_usage(
27 client: &HttpClient,
28 params: super::request::GetFunctionRequest,
29) -> Result<super::response::UsageFunctionResponse, HttpError> {
30 client
31 .send_unary(reqwest::Method::POST, "functions/usage", Some(params))
32 .await
33}
34
35pub async fn list_function_profile_pairs(
37 client: &HttpClient,
38 params: super::request::ListFunctionProfilePairsRequest,
39) -> Result<super::response::ListFunctionProfilePairResponse, HttpError> {
40 client
41 .send_unary(reqwest::Method::POST, "functions/profiles/pairs/list", Some(params))
42 .await
43}
44
45pub async fn get_function_profile_pair_usage(
47 client: &HttpClient,
48 params: super::request::GetFunctionProfilePairUsageRequest,
49) -> Result<super::response::UsageFunctionProfilePairResponse, HttpError> {
50 client
51 .send_unary(reqwest::Method::POST, "functions/profiles/pairs/usage", Some(params))
52 .await
53}