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(
42 reqwest::Method::POST,
43 "functions/profiles/pairs/list",
44 Some(params),
45 )
46 .await
47}
48
49pub async fn get_function_profile_pair_usage(
51 client: &HttpClient,
52 params: super::request::GetFunctionProfilePairUsageRequest,
53) -> Result<super::response::UsageFunctionProfilePairResponse, HttpError> {
54 client
55 .send_unary(
56 reqwest::Method::POST,
57 "functions/profiles/pairs/usage",
58 Some(params),
59 )
60 .await
61}