#![cfg(feature = "cloudflare_ai")]
#![allow(clippy::too_many_arguments, clippy::type_complexity)]
#![allow(clippy::missing_errors_doc, clippy::doc_markdown, clippy::useless_format)]
#![allow(unused_imports)]
use foundation_netio::{DynNetClient, PreparedRequestBuilder};
use foundation_netio::shared::client::http_client::HttpClient;
use serde::{Deserialize, Serialize};
use foundation_macros::JsonHash;
use super::shared::ApiResponse;
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequest {
pub ai_gateway_id: Option<String>,
pub ai_search_model: Option<String>,
pub cache: Option<bool>,
pub cache_threshold: Option<String>,
pub chunk: Option<bool>,
pub chunk_overlap: Option<i64>,
pub chunk_size: Option<i64>,
pub custom_metadata: Option<Vec<AiSearchCreateInstancesRequestCustomMetadataItem>>,
pub embedding_model: Option<String>,
pub fusion_method: Option<String>,
pub id: String,
pub index_method: Option<AiSearchCreateInstancesRequestIndexMethod>,
pub indexing_options: Option<AiSearchCreateInstancesRequestIndexingOptions>,
pub max_num_results: Option<i64>,
pub metadata: Option<AiSearchCreateInstancesRequestMetadata>,
pub namespace: Option<String>,
pub public_endpoint_params: Option<AiSearchCreateInstancesRequestPublicEndpointParams>,
pub reranking: Option<bool>,
pub reranking_model: Option<String>,
pub retrieval_options: Option<AiSearchCreateInstancesRequestRetrievalOptions>,
pub rewrite_model: Option<String>,
pub rewrite_query: Option<bool>,
pub score_threshold: Option<f64>,
pub source: Option<String>,
pub source_params: Option<AiSearchCreateInstancesRequestSourceParams>,
pub token_id: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestCustomMetadataItem {
pub data_type: String,
pub field_name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestIndexMethod {
pub keyword: bool,
pub vector: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestIndexingOptions {
pub keyword_tokenizer: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestMetadata {
pub created_from_aisearch_wizard: Option<bool>,
pub worker_domain: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestPublicEndpointParams {
pub authorized_hosts: Option<Vec<String>>,
pub chat_completions_endpoint: Option<AiSearchCreateInstancesRequestPublicEndpointParamsChatCompletionsEndpoint>,
pub enabled: Option<bool>,
pub mcp: Option<AiSearchCreateInstancesRequestPublicEndpointParamsMcp>,
pub rate_limit: Option<AiSearchCreateInstancesRequestPublicEndpointParamsRateLimit>,
pub search_endpoint: Option<AiSearchCreateInstancesRequestPublicEndpointParamsSearchEndpoint>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestPublicEndpointParamsChatCompletionsEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestPublicEndpointParamsMcp {
pub description: Option<String>,
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestPublicEndpointParamsRateLimit {
pub period_ms: Option<i64>,
pub requests: Option<i64>,
pub technique: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestPublicEndpointParamsSearchEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestRetrievalOptions {
pub boost_by: Option<Vec<AiSearchCreateInstancesRequestRetrievalOptionsBoostByItem>>,
pub keyword_match_mode: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestRetrievalOptionsBoostByItem {
pub direction: Option<String>,
pub field: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestSourceParams {
pub exclude_items: Option<Vec<String>>,
pub include_items: Option<Vec<String>>,
pub prefix: Option<String>,
pub r2_jurisdiction: Option<String>,
pub web_crawler: Option<AiSearchCreateInstancesRequestSourceParamsWebCrawler>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestSourceParamsWebCrawler {
pub crawl_options: Option<AiSearchCreateInstancesRequestSourceParamsWebCrawlerCrawlOptions>,
pub parse_options: Option<AiSearchCreateInstancesRequestSourceParamsWebCrawlerParseOptions>,
pub parse_type: Option<String>,
pub store_options: Option<AiSearchCreateInstancesRequestSourceParamsWebCrawlerStoreOptions>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestSourceParamsWebCrawlerCrawlOptions {
pub depth: Option<f64>,
pub include_external_links: Option<bool>,
pub include_subdomains: Option<bool>,
pub max_age: Option<f64>,
pub source: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestSourceParamsWebCrawlerParseOptions {
pub content_selector: Option<Vec<AiSearchCreateInstancesRequestSourceParamsWebCrawlerParseOptionsContentSelectorItem>>,
pub include_headers: Option<serde_json::Value>,
pub include_images: Option<bool>,
pub specific_sitemaps: Option<Vec<String>>,
pub use_browser_rendering: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestSourceParamsWebCrawlerParseOptionsContentSelectorItem {
pub path: String,
pub selector: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesRequestSourceParamsWebCrawlerStoreOptions {
pub r2_jurisdiction: Option<String>,
pub storage_id: String,
pub storage_type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponse {
pub result: AiSearchCreateInstancesResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResult {
pub ai_gateway_id: Option<String>,
pub ai_search_model: Option<String>,
pub cache: Option<bool>,
pub cache_threshold: Option<String>,
pub chunk_overlap: Option<i64>,
pub chunk_size: Option<i64>,
pub created_at: String,
pub created_by: Option<String>,
pub custom_metadata: Option<Vec<AiSearchCreateInstancesResponseResultCustomMetadataItem>>,
pub embedding_model: Option<String>,
pub enable: Option<bool>,
pub engine_version: Option<f64>,
pub fusion_method: Option<String>,
pub hybrid_search_enabled: Option<bool>,
pub id: String,
pub index_method: Option<AiSearchCreateInstancesResponseResultIndexMethod>,
pub indexing_options: Option<AiSearchCreateInstancesResponseResultIndexingOptions>,
pub last_activity: Option<String>,
pub max_num_results: Option<i64>,
pub metadata: Option<AiSearchCreateInstancesResponseResultMetadata>,
pub modified_at: String,
pub modified_by: Option<String>,
pub namespace: Option<String>,
pub paused: Option<bool>,
pub public_endpoint_id: Option<String>,
pub public_endpoint_params: Option<AiSearchCreateInstancesResponseResultPublicEndpointParams>,
pub reranking: Option<bool>,
pub reranking_model: Option<String>,
pub retrieval_options: Option<AiSearchCreateInstancesResponseResultRetrievalOptions>,
pub rewrite_model: Option<String>,
pub rewrite_query: Option<bool>,
pub score_threshold: Option<f64>,
pub source: Option<String>,
pub source_params: Option<AiSearchCreateInstancesResponseResultSourceParams>,
pub status: Option<String>,
pub token_id: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultCustomMetadataItem {
pub data_type: String,
pub field_name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultIndexMethod {
pub keyword: bool,
pub vector: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultIndexingOptions {
pub keyword_tokenizer: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultMetadata {
pub created_from_aisearch_wizard: Option<bool>,
pub worker_domain: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultPublicEndpointParams {
pub authorized_hosts: Option<Vec<String>>,
pub chat_completions_endpoint: Option<AiSearchCreateInstancesResponseResultPublicEndpointParamsChatCompletionsEndpoint>,
pub enabled: Option<bool>,
pub mcp: Option<AiSearchCreateInstancesResponseResultPublicEndpointParamsMcp>,
pub rate_limit: Option<AiSearchCreateInstancesResponseResultPublicEndpointParamsRateLimit>,
pub search_endpoint: Option<AiSearchCreateInstancesResponseResultPublicEndpointParamsSearchEndpoint>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultPublicEndpointParamsChatCompletionsEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultPublicEndpointParamsMcp {
pub description: Option<String>,
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultPublicEndpointParamsRateLimit {
pub period_ms: Option<i64>,
pub requests: Option<i64>,
pub technique: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultPublicEndpointParamsSearchEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultRetrievalOptions {
pub boost_by: Option<Vec<AiSearchCreateInstancesResponseResultRetrievalOptionsBoostByItem>>,
pub keyword_match_mode: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultRetrievalOptionsBoostByItem {
pub direction: Option<String>,
pub field: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultSourceParams {
pub exclude_items: Option<Vec<String>>,
pub include_items: Option<Vec<String>>,
pub prefix: Option<String>,
pub r2_jurisdiction: Option<String>,
pub web_crawler: Option<AiSearchCreateInstancesResponseResultSourceParamsWebCrawler>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultSourceParamsWebCrawler {
pub crawl_options: Option<AiSearchCreateInstancesResponseResultSourceParamsWebCrawlerCrawlOptions>,
pub parse_options: Option<AiSearchCreateInstancesResponseResultSourceParamsWebCrawlerParseOptions>,
pub parse_type: Option<String>,
pub store_options: Option<AiSearchCreateInstancesResponseResultSourceParamsWebCrawlerStoreOptions>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultSourceParamsWebCrawlerCrawlOptions {
pub depth: Option<f64>,
pub include_external_links: Option<bool>,
pub include_subdomains: Option<bool>,
pub max_age: Option<f64>,
pub source: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultSourceParamsWebCrawlerParseOptions {
pub content_selector: Option<Vec<AiSearchCreateInstancesResponseResultSourceParamsWebCrawlerParseOptionsContentSelectorItem>>,
pub include_headers: Option<serde_json::Value>,
pub include_images: Option<bool>,
pub specific_sitemaps: Option<Vec<String>>,
pub use_browser_rendering: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultSourceParamsWebCrawlerParseOptionsContentSelectorItem {
pub path: String,
pub selector: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateInstancesResponseResultSourceParamsWebCrawlerStoreOptions {
pub r2_jurisdiction: Option<String>,
pub storage_id: String,
pub storage_type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateTokensRequest {
pub cf_api_id: String,
pub cf_api_key: String,
pub legacy: Option<bool>,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateTokensResponse {
pub result: AiSearchCreateTokensResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchCreateTokensResponseResult {
pub cf_api_id: String,
pub created_at: String,
pub created_by: Option<String>,
pub enabled: Option<bool>,
pub id: String,
pub legacy: Option<bool>,
pub modified_at: String,
pub modified_by: Option<String>,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponse {
pub result: AiSearchDeleteInstancesResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResult {
pub ai_gateway_id: Option<String>,
pub ai_search_model: Option<String>,
pub cache: Option<bool>,
pub cache_threshold: Option<String>,
pub chunk_overlap: Option<i64>,
pub chunk_size: Option<i64>,
pub created_at: String,
pub created_by: Option<String>,
pub custom_metadata: Option<Vec<AiSearchDeleteInstancesResponseResultCustomMetadataItem>>,
pub embedding_model: Option<String>,
pub enable: Option<bool>,
pub engine_version: Option<f64>,
pub fusion_method: Option<String>,
pub hybrid_search_enabled: Option<bool>,
pub id: String,
pub index_method: Option<AiSearchDeleteInstancesResponseResultIndexMethod>,
pub indexing_options: Option<AiSearchDeleteInstancesResponseResultIndexingOptions>,
pub last_activity: Option<String>,
pub max_num_results: Option<i64>,
pub metadata: Option<AiSearchDeleteInstancesResponseResultMetadata>,
pub modified_at: String,
pub modified_by: Option<String>,
pub namespace: Option<String>,
pub paused: Option<bool>,
pub public_endpoint_id: Option<String>,
pub public_endpoint_params: Option<AiSearchDeleteInstancesResponseResultPublicEndpointParams>,
pub reranking: Option<bool>,
pub reranking_model: Option<String>,
pub retrieval_options: Option<AiSearchDeleteInstancesResponseResultRetrievalOptions>,
pub rewrite_model: Option<String>,
pub rewrite_query: Option<bool>,
pub score_threshold: Option<f64>,
pub source: Option<String>,
pub source_params: Option<AiSearchDeleteInstancesResponseResultSourceParams>,
pub status: Option<String>,
pub token_id: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultCustomMetadataItem {
pub data_type: String,
pub field_name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultIndexMethod {
pub keyword: bool,
pub vector: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultIndexingOptions {
pub keyword_tokenizer: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultMetadata {
pub created_from_aisearch_wizard: Option<bool>,
pub worker_domain: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultPublicEndpointParams {
pub authorized_hosts: Option<Vec<String>>,
pub chat_completions_endpoint: Option<AiSearchDeleteInstancesResponseResultPublicEndpointParamsChatCompletionsEndpoint>,
pub enabled: Option<bool>,
pub mcp: Option<AiSearchDeleteInstancesResponseResultPublicEndpointParamsMcp>,
pub rate_limit: Option<AiSearchDeleteInstancesResponseResultPublicEndpointParamsRateLimit>,
pub search_endpoint: Option<AiSearchDeleteInstancesResponseResultPublicEndpointParamsSearchEndpoint>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultPublicEndpointParamsChatCompletionsEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultPublicEndpointParamsMcp {
pub description: Option<String>,
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultPublicEndpointParamsRateLimit {
pub period_ms: Option<i64>,
pub requests: Option<i64>,
pub technique: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultPublicEndpointParamsSearchEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultRetrievalOptions {
pub boost_by: Option<Vec<AiSearchDeleteInstancesResponseResultRetrievalOptionsBoostByItem>>,
pub keyword_match_mode: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultRetrievalOptionsBoostByItem {
pub direction: Option<String>,
pub field: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultSourceParams {
pub exclude_items: Option<Vec<String>>,
pub include_items: Option<Vec<String>>,
pub prefix: Option<String>,
pub r2_jurisdiction: Option<String>,
pub web_crawler: Option<AiSearchDeleteInstancesResponseResultSourceParamsWebCrawler>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultSourceParamsWebCrawler {
pub crawl_options: Option<AiSearchDeleteInstancesResponseResultSourceParamsWebCrawlerCrawlOptions>,
pub parse_options: Option<AiSearchDeleteInstancesResponseResultSourceParamsWebCrawlerParseOptions>,
pub parse_type: Option<String>,
pub store_options: Option<AiSearchDeleteInstancesResponseResultSourceParamsWebCrawlerStoreOptions>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultSourceParamsWebCrawlerCrawlOptions {
pub depth: Option<f64>,
pub include_external_links: Option<bool>,
pub include_subdomains: Option<bool>,
pub max_age: Option<f64>,
pub source: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultSourceParamsWebCrawlerParseOptions {
pub content_selector: Option<Vec<AiSearchDeleteInstancesResponseResultSourceParamsWebCrawlerParseOptionsContentSelectorItem>>,
pub include_headers: Option<serde_json::Value>,
pub include_images: Option<bool>,
pub specific_sitemaps: Option<Vec<String>>,
pub use_browser_rendering: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultSourceParamsWebCrawlerParseOptionsContentSelectorItem {
pub path: String,
pub selector: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteInstancesResponseResultSourceParamsWebCrawlerStoreOptions {
pub r2_jurisdiction: Option<String>,
pub storage_id: String,
pub storage_type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteTokensResponse {
pub result: AiSearchDeleteTokensResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchDeleteTokensResponseResult {
pub cf_api_id: String,
pub created_at: String,
pub created_by: Option<String>,
pub enabled: Option<bool>,
pub id: String,
pub legacy: Option<bool>,
pub modified_at: String,
pub modified_by: Option<String>,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponse {
pub result: AiSearchFetchInstancesResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResult {
pub ai_gateway_id: Option<String>,
pub ai_search_model: Option<String>,
pub cache: Option<bool>,
pub cache_threshold: Option<String>,
pub chunk_overlap: Option<i64>,
pub chunk_size: Option<i64>,
pub created_at: String,
pub created_by: Option<String>,
pub custom_metadata: Option<Vec<AiSearchFetchInstancesResponseResultCustomMetadataItem>>,
pub embedding_model: Option<String>,
pub enable: Option<bool>,
pub engine_version: Option<f64>,
pub fusion_method: Option<String>,
pub hybrid_search_enabled: Option<bool>,
pub id: String,
pub index_method: Option<AiSearchFetchInstancesResponseResultIndexMethod>,
pub indexing_options: Option<AiSearchFetchInstancesResponseResultIndexingOptions>,
pub last_activity: Option<String>,
pub max_num_results: Option<i64>,
pub metadata: Option<AiSearchFetchInstancesResponseResultMetadata>,
pub modified_at: String,
pub modified_by: Option<String>,
pub namespace: Option<String>,
pub paused: Option<bool>,
pub public_endpoint_id: Option<String>,
pub public_endpoint_params: Option<AiSearchFetchInstancesResponseResultPublicEndpointParams>,
pub reranking: Option<bool>,
pub reranking_model: Option<String>,
pub retrieval_options: Option<AiSearchFetchInstancesResponseResultRetrievalOptions>,
pub rewrite_model: Option<String>,
pub rewrite_query: Option<bool>,
pub score_threshold: Option<f64>,
pub source: Option<String>,
pub source_params: Option<AiSearchFetchInstancesResponseResultSourceParams>,
pub status: Option<String>,
pub token_id: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultCustomMetadataItem {
pub data_type: String,
pub field_name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultIndexMethod {
pub keyword: bool,
pub vector: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultIndexingOptions {
pub keyword_tokenizer: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultMetadata {
pub created_from_aisearch_wizard: Option<bool>,
pub worker_domain: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultPublicEndpointParams {
pub authorized_hosts: Option<Vec<String>>,
pub chat_completions_endpoint: Option<AiSearchFetchInstancesResponseResultPublicEndpointParamsChatCompletionsEndpoint>,
pub enabled: Option<bool>,
pub mcp: Option<AiSearchFetchInstancesResponseResultPublicEndpointParamsMcp>,
pub rate_limit: Option<AiSearchFetchInstancesResponseResultPublicEndpointParamsRateLimit>,
pub search_endpoint: Option<AiSearchFetchInstancesResponseResultPublicEndpointParamsSearchEndpoint>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultPublicEndpointParamsChatCompletionsEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultPublicEndpointParamsMcp {
pub description: Option<String>,
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultPublicEndpointParamsRateLimit {
pub period_ms: Option<i64>,
pub requests: Option<i64>,
pub technique: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultPublicEndpointParamsSearchEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultRetrievalOptions {
pub boost_by: Option<Vec<AiSearchFetchInstancesResponseResultRetrievalOptionsBoostByItem>>,
pub keyword_match_mode: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultRetrievalOptionsBoostByItem {
pub direction: Option<String>,
pub field: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultSourceParams {
pub exclude_items: Option<Vec<String>>,
pub include_items: Option<Vec<String>>,
pub prefix: Option<String>,
pub r2_jurisdiction: Option<String>,
pub web_crawler: Option<AiSearchFetchInstancesResponseResultSourceParamsWebCrawler>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultSourceParamsWebCrawler {
pub crawl_options: Option<AiSearchFetchInstancesResponseResultSourceParamsWebCrawlerCrawlOptions>,
pub parse_options: Option<AiSearchFetchInstancesResponseResultSourceParamsWebCrawlerParseOptions>,
pub parse_type: Option<String>,
pub store_options: Option<AiSearchFetchInstancesResponseResultSourceParamsWebCrawlerStoreOptions>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultSourceParamsWebCrawlerCrawlOptions {
pub depth: Option<f64>,
pub include_external_links: Option<bool>,
pub include_subdomains: Option<bool>,
pub max_age: Option<f64>,
pub source: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultSourceParamsWebCrawlerParseOptions {
pub content_selector: Option<Vec<AiSearchFetchInstancesResponseResultSourceParamsWebCrawlerParseOptionsContentSelectorItem>>,
pub include_headers: Option<serde_json::Value>,
pub include_images: Option<bool>,
pub specific_sitemaps: Option<Vec<String>>,
pub use_browser_rendering: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultSourceParamsWebCrawlerParseOptionsContentSelectorItem {
pub path: String,
pub selector: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchInstancesResponseResultSourceParamsWebCrawlerStoreOptions {
pub r2_jurisdiction: Option<String>,
pub storage_id: String,
pub storage_type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchTokensResponse {
pub result: AiSearchFetchTokensResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchFetchTokensResponseResult {
pub cf_api_id: String,
pub created_at: String,
pub created_by: Option<String>,
pub enabled: Option<bool>,
pub id: String,
pub legacy: Option<bool>,
pub modified_at: String,
pub modified_by: Option<String>,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChangeJobStatusRequest {
pub action: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChangeJobStatusResponse {
pub result: AiSearchInstanceChangeJobStatusResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChangeJobStatusResponseResult {
pub description: Option<String>,
pub end_reason: Option<String>,
pub ended_at: Option<String>,
pub id: String,
pub last_seen_at: Option<String>,
pub source: String,
pub started_at: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionRequest {
pub ai_search_options: Option<AiSearchInstanceChatCompletionRequestAiSearchOptions>,
pub messages: Vec<AiSearchInstanceChatCompletionRequestMessagesItem>,
pub model: Option<serde_json::Value>,
pub stream: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionRequestAiSearchOptions {
pub cache: Option<AiSearchInstanceChatCompletionRequestAiSearchOptionsCache>,
pub query_rewrite: Option<AiSearchInstanceChatCompletionRequestAiSearchOptionsQueryRewrite>,
pub reranking: Option<AiSearchInstanceChatCompletionRequestAiSearchOptionsReranking>,
pub retrieval: Option<AiSearchInstanceChatCompletionRequestAiSearchOptionsRetrieval>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionRequestAiSearchOptionsCache {
pub cache_threshold: Option<String>,
pub enabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionRequestAiSearchOptionsQueryRewrite {
pub enabled: Option<bool>,
pub model: Option<serde_json::Value>,
pub rewrite_prompt: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionRequestAiSearchOptionsReranking {
pub enabled: Option<bool>,
pub match_threshold: Option<f64>,
pub model: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionRequestAiSearchOptionsRetrieval {
pub boost_by: Option<Vec<AiSearchInstanceChatCompletionRequestAiSearchOptionsRetrievalBoostByItem>>,
pub context_expansion: Option<i64>,
pub filters: Option<serde_json::Value>,
pub fusion_method: Option<String>,
pub keyword_match_mode: Option<String>,
pub match_threshold: Option<f64>,
pub max_num_results: Option<i64>,
pub retrieval_type: Option<String>,
pub return_on_failure: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionRequestAiSearchOptionsRetrievalBoostByItem {
pub direction: Option<String>,
pub field: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionRequestMessagesItem {
pub content: Option<String>,
pub role: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionResponse {
pub choices: Vec<AiSearchInstanceChatCompletionResponseChoicesItem>,
pub chunks: Vec<AiSearchInstanceChatCompletionResponseChunksItem>,
pub id: Option<String>,
pub model: Option<String>,
pub object: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionResponseChoicesItem {
pub index: Option<i64>,
pub message: AiSearchInstanceChatCompletionResponseChoicesItemMessage,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionResponseChoicesItemMessage {
pub content: Option<String>,
pub role: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionResponseChunksItem {
pub id: String,
pub item: Option<AiSearchInstanceChatCompletionResponseChunksItemItem>,
pub score: f64,
pub scoring_details: Option<AiSearchInstanceChatCompletionResponseChunksItemScoringDetails>,
pub text: String,
#[serde(rename = "type")]
pub r#type: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionResponseChunksItemItem {
pub key: String,
pub metadata: Option<serde_json::Value>,
pub timestamp: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionResponseChunksItemScoringDetails {
pub fusion_method: Option<String>,
pub keyword_rank: Option<f64>,
pub keyword_score: Option<f64>,
pub reranking_score: Option<f64>,
pub vector_rank: Option<f64>,
pub vector_score: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceCreateJobRequest {
pub description: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceCreateJobResponse {
pub result: AiSearchInstanceCreateJobResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceCreateJobResponseResult {
pub description: Option<String>,
pub end_reason: Option<String>,
pub ended_at: Option<String>,
pub id: String,
pub last_seen_at: Option<String>,
pub source: String,
pub started_at: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceGetJobResponse {
pub result: AiSearchInstanceGetJobResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceGetJobResponseResult {
pub description: Option<String>,
pub end_reason: Option<String>,
pub ended_at: Option<String>,
pub id: String,
pub last_seen_at: Option<String>,
pub source: String,
pub started_at: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceListJobLogsResponse {
pub result: Vec<AiSearchInstanceListJobLogsResponseResultItem>,
pub result_info: AiSearchInstanceListJobLogsResponseResultInfo,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceListJobLogsResponseResultInfo {
pub count: i64,
pub page: i64,
pub per_page: i64,
pub total_count: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceListJobLogsResponseResultItem {
pub created_at: f64,
pub id: i64,
pub message: String,
pub message_type: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceListJobsResponse {
pub result: Vec<AiSearchInstanceListJobsResponseResultItem>,
pub result_info: AiSearchInstanceListJobsResponseResultInfo,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceListJobsResponseResultInfo {
pub count: i64,
pub page: i64,
pub per_page: i64,
pub total_count: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceListJobsResponseResultItem {
pub description: Option<String>,
pub end_reason: Option<String>,
pub ended_at: Option<String>,
pub id: String,
pub last_seen_at: Option<String>,
pub source: String,
pub started_at: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchRequest {
pub ai_search_options: Option<AiSearchInstanceSearchRequestAiSearchOptions>,
pub messages: Vec<AiSearchInstanceSearchRequestMessagesItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchRequestAiSearchOptions {
pub cache: Option<AiSearchInstanceSearchRequestAiSearchOptionsCache>,
pub query_rewrite: Option<AiSearchInstanceSearchRequestAiSearchOptionsQueryRewrite>,
pub reranking: Option<AiSearchInstanceSearchRequestAiSearchOptionsReranking>,
pub retrieval: Option<AiSearchInstanceSearchRequestAiSearchOptionsRetrieval>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchRequestAiSearchOptionsCache {
pub cache_threshold: Option<String>,
pub enabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchRequestAiSearchOptionsQueryRewrite {
pub enabled: Option<bool>,
pub model: Option<serde_json::Value>,
pub rewrite_prompt: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchRequestAiSearchOptionsReranking {
pub enabled: Option<bool>,
pub match_threshold: Option<f64>,
pub model: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchRequestAiSearchOptionsRetrieval {
pub boost_by: Option<Vec<AiSearchInstanceSearchRequestAiSearchOptionsRetrievalBoostByItem>>,
pub context_expansion: Option<i64>,
pub filters: Option<serde_json::Value>,
pub fusion_method: Option<String>,
pub keyword_match_mode: Option<String>,
pub match_threshold: Option<f64>,
pub max_num_results: Option<i64>,
pub retrieval_type: Option<String>,
pub return_on_failure: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchRequestAiSearchOptionsRetrievalBoostByItem {
pub direction: Option<String>,
pub field: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchRequestMessagesItem {
pub content: Option<String>,
pub role: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchResponse {
pub result: AiSearchInstanceSearchResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchResponseResult {
pub chunks: Vec<AiSearchInstanceSearchResponseResultChunksItem>,
pub search_query: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchResponseResultChunksItem {
pub id: String,
pub item: Option<AiSearchInstanceSearchResponseResultChunksItemItem>,
pub score: f64,
pub scoring_details: Option<AiSearchInstanceSearchResponseResultChunksItemScoringDetails>,
pub text: String,
#[serde(rename = "type")]
pub r#type: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchResponseResultChunksItemItem {
pub key: String,
pub metadata: Option<serde_json::Value>,
pub timestamp: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchInstanceSearchResponseResultChunksItemScoringDetails {
pub fusion_method: Option<String>,
pub keyword_rank: Option<f64>,
pub keyword_score: Option<f64>,
pub reranking_score: Option<f64>,
pub vector_rank: Option<f64>,
pub vector_score: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponse {
pub result: Vec<AiSearchListInstancesResponseResultItem>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItem {
pub ai_gateway_id: Option<String>,
pub ai_search_model: Option<String>,
pub cache: Option<bool>,
pub cache_threshold: Option<String>,
pub chunk_overlap: Option<i64>,
pub chunk_size: Option<i64>,
pub created_at: String,
pub created_by: Option<String>,
pub custom_metadata: Option<Vec<AiSearchListInstancesResponseResultItemCustomMetadataItem>>,
pub embedding_model: Option<String>,
pub enable: Option<bool>,
pub engine_version: Option<f64>,
pub fusion_method: Option<String>,
pub hybrid_search_enabled: Option<bool>,
pub id: String,
pub index_method: Option<AiSearchListInstancesResponseResultItemIndexMethod>,
pub indexing_options: Option<AiSearchListInstancesResponseResultItemIndexingOptions>,
pub last_activity: Option<String>,
pub max_num_results: Option<i64>,
pub metadata: Option<AiSearchListInstancesResponseResultItemMetadata>,
pub modified_at: String,
pub modified_by: Option<String>,
pub namespace: Option<String>,
pub paused: Option<bool>,
pub public_endpoint_id: Option<String>,
pub public_endpoint_params: Option<AiSearchListInstancesResponseResultItemPublicEndpointParams>,
pub reranking: Option<bool>,
pub reranking_model: Option<String>,
pub retrieval_options: Option<AiSearchListInstancesResponseResultItemRetrievalOptions>,
pub rewrite_model: Option<String>,
pub rewrite_query: Option<bool>,
pub score_threshold: Option<f64>,
pub source: Option<String>,
pub source_params: Option<AiSearchListInstancesResponseResultItemSourceParams>,
pub status: Option<String>,
pub token_id: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemCustomMetadataItem {
pub data_type: String,
pub field_name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemIndexMethod {
pub keyword: bool,
pub vector: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemIndexingOptions {
pub keyword_tokenizer: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemMetadata {
pub created_from_aisearch_wizard: Option<bool>,
pub worker_domain: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemPublicEndpointParams {
pub authorized_hosts: Option<Vec<String>>,
pub chat_completions_endpoint: Option<AiSearchListInstancesResponseResultItemPublicEndpointParamsChatCompletionsEndpoint>,
pub enabled: Option<bool>,
pub mcp: Option<AiSearchListInstancesResponseResultItemPublicEndpointParamsMcp>,
pub rate_limit: Option<AiSearchListInstancesResponseResultItemPublicEndpointParamsRateLimit>,
pub search_endpoint: Option<AiSearchListInstancesResponseResultItemPublicEndpointParamsSearchEndpoint>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemPublicEndpointParamsChatCompletionsEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemPublicEndpointParamsMcp {
pub description: Option<String>,
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemPublicEndpointParamsRateLimit {
pub period_ms: Option<i64>,
pub requests: Option<i64>,
pub technique: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemPublicEndpointParamsSearchEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemRetrievalOptions {
pub boost_by: Option<Vec<AiSearchListInstancesResponseResultItemRetrievalOptionsBoostByItem>>,
pub keyword_match_mode: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemRetrievalOptionsBoostByItem {
pub direction: Option<String>,
pub field: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemSourceParams {
pub exclude_items: Option<Vec<String>>,
pub include_items: Option<Vec<String>>,
pub prefix: Option<String>,
pub r2_jurisdiction: Option<String>,
pub web_crawler: Option<AiSearchListInstancesResponseResultItemSourceParamsWebCrawler>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemSourceParamsWebCrawler {
pub crawl_options: Option<AiSearchListInstancesResponseResultItemSourceParamsWebCrawlerCrawlOptions>,
pub parse_options: Option<AiSearchListInstancesResponseResultItemSourceParamsWebCrawlerParseOptions>,
pub parse_type: Option<String>,
pub store_options: Option<AiSearchListInstancesResponseResultItemSourceParamsWebCrawlerStoreOptions>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemSourceParamsWebCrawlerCrawlOptions {
pub depth: Option<f64>,
pub include_external_links: Option<bool>,
pub include_subdomains: Option<bool>,
pub max_age: Option<f64>,
pub source: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemSourceParamsWebCrawlerParseOptions {
pub content_selector: Option<Vec<AiSearchListInstancesResponseResultItemSourceParamsWebCrawlerParseOptionsContentSelectorItem>>,
pub include_headers: Option<serde_json::Value>,
pub include_images: Option<bool>,
pub specific_sitemaps: Option<Vec<String>>,
pub use_browser_rendering: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemSourceParamsWebCrawlerParseOptionsContentSelectorItem {
pub path: String,
pub selector: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListInstancesResponseResultItemSourceParamsWebCrawlerStoreOptions {
pub r2_jurisdiction: Option<String>,
pub storage_id: String,
pub storage_type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListTokensResponse {
pub result: Vec<AiSearchListTokensResponseResultItem>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchListTokensResponseResultItem {
pub cf_api_id: String,
pub created_at: String,
pub created_by: Option<String>,
pub enabled: Option<bool>,
pub id: String,
pub legacy: Option<bool>,
pub modified_at: String,
pub modified_by: Option<String>,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchStatsResponse {
pub result: AiSearchStatsResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchStatsResponseResult {
pub completed: Option<i64>,
pub error: Option<i64>,
pub file_embed_errors: Option<serde_json::Value>,
pub index_source_errors: Option<serde_json::Value>,
pub last_activity: Option<String>,
pub outdated: Option<i64>,
pub queued: Option<i64>,
pub running: Option<i64>,
pub skipped: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequest {
pub ai_gateway_id: Option<String>,
pub ai_search_model: Option<String>,
pub cache: Option<bool>,
pub cache_threshold: Option<String>,
pub chunk: Option<bool>,
pub chunk_overlap: Option<i64>,
pub chunk_size: Option<i64>,
pub custom_metadata: Option<Vec<AiSearchUpdateInstancesRequestCustomMetadataItem>>,
pub embedding_model: Option<String>,
pub fusion_method: Option<String>,
pub index_method: Option<AiSearchUpdateInstancesRequestIndexMethod>,
pub indexing_options: Option<AiSearchUpdateInstancesRequestIndexingOptions>,
pub max_num_results: Option<i64>,
pub metadata: Option<AiSearchUpdateInstancesRequestMetadata>,
pub paused: Option<bool>,
pub public_endpoint_params: Option<AiSearchUpdateInstancesRequestPublicEndpointParams>,
pub reranking: Option<bool>,
pub reranking_model: Option<String>,
pub retrieval_options: Option<AiSearchUpdateInstancesRequestRetrievalOptions>,
pub rewrite_model: Option<String>,
pub rewrite_query: Option<bool>,
pub score_threshold: Option<f64>,
pub source_params: Option<AiSearchUpdateInstancesRequestSourceParams>,
pub summarization: Option<bool>,
pub summarization_model: Option<String>,
pub system_prompt_ai_search: Option<String>,
pub system_prompt_index_summarization: Option<String>,
pub system_prompt_rewrite_query: Option<String>,
pub token_id: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestCustomMetadataItem {
pub data_type: String,
pub field_name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestIndexMethod {
pub keyword: bool,
pub vector: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestIndexingOptions {
pub keyword_tokenizer: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestMetadata {
pub created_from_aisearch_wizard: Option<bool>,
pub worker_domain: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestPublicEndpointParams {
pub authorized_hosts: Option<Vec<String>>,
pub chat_completions_endpoint: Option<AiSearchUpdateInstancesRequestPublicEndpointParamsChatCompletionsEndpoint>,
pub enabled: Option<bool>,
pub mcp: Option<AiSearchUpdateInstancesRequestPublicEndpointParamsMcp>,
pub rate_limit: Option<AiSearchUpdateInstancesRequestPublicEndpointParamsRateLimit>,
pub search_endpoint: Option<AiSearchUpdateInstancesRequestPublicEndpointParamsSearchEndpoint>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestPublicEndpointParamsChatCompletionsEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestPublicEndpointParamsMcp {
pub description: Option<String>,
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestPublicEndpointParamsRateLimit {
pub period_ms: Option<i64>,
pub requests: Option<i64>,
pub technique: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestPublicEndpointParamsSearchEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestRetrievalOptions {
pub boost_by: Option<Vec<AiSearchUpdateInstancesRequestRetrievalOptionsBoostByItem>>,
pub keyword_match_mode: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestRetrievalOptionsBoostByItem {
pub direction: Option<String>,
pub field: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestSourceParams {
pub exclude_items: Option<Vec<String>>,
pub include_items: Option<Vec<String>>,
pub prefix: Option<String>,
pub r2_jurisdiction: Option<String>,
pub web_crawler: Option<AiSearchUpdateInstancesRequestSourceParamsWebCrawler>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestSourceParamsWebCrawler {
pub crawl_options: Option<AiSearchUpdateInstancesRequestSourceParamsWebCrawlerCrawlOptions>,
pub parse_options: Option<AiSearchUpdateInstancesRequestSourceParamsWebCrawlerParseOptions>,
pub parse_type: Option<String>,
pub store_options: Option<AiSearchUpdateInstancesRequestSourceParamsWebCrawlerStoreOptions>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestSourceParamsWebCrawlerCrawlOptions {
pub depth: Option<f64>,
pub include_external_links: Option<bool>,
pub include_subdomains: Option<bool>,
pub max_age: Option<f64>,
pub source: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestSourceParamsWebCrawlerParseOptions {
pub content_selector: Option<Vec<AiSearchUpdateInstancesRequestSourceParamsWebCrawlerParseOptionsContentSelectorItem>>,
pub include_headers: Option<serde_json::Value>,
pub include_images: Option<bool>,
pub specific_sitemaps: Option<Vec<String>>,
pub use_browser_rendering: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestSourceParamsWebCrawlerParseOptionsContentSelectorItem {
pub path: String,
pub selector: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesRequestSourceParamsWebCrawlerStoreOptions {
pub r2_jurisdiction: Option<String>,
pub storage_id: String,
pub storage_type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponse {
pub result: AiSearchUpdateInstancesResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResult {
pub ai_gateway_id: Option<String>,
pub ai_search_model: Option<String>,
pub cache: Option<bool>,
pub cache_threshold: Option<String>,
pub chunk_overlap: Option<i64>,
pub chunk_size: Option<i64>,
pub created_at: String,
pub created_by: Option<String>,
pub custom_metadata: Option<Vec<AiSearchUpdateInstancesResponseResultCustomMetadataItem>>,
pub embedding_model: Option<String>,
pub enable: Option<bool>,
pub engine_version: Option<f64>,
pub fusion_method: Option<String>,
pub hybrid_search_enabled: Option<bool>,
pub id: String,
pub index_method: Option<AiSearchUpdateInstancesResponseResultIndexMethod>,
pub indexing_options: Option<AiSearchUpdateInstancesResponseResultIndexingOptions>,
pub last_activity: Option<String>,
pub max_num_results: Option<i64>,
pub metadata: Option<AiSearchUpdateInstancesResponseResultMetadata>,
pub modified_at: String,
pub modified_by: Option<String>,
pub namespace: Option<String>,
pub paused: Option<bool>,
pub public_endpoint_id: Option<String>,
pub public_endpoint_params: Option<AiSearchUpdateInstancesResponseResultPublicEndpointParams>,
pub reranking: Option<bool>,
pub reranking_model: Option<String>,
pub retrieval_options: Option<AiSearchUpdateInstancesResponseResultRetrievalOptions>,
pub rewrite_model: Option<String>,
pub rewrite_query: Option<bool>,
pub score_threshold: Option<f64>,
pub source: Option<String>,
pub source_params: Option<AiSearchUpdateInstancesResponseResultSourceParams>,
pub status: Option<String>,
pub token_id: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultCustomMetadataItem {
pub data_type: String,
pub field_name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultIndexMethod {
pub keyword: bool,
pub vector: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultIndexingOptions {
pub keyword_tokenizer: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultMetadata {
pub created_from_aisearch_wizard: Option<bool>,
pub worker_domain: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultPublicEndpointParams {
pub authorized_hosts: Option<Vec<String>>,
pub chat_completions_endpoint: Option<AiSearchUpdateInstancesResponseResultPublicEndpointParamsChatCompletionsEndpoint>,
pub enabled: Option<bool>,
pub mcp: Option<AiSearchUpdateInstancesResponseResultPublicEndpointParamsMcp>,
pub rate_limit: Option<AiSearchUpdateInstancesResponseResultPublicEndpointParamsRateLimit>,
pub search_endpoint: Option<AiSearchUpdateInstancesResponseResultPublicEndpointParamsSearchEndpoint>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultPublicEndpointParamsChatCompletionsEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultPublicEndpointParamsMcp {
pub description: Option<String>,
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultPublicEndpointParamsRateLimit {
pub period_ms: Option<i64>,
pub requests: Option<i64>,
pub technique: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultPublicEndpointParamsSearchEndpoint {
pub disabled: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultRetrievalOptions {
pub boost_by: Option<Vec<AiSearchUpdateInstancesResponseResultRetrievalOptionsBoostByItem>>,
pub keyword_match_mode: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultRetrievalOptionsBoostByItem {
pub direction: Option<String>,
pub field: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultSourceParams {
pub exclude_items: Option<Vec<String>>,
pub include_items: Option<Vec<String>>,
pub prefix: Option<String>,
pub r2_jurisdiction: Option<String>,
pub web_crawler: Option<AiSearchUpdateInstancesResponseResultSourceParamsWebCrawler>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultSourceParamsWebCrawler {
pub crawl_options: Option<AiSearchUpdateInstancesResponseResultSourceParamsWebCrawlerCrawlOptions>,
pub parse_options: Option<AiSearchUpdateInstancesResponseResultSourceParamsWebCrawlerParseOptions>,
pub parse_type: Option<String>,
pub store_options: Option<AiSearchUpdateInstancesResponseResultSourceParamsWebCrawlerStoreOptions>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultSourceParamsWebCrawlerCrawlOptions {
pub depth: Option<f64>,
pub include_external_links: Option<bool>,
pub include_subdomains: Option<bool>,
pub max_age: Option<f64>,
pub source: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultSourceParamsWebCrawlerParseOptions {
pub content_selector: Option<Vec<AiSearchUpdateInstancesResponseResultSourceParamsWebCrawlerParseOptionsContentSelectorItem>>,
pub include_headers: Option<serde_json::Value>,
pub include_images: Option<bool>,
pub specific_sitemaps: Option<Vec<String>>,
pub use_browser_rendering: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultSourceParamsWebCrawlerParseOptionsContentSelectorItem {
pub path: String,
pub selector: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateInstancesResponseResultSourceParamsWebCrawlerStoreOptions {
pub r2_jurisdiction: Option<String>,
pub storage_id: String,
pub storage_type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateTokensRequest {
pub cf_api_id: String,
pub cf_api_key: String,
pub legacy: Option<bool>,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateTokensResponse {
pub result: AiSearchUpdateTokensResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AiSearchUpdateTokensResponseResult {
pub cf_api_id: String,
pub created_at: String,
pub created_by: Option<String>,
pub enabled: Option<bool>,
pub id: String,
pub legacy: Option<bool>,
pub modified_at: String,
pub modified_by: Option<String>,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateDatasetRequest {
pub enable: bool,
pub filters: Vec<AigConfigCreateDatasetRequestFiltersItem>,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateDatasetRequestFiltersItem {
pub key: String,
pub operator: String,
pub value: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateDatasetResponse {
pub result: AigConfigCreateDatasetResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateDatasetResponseResult {
pub created_at: String,
pub enable: bool,
pub filters: Vec<AigConfigCreateDatasetResponseResultFiltersItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateDatasetResponseResultFiltersItem {
pub key: String,
pub operator: String,
pub value: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateEvaluationsRequest {
pub dataset_ids: Vec<String>,
pub evaluation_type_ids: Vec<String>,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateEvaluationsResponse {
pub result: AigConfigCreateEvaluationsResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateEvaluationsResponseResult {
pub created_at: String,
pub datasets: Vec<AigConfigCreateEvaluationsResponseResultDatasetsItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
pub processed: bool,
pub results: Vec<AigConfigCreateEvaluationsResponseResultResultsItem>,
pub total_logs: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateEvaluationsResponseResultDatasetsItem {
pub account_id: String,
pub account_tag: String,
pub created_at: String,
pub enable: bool,
pub filters: Vec<AigConfigCreateEvaluationsResponseResultDatasetsItemFiltersItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateEvaluationsResponseResultDatasetsItemFiltersItem {
pub key: String,
pub operator: String,
pub value: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateEvaluationsResponseResultResultsItem {
pub created_at: String,
pub evaluation_id: String,
pub evaluation_type_id: String,
pub id: String,
pub modified_at: String,
pub result: String,
pub status: f64,
pub status_description: String,
pub total_logs: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateGatewayRequest {
pub authentication: Option<bool>,
pub cache_invalidate_on_update: bool,
pub cache_ttl: Option<i64>,
pub collect_logs: bool,
pub id: String,
pub log_management: Option<i64>,
pub log_management_strategy: Option<String>,
pub logpush: Option<bool>,
pub logpush_public_key: Option<String>,
pub rate_limiting_interval: Option<i64>,
pub rate_limiting_limit: Option<i64>,
pub rate_limiting_technique: Option<String>,
pub retry_backoff: Option<String>,
pub retry_delay: Option<i64>,
pub retry_max_attempts: Option<i64>,
pub workers_ai_billing_mode: Option<String>,
pub zdr: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateGatewayResponse {
pub result: AigConfigCreateGatewayResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateGatewayResponseResult {
pub authentication: Option<bool>,
pub cache_invalidate_on_update: bool,
pub cache_ttl: Option<i64>,
pub collect_logs: bool,
pub created_at: String,
pub dlp: Option<serde_json::Value>,
pub id: String,
pub is_default: Option<bool>,
pub log_management: Option<i64>,
pub log_management_strategy: Option<String>,
pub logpush: Option<bool>,
pub logpush_public_key: Option<String>,
pub modified_at: String,
pub otel: Option<Vec<AigConfigCreateGatewayResponseResultOtelItem>>,
pub rate_limiting_interval: Option<i64>,
pub rate_limiting_limit: Option<i64>,
pub rate_limiting_technique: Option<String>,
pub retry_backoff: Option<String>,
pub retry_delay: Option<i64>,
pub retry_max_attempts: Option<i64>,
pub store_id: Option<String>,
pub stripe: Option<AigConfigCreateGatewayResponseResultStripe>,
pub workers_ai_billing_mode: Option<String>,
pub zdr: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateGatewayResponseResultOtelItem {
pub authorization: String,
pub content_type: Option<String>,
pub headers: serde_json::Value,
pub url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateGatewayResponseResultStripe {
pub authorization: String,
pub usage_events: Vec<AigConfigCreateGatewayResponseResultStripeUsageEventsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateGatewayResponseResultStripeUsageEventsItem {
pub payload: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateProvidersRequest {
pub alias: String,
pub default_config: bool,
pub provider_slug: String,
pub rate_limit: Option<f64>,
pub rate_limit_period: Option<f64>,
pub secret: String,
pub secret_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateProvidersResponse {
pub result: AigConfigCreateProvidersResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigCreateProvidersResponseResult {
pub alias: String,
pub default_config: bool,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub provider_slug: String,
pub rate_limit: Option<f64>,
pub rate_limit_period: Option<f64>,
pub secret_id: String,
pub secret_preview: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteDatasetResponse {
pub result: AigConfigDeleteDatasetResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteDatasetResponseResult {
pub created_at: String,
pub enable: bool,
pub filters: Vec<AigConfigDeleteDatasetResponseResultFiltersItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteDatasetResponseResultFiltersItem {
pub key: String,
pub operator: String,
pub value: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteEvaluationsResponse {
pub result: AigConfigDeleteEvaluationsResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteEvaluationsResponseResult {
pub created_at: String,
pub datasets: Vec<AigConfigDeleteEvaluationsResponseResultDatasetsItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
pub processed: bool,
pub results: Vec<AigConfigDeleteEvaluationsResponseResultResultsItem>,
pub total_logs: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteEvaluationsResponseResultDatasetsItem {
pub account_id: String,
pub account_tag: String,
pub created_at: String,
pub enable: bool,
pub filters: Vec<AigConfigDeleteEvaluationsResponseResultDatasetsItemFiltersItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteEvaluationsResponseResultDatasetsItemFiltersItem {
pub key: String,
pub operator: String,
pub value: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteEvaluationsResponseResultResultsItem {
pub created_at: String,
pub evaluation_id: String,
pub evaluation_type_id: String,
pub id: String,
pub modified_at: String,
pub result: String,
pub status: f64,
pub status_description: String,
pub total_logs: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteGatewayDynamicRouteResponse {
pub result: AigConfigDeleteGatewayDynamicRouteResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteGatewayDynamicRouteResponseResult {
pub created_at: String,
pub elements: Vec<serde_json::Value>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteGatewayLogsResponse {
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteGatewayResponse {
pub result: AigConfigDeleteGatewayResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteGatewayResponseResult {
pub authentication: Option<bool>,
pub cache_invalidate_on_update: bool,
pub cache_ttl: Option<i64>,
pub collect_logs: bool,
pub created_at: String,
pub dlp: Option<serde_json::Value>,
pub id: String,
pub is_default: Option<bool>,
pub log_management: Option<i64>,
pub log_management_strategy: Option<String>,
pub logpush: Option<bool>,
pub logpush_public_key: Option<String>,
pub modified_at: String,
pub otel: Option<Vec<AigConfigDeleteGatewayResponseResultOtelItem>>,
pub rate_limiting_interval: Option<i64>,
pub rate_limiting_limit: Option<i64>,
pub rate_limiting_technique: Option<String>,
pub retry_backoff: Option<String>,
pub retry_delay: Option<i64>,
pub retry_max_attempts: Option<i64>,
pub store_id: Option<String>,
pub stripe: Option<AigConfigDeleteGatewayResponseResultStripe>,
pub workers_ai_billing_mode: Option<String>,
pub zdr: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteGatewayResponseResultOtelItem {
pub authorization: String,
pub content_type: Option<String>,
pub headers: serde_json::Value,
pub url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteGatewayResponseResultStripe {
pub authorization: String,
pub usage_events: Vec<AigConfigDeleteGatewayResponseResultStripeUsageEventsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteGatewayResponseResultStripeUsageEventsItem {
pub payload: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteProvidersResponse {
pub result: AigConfigDeleteProvidersResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigDeleteProvidersResponseResult {
pub alias: String,
pub default_config: bool,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub provider_slug: String,
pub rate_limit: Option<f64>,
pub rate_limit_period: Option<f64>,
pub secret_id: String,
pub secret_preview: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchDatasetResponse {
pub result: AigConfigFetchDatasetResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchDatasetResponseResult {
pub created_at: String,
pub enable: bool,
pub filters: Vec<AigConfigFetchDatasetResponseResultFiltersItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchDatasetResponseResultFiltersItem {
pub key: String,
pub operator: String,
pub value: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchEvaluationsResponse {
pub result: AigConfigFetchEvaluationsResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchEvaluationsResponseResult {
pub created_at: String,
pub datasets: Vec<AigConfigFetchEvaluationsResponseResultDatasetsItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
pub processed: bool,
pub results: Vec<AigConfigFetchEvaluationsResponseResultResultsItem>,
pub total_logs: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchEvaluationsResponseResultDatasetsItem {
pub account_id: String,
pub account_tag: String,
pub created_at: String,
pub enable: bool,
pub filters: Vec<AigConfigFetchEvaluationsResponseResultDatasetsItemFiltersItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchEvaluationsResponseResultDatasetsItemFiltersItem {
pub key: String,
pub operator: String,
pub value: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchEvaluationsResponseResultResultsItem {
pub created_at: String,
pub evaluation_id: String,
pub evaluation_type_id: String,
pub id: String,
pub modified_at: String,
pub result: String,
pub status: f64,
pub status_description: String,
pub total_logs: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchGatewayResponse {
pub result: AigConfigFetchGatewayResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchGatewayResponseResult {
pub authentication: Option<bool>,
pub cache_invalidate_on_update: bool,
pub cache_ttl: Option<i64>,
pub collect_logs: bool,
pub created_at: String,
pub dlp: Option<serde_json::Value>,
pub id: String,
pub is_default: Option<bool>,
pub log_management: Option<i64>,
pub log_management_strategy: Option<String>,
pub logpush: Option<bool>,
pub logpush_public_key: Option<String>,
pub modified_at: String,
pub otel: Option<Vec<AigConfigFetchGatewayResponseResultOtelItem>>,
pub rate_limiting_interval: Option<i64>,
pub rate_limiting_limit: Option<i64>,
pub rate_limiting_technique: Option<String>,
pub retry_backoff: Option<String>,
pub retry_delay: Option<i64>,
pub retry_max_attempts: Option<i64>,
pub store_id: Option<String>,
pub stripe: Option<AigConfigFetchGatewayResponseResultStripe>,
pub workers_ai_billing_mode: Option<String>,
pub zdr: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchGatewayResponseResultOtelItem {
pub authorization: String,
pub content_type: Option<String>,
pub headers: serde_json::Value,
pub url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchGatewayResponseResultStripe {
pub authorization: String,
pub usage_events: Vec<AigConfigFetchGatewayResponseResultStripeUsageEventsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigFetchGatewayResponseResultStripeUsageEventsItem {
pub payload: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigGetGatewayDynamicRouteResponse {
pub result: AigConfigGetGatewayDynamicRouteResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigGetGatewayDynamicRouteResponseResult {
pub created_at: String,
pub deployment: AigConfigGetGatewayDynamicRouteResponseResultDeployment,
pub elements: Vec<serde_json::Value>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
pub version: AigConfigGetGatewayDynamicRouteResponseResultVersion,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigGetGatewayDynamicRouteResponseResultDeployment {
pub created_at: String,
pub deployment_id: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigGetGatewayDynamicRouteResponseResultVersion {
pub active: String,
pub created_at: String,
pub data: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigGetGatewayDynamicRouteVersionResponse {
pub result: AigConfigGetGatewayDynamicRouteVersionResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigGetGatewayDynamicRouteVersionResponseResult {
pub active: String,
pub created_at: String,
pub data: String,
pub elements: Vec<serde_json::Value>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigGetGatewayLogDetailResponse {
pub result: AigConfigGetGatewayLogDetailResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigGetGatewayLogDetailResponseResult {
pub cached: bool,
pub cost: Option<f64>,
pub created_at: String,
pub custom_cost: Option<bool>,
pub duration: i64,
pub id: String,
pub metadata: Option<String>,
pub model: String,
pub model_type: Option<String>,
pub path: String,
pub provider: String,
pub request_content_type: Option<String>,
pub request_head: Option<String>,
pub request_head_complete: Option<bool>,
pub request_size: Option<i64>,
pub request_type: Option<String>,
pub response_content_type: Option<String>,
pub response_head: Option<String>,
pub response_head_complete: Option<bool>,
pub response_size: Option<i64>,
pub status_code: Option<i64>,
pub step: Option<i64>,
pub success: bool,
pub tokens_in: Option<i64>,
pub tokens_out: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigGetGatewayUrlResponse {
pub result: String,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListDatasetResponse {
pub result: Vec<AigConfigListDatasetResponseResultItem>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListDatasetResponseResultItem {
pub created_at: String,
pub enable: bool,
pub filters: Vec<AigConfigListDatasetResponseResultItemFiltersItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListDatasetResponseResultItemFiltersItem {
pub key: String,
pub operator: String,
pub value: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListEvaluationsResponse {
pub result: Vec<AigConfigListEvaluationsResponseResultItem>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListEvaluationsResponseResultItem {
pub created_at: String,
pub datasets: Vec<AigConfigListEvaluationsResponseResultItemDatasetsItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
pub processed: bool,
pub results: Vec<AigConfigListEvaluationsResponseResultItemResultsItem>,
pub total_logs: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListEvaluationsResponseResultItemDatasetsItem {
pub account_id: String,
pub account_tag: String,
pub created_at: String,
pub enable: bool,
pub filters: Vec<AigConfigListEvaluationsResponseResultItemDatasetsItemFiltersItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListEvaluationsResponseResultItemDatasetsItemFiltersItem {
pub key: String,
pub operator: String,
pub value: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListEvaluationsResponseResultItemResultsItem {
pub created_at: String,
pub evaluation_id: String,
pub evaluation_type_id: String,
pub id: String,
pub modified_at: String,
pub result: String,
pub status: f64,
pub status_description: String,
pub total_logs: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListEvaluatorsResponse {
pub result: Vec<AigConfigListEvaluatorsResponseResultItem>,
pub result_info: AigConfigListEvaluatorsResponseResultInfo,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListEvaluatorsResponseResultInfo {
pub count: f64,
pub page: f64,
pub per_page: f64,
pub total_count: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListEvaluatorsResponseResultItem {
pub created_at: String,
pub description: String,
pub enable: bool,
pub id: String,
pub mandatory: bool,
pub modified_at: String,
pub name: String,
#[serde(rename = "type")]
pub r#type: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRouteDeploymentsResponse {
pub data: AigConfigListGatewayDynamicRouteDeploymentsResponseData,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRouteDeploymentsResponseData {
pub deployments: Vec<AigConfigListGatewayDynamicRouteDeploymentsResponseDataDeploymentsItem>,
pub order_by: String,
pub order_by_direction: String,
pub page: f64,
pub per_page: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRouteDeploymentsResponseDataDeploymentsItem {
pub created_at: String,
pub deployment_id: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRouteVersionsResponse {
pub data: AigConfigListGatewayDynamicRouteVersionsResponseData,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRouteVersionsResponseData {
pub order_by: String,
pub order_by_direction: String,
pub page: f64,
pub per_page: f64,
pub versions: Vec<AigConfigListGatewayDynamicRouteVersionsResponseDataVersionsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRouteVersionsResponseDataVersionsItem {
pub active: String,
pub created_at: String,
pub data: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRoutesResponse {
pub data: AigConfigListGatewayDynamicRoutesResponseData,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRoutesResponseData {
pub order_by: String,
pub order_by_direction: String,
pub page: f64,
pub per_page: f64,
pub routes: Vec<AigConfigListGatewayDynamicRoutesResponseDataRoutesItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRoutesResponseDataRoutesItem {
pub account_tag: String,
pub created_at: String,
pub deployment: AigConfigListGatewayDynamicRoutesResponseDataRoutesItemDeployment,
pub elements: Vec<serde_json::Value>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
pub version: AigConfigListGatewayDynamicRoutesResponseDataRoutesItemVersion,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRoutesResponseDataRoutesItemDeployment {
pub created_at: String,
pub deployment_id: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRoutesResponseDataRoutesItemVersion {
pub active: String,
pub created_at: String,
pub data: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayLogsResponse {
pub result: Vec<AigConfigListGatewayLogsResponseResultItem>,
pub result_info: AigConfigListGatewayLogsResponseResultInfo,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayLogsResponseResultInfo {
pub count: Option<f64>,
pub max_cost: Option<f64>,
pub max_duration: Option<f64>,
pub max_tokens_in: Option<f64>,
pub max_tokens_out: Option<f64>,
pub max_total_tokens: Option<f64>,
pub min_cost: Option<f64>,
pub min_duration: Option<f64>,
pub min_tokens_in: Option<f64>,
pub min_tokens_out: Option<f64>,
pub min_total_tokens: Option<f64>,
pub page: Option<f64>,
pub per_page: Option<f64>,
pub total_count: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayLogsResponseResultItem {
pub cached: bool,
pub cost: Option<f64>,
pub created_at: String,
pub custom_cost: Option<bool>,
pub duration: i64,
pub id: String,
pub metadata: Option<String>,
pub model: String,
pub model_type: Option<String>,
pub path: String,
pub provider: String,
pub request_content_type: Option<String>,
pub request_type: Option<String>,
pub response_content_type: Option<String>,
pub status_code: Option<i64>,
pub step: Option<i64>,
pub success: bool,
pub tokens_in: Option<i64>,
pub tokens_out: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayResponse {
pub result: Vec<AigConfigListGatewayResponseResultItem>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayResponseResultItem {
pub authentication: Option<bool>,
pub cache_invalidate_on_update: bool,
pub cache_ttl: Option<i64>,
pub collect_logs: bool,
pub created_at: String,
pub dlp: Option<serde_json::Value>,
pub id: String,
pub is_default: Option<bool>,
pub log_management: Option<i64>,
pub log_management_strategy: Option<String>,
pub logpush: Option<bool>,
pub logpush_public_key: Option<String>,
pub modified_at: String,
pub otel: Option<Vec<AigConfigListGatewayResponseResultItemOtelItem>>,
pub rate_limiting_interval: Option<i64>,
pub rate_limiting_limit: Option<i64>,
pub rate_limiting_technique: Option<String>,
pub retry_backoff: Option<String>,
pub retry_delay: Option<i64>,
pub retry_max_attempts: Option<i64>,
pub store_id: Option<String>,
pub stripe: Option<AigConfigListGatewayResponseResultItemStripe>,
pub workers_ai_billing_mode: Option<String>,
pub zdr: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayResponseResultItemOtelItem {
pub authorization: String,
pub content_type: Option<String>,
pub headers: serde_json::Value,
pub url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayResponseResultItemStripe {
pub authorization: String,
pub usage_events: Vec<AigConfigListGatewayResponseResultItemStripeUsageEventsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListGatewayResponseResultItemStripeUsageEventsItem {
pub payload: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListProvidersResponse {
pub result: Vec<AigConfigListProvidersResponseResultItem>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigListProvidersResponseResultItem {
pub alias: String,
pub default_config: bool,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub provider_slug: String,
pub rate_limit: Option<f64>,
pub rate_limit_period: Option<f64>,
pub secret_id: String,
pub secret_preview: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPatchGatewayLogRequest {
pub feedback: Option<f64>,
pub metadata: Option<serde_json::Value>,
pub score: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPatchGatewayLogResponse {
pub result: serde_json::Value,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteDeploymentRequest {
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteDeploymentResponse {
pub result: AigConfigPostGatewayDynamicRouteDeploymentResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteDeploymentResponseResult {
pub created_at: String,
pub elements: Vec<serde_json::Value>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteRequest {
pub elements: Vec<serde_json::Value>,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteResponse {
pub result: AigConfigPostGatewayDynamicRouteResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteResponseResult {
pub created_at: String,
pub deployment: AigConfigPostGatewayDynamicRouteResponseResultDeployment,
pub elements: Vec<serde_json::Value>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
pub version: AigConfigPostGatewayDynamicRouteResponseResultVersion,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteResponseResultDeployment {
pub created_at: String,
pub deployment_id: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteResponseResultVersion {
pub active: String,
pub created_at: String,
pub data: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteVersionRequest {
pub elements: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteVersionResponse {
pub result: AigConfigPostGatewayDynamicRouteVersionResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteVersionResponseResult {
pub created_at: String,
pub elements: Vec<serde_json::Value>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateDatasetRequest {
pub enable: bool,
pub filters: Vec<AigConfigUpdateDatasetRequestFiltersItem>,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateDatasetRequestFiltersItem {
pub key: String,
pub operator: String,
pub value: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateDatasetResponse {
pub result: AigConfigUpdateDatasetResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateDatasetResponseResult {
pub created_at: String,
pub enable: bool,
pub filters: Vec<AigConfigUpdateDatasetResponseResultFiltersItem>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateDatasetResponseResultFiltersItem {
pub key: String,
pub operator: String,
pub value: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayDynamicRouteRequest {
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayDynamicRouteResponse {
pub route: AigConfigUpdateGatewayDynamicRouteResponseRoute,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayDynamicRouteResponseRoute {
pub account_tag: String,
pub created_at: String,
pub deployment: AigConfigUpdateGatewayDynamicRouteResponseRouteDeployment,
pub elements: Vec<serde_json::Value>,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub name: String,
pub version: AigConfigUpdateGatewayDynamicRouteResponseRouteVersion,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayDynamicRouteResponseRouteDeployment {
pub created_at: String,
pub deployment_id: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayDynamicRouteResponseRouteVersion {
pub active: String,
pub created_at: String,
pub data: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayRequest {
pub authentication: Option<bool>,
pub cache_invalidate_on_update: bool,
pub cache_ttl: Option<i64>,
pub collect_logs: bool,
pub dlp: Option<serde_json::Value>,
pub log_management: Option<i64>,
pub log_management_strategy: Option<String>,
pub logpush: Option<bool>,
pub logpush_public_key: Option<String>,
pub otel: Option<Vec<AigConfigUpdateGatewayRequestOtelItem>>,
pub rate_limiting_interval: Option<i64>,
pub rate_limiting_limit: Option<i64>,
pub rate_limiting_technique: Option<String>,
pub retry_backoff: Option<String>,
pub retry_delay: Option<i64>,
pub retry_max_attempts: Option<i64>,
pub store_id: Option<String>,
pub stripe: Option<AigConfigUpdateGatewayRequestStripe>,
pub workers_ai_billing_mode: Option<String>,
pub zdr: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayRequestOtelItem {
pub authorization: String,
pub content_type: Option<String>,
pub headers: serde_json::Value,
pub url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayRequestStripe {
pub authorization: String,
pub usage_events: Vec<AigConfigUpdateGatewayRequestStripeUsageEventsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayRequestStripeUsageEventsItem {
pub payload: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayResponse {
pub result: AigConfigUpdateGatewayResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayResponseResult {
pub authentication: Option<bool>,
pub cache_invalidate_on_update: bool,
pub cache_ttl: Option<i64>,
pub collect_logs: bool,
pub created_at: String,
pub dlp: Option<serde_json::Value>,
pub id: String,
pub is_default: Option<bool>,
pub log_management: Option<i64>,
pub log_management_strategy: Option<String>,
pub logpush: Option<bool>,
pub logpush_public_key: Option<String>,
pub modified_at: String,
pub otel: Option<Vec<AigConfigUpdateGatewayResponseResultOtelItem>>,
pub rate_limiting_interval: Option<i64>,
pub rate_limiting_limit: Option<i64>,
pub rate_limiting_technique: Option<String>,
pub retry_backoff: Option<String>,
pub retry_delay: Option<i64>,
pub retry_max_attempts: Option<i64>,
pub store_id: Option<String>,
pub stripe: Option<AigConfigUpdateGatewayResponseResultStripe>,
pub workers_ai_billing_mode: Option<String>,
pub zdr: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayResponseResultOtelItem {
pub authorization: String,
pub content_type: Option<String>,
pub headers: serde_json::Value,
pub url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayResponseResultStripe {
pub authorization: String,
pub usage_events: Vec<AigConfigUpdateGatewayResponseResultStripeUsageEventsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateGatewayResponseResultStripeUsageEventsItem {
pub payload: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateProvidersRequest {
pub secret: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateProvidersResponse {
pub result: AigConfigUpdateProvidersResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AigConfigUpdateProvidersResponseResult {
pub alias: String,
pub default_config: bool,
pub gateway_id: String,
pub id: String,
pub modified_at: String,
pub provider_slug: String,
pub rate_limit: Option<f64>,
pub rate_limit_period: Option<f64>,
pub secret_id: String,
pub secret_preview: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigAiSearchRequest {
pub filters: Option<serde_json::Value>,
pub max_num_results: Option<i64>,
pub model: Option<serde_json::Value>,
pub query: String,
pub ranking_options: Option<AutoragConfigAiSearchRequestRankingOptions>,
pub reranking: Option<AutoragConfigAiSearchRequestReranking>,
pub rewrite_query: Option<bool>,
pub stream: Option<bool>,
pub system_prompt: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigAiSearchRequestRankingOptions {
pub ranker: Option<String>,
pub score_threshold: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigAiSearchRequestReranking {
pub enabled: Option<bool>,
pub model: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigAiSearchResponse {
pub result: AutoragConfigAiSearchResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigAiSearchResponseResult {
pub data: Option<Vec<AutoragConfigAiSearchResponseResultDataItem>>,
pub has_more: Option<bool>,
pub next_page: Option<String>,
pub object: Option<String>,
pub response: String,
pub search_query: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigAiSearchResponseResultDataItem {
pub attributes: Option<serde_json::Value>,
pub content: Option<Vec<AutoragConfigAiSearchResponseResultDataItemContentItem>>,
pub file_id: Option<String>,
pub filename: Option<String>,
pub score: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigAiSearchResponseResultDataItemContentItem {
pub text: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigFilesResponse {
pub result: Vec<AutoragConfigFilesResponseResultItem>,
pub result_info: AutoragConfigFilesResponseResultInfo,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigFilesResponseResultInfo {
pub count: i64,
pub page: i64,
pub per_page: Option<i64>,
pub total_count: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigFilesResponseResultItem {
pub error: String,
pub key: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigGetJobResponse {
pub result: AutoragConfigGetJobResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigGetJobResponseResult {
pub end_reason: Option<String>,
pub ended_at: Option<String>,
pub id: String,
pub last_seen_at: Option<String>,
pub source: String,
pub started_at: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigListJobLogsResponse {
pub result: Vec<AutoragConfigListJobLogsResponseResultItem>,
pub result_info: AutoragConfigListJobLogsResponseResultInfo,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigListJobLogsResponseResultInfo {
pub count: i64,
pub page: i64,
pub per_page: i64,
pub total_count: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigListJobLogsResponseResultItem {
pub created_at: f64,
pub id: i64,
pub message: String,
pub message_type: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigListJobsResponse {
pub result: Vec<AutoragConfigListJobsResponseResultItem>,
pub result_info: AutoragConfigListJobsResponseResultInfo,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigListJobsResponseResultInfo {
pub count: i64,
pub page: i64,
pub per_page: i64,
pub total_count: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigListJobsResponseResultItem {
pub end_reason: Option<String>,
pub ended_at: Option<String>,
pub id: String,
pub last_seen_at: Option<String>,
pub source: String,
pub started_at: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigSearchRequest {
pub filters: Option<serde_json::Value>,
pub max_num_results: Option<i64>,
pub query: String,
pub ranking_options: Option<AutoragConfigSearchRequestRankingOptions>,
pub reranking: Option<AutoragConfigSearchRequestReranking>,
pub rewrite_query: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigSearchRequestRankingOptions {
pub ranker: Option<String>,
pub score_threshold: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigSearchRequestReranking {
pub enabled: Option<bool>,
pub model: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigSearchResponse {
pub result: AutoragConfigSearchResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigSearchResponseResult {
pub data: Option<Vec<AutoragConfigSearchResponseResultDataItem>>,
pub has_more: Option<bool>,
pub next_page: Option<String>,
pub object: Option<String>,
pub search_query: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigSearchResponseResultDataItem {
pub attributes: Option<serde_json::Value>,
pub content: Option<Vec<AutoragConfigSearchResponseResultDataItemContentItem>>,
pub file_id: Option<String>,
pub filename: Option<String>,
pub score: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigSearchResponseResultDataItemContentItem {
pub text: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigSyncResponse {
pub result: AutoragConfigSyncResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct AutoragConfigSyncResponseResult {
pub job_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsSummaryResponse {
pub result: RadarGetAiBotsSummaryResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsSummaryResponseResult {
pub meta: RadarGetAiBotsSummaryResponseResultMeta,
pub summary_0: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsSummaryResponseResultMeta {
#[serde(rename = "confidenceInfo")]
pub confidence_info: RadarGetAiBotsSummaryResponseResultMetaConfidenceInfo,
#[serde(rename = "dateRange")]
pub date_range: Vec<RadarGetAiBotsSummaryResponseResultMetaDateRangeItem>,
#[serde(rename = "lastUpdated")]
pub last_updated: String,
pub normalization: String,
pub units: Vec<RadarGetAiBotsSummaryResponseResultMetaUnitsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsSummaryResponseResultMetaConfidenceInfo {
pub annotations: Vec<RadarGetAiBotsSummaryResponseResultMetaConfidenceInfoAnnotationsItem>,
pub level: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsSummaryResponseResultMetaConfidenceInfoAnnotationsItem {
#[serde(rename = "dataSource")]
pub data_source: String,
pub description: String,
#[serde(rename = "endDate")]
pub end_date: String,
#[serde(rename = "eventType")]
pub event_type: String,
#[serde(rename = "isInstantaneous")]
pub is_instantaneous: bool,
#[serde(rename = "linkedUrl")]
pub linked_url: String,
#[serde(rename = "startDate")]
pub start_date: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsSummaryResponseResultMetaDateRangeItem {
#[serde(rename = "endTime")]
pub end_time: String,
#[serde(rename = "startTime")]
pub start_time: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsSummaryResponseResultMetaUnitsItem {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesGroupResponse {
pub result: RadarGetAiBotsTimeseriesGroupResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesGroupResponseResult {
pub meta: RadarGetAiBotsTimeseriesGroupResponseResultMeta,
pub serie_0: RadarGetAiBotsTimeseriesGroupResponseResultSerie0,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesGroupResponseResultMeta {
#[serde(rename = "aggInterval")]
pub agg_interval: String,
#[serde(rename = "confidenceInfo")]
pub confidence_info: RadarGetAiBotsTimeseriesGroupResponseResultMetaConfidenceInfo,
#[serde(rename = "dateRange")]
pub date_range: Vec<RadarGetAiBotsTimeseriesGroupResponseResultMetaDateRangeItem>,
#[serde(rename = "lastUpdated")]
pub last_updated: String,
pub normalization: String,
pub units: Vec<RadarGetAiBotsTimeseriesGroupResponseResultMetaUnitsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesGroupResponseResultMetaConfidenceInfo {
pub annotations: Vec<RadarGetAiBotsTimeseriesGroupResponseResultMetaConfidenceInfoAnnotationsItem>,
pub level: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesGroupResponseResultMetaConfidenceInfoAnnotationsItem {
#[serde(rename = "dataSource")]
pub data_source: String,
pub description: String,
#[serde(rename = "endDate")]
pub end_date: String,
#[serde(rename = "eventType")]
pub event_type: String,
#[serde(rename = "isInstantaneous")]
pub is_instantaneous: bool,
#[serde(rename = "linkedUrl")]
pub linked_url: String,
#[serde(rename = "startDate")]
pub start_date: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesGroupResponseResultMetaDateRangeItem {
#[serde(rename = "endTime")]
pub end_time: String,
#[serde(rename = "startTime")]
pub start_time: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesGroupResponseResultMetaUnitsItem {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesGroupResponseResultSerie0 {
pub timestamps: Vec<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesResponse {
pub result: RadarGetAiBotsTimeseriesResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesResponseResult {
pub meta: RadarGetAiBotsTimeseriesResponseResultMeta,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesResponseResultMeta {
#[serde(rename = "aggInterval")]
pub agg_interval: String,
#[serde(rename = "confidenceInfo")]
pub confidence_info: RadarGetAiBotsTimeseriesResponseResultMetaConfidenceInfo,
#[serde(rename = "dateRange")]
pub date_range: Vec<RadarGetAiBotsTimeseriesResponseResultMetaDateRangeItem>,
#[serde(rename = "lastUpdated")]
pub last_updated: String,
pub normalization: String,
pub units: Vec<RadarGetAiBotsTimeseriesResponseResultMetaUnitsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesResponseResultMetaConfidenceInfo {
pub annotations: Vec<RadarGetAiBotsTimeseriesResponseResultMetaConfidenceInfoAnnotationsItem>,
pub level: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesResponseResultMetaConfidenceInfoAnnotationsItem {
#[serde(rename = "dataSource")]
pub data_source: String,
pub description: String,
#[serde(rename = "endDate")]
pub end_date: String,
#[serde(rename = "eventType")]
pub event_type: String,
#[serde(rename = "isInstantaneous")]
pub is_instantaneous: bool,
#[serde(rename = "linkedUrl")]
pub linked_url: String,
#[serde(rename = "startDate")]
pub start_date: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesResponseResultMetaDateRangeItem {
#[serde(rename = "endTime")]
pub end_time: String,
#[serde(rename = "startTime")]
pub start_time: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesResponseResultMetaUnitsItem {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceSummaryResponse {
pub result: RadarGetAiInferenceSummaryResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceSummaryResponseResult {
pub meta: RadarGetAiInferenceSummaryResponseResultMeta,
pub summary_0: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceSummaryResponseResultMeta {
#[serde(rename = "confidenceInfo")]
pub confidence_info: RadarGetAiInferenceSummaryResponseResultMetaConfidenceInfo,
#[serde(rename = "dateRange")]
pub date_range: Vec<RadarGetAiInferenceSummaryResponseResultMetaDateRangeItem>,
#[serde(rename = "lastUpdated")]
pub last_updated: String,
pub normalization: String,
pub units: Vec<RadarGetAiInferenceSummaryResponseResultMetaUnitsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceSummaryResponseResultMetaConfidenceInfo {
pub annotations: Vec<RadarGetAiInferenceSummaryResponseResultMetaConfidenceInfoAnnotationsItem>,
pub level: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceSummaryResponseResultMetaConfidenceInfoAnnotationsItem {
#[serde(rename = "dataSource")]
pub data_source: String,
pub description: String,
#[serde(rename = "endDate")]
pub end_date: String,
#[serde(rename = "eventType")]
pub event_type: String,
#[serde(rename = "isInstantaneous")]
pub is_instantaneous: bool,
#[serde(rename = "linkedUrl")]
pub linked_url: String,
#[serde(rename = "startDate")]
pub start_date: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceSummaryResponseResultMetaDateRangeItem {
#[serde(rename = "endTime")]
pub end_time: String,
#[serde(rename = "startTime")]
pub start_time: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceSummaryResponseResultMetaUnitsItem {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceTimeseriesGroupResponse {
pub result: RadarGetAiInferenceTimeseriesGroupResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceTimeseriesGroupResponseResult {
pub meta: RadarGetAiInferenceTimeseriesGroupResponseResultMeta,
pub serie_0: RadarGetAiInferenceTimeseriesGroupResponseResultSerie0,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceTimeseriesGroupResponseResultMeta {
#[serde(rename = "aggInterval")]
pub agg_interval: String,
#[serde(rename = "confidenceInfo")]
pub confidence_info: RadarGetAiInferenceTimeseriesGroupResponseResultMetaConfidenceInfo,
#[serde(rename = "dateRange")]
pub date_range: Vec<RadarGetAiInferenceTimeseriesGroupResponseResultMetaDateRangeItem>,
#[serde(rename = "lastUpdated")]
pub last_updated: String,
pub normalization: String,
pub units: Vec<RadarGetAiInferenceTimeseriesGroupResponseResultMetaUnitsItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceTimeseriesGroupResponseResultMetaConfidenceInfo {
pub annotations: Vec<RadarGetAiInferenceTimeseriesGroupResponseResultMetaConfidenceInfoAnnotationsItem>,
pub level: i64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceTimeseriesGroupResponseResultMetaConfidenceInfoAnnotationsItem {
#[serde(rename = "dataSource")]
pub data_source: String,
pub description: String,
#[serde(rename = "endDate")]
pub end_date: String,
#[serde(rename = "eventType")]
pub event_type: String,
#[serde(rename = "isInstantaneous")]
pub is_instantaneous: bool,
#[serde(rename = "linkedUrl")]
pub linked_url: String,
#[serde(rename = "startDate")]
pub start_date: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceTimeseriesGroupResponseResultMetaDateRangeItem {
#[serde(rename = "endTime")]
pub end_time: String,
#[serde(rename = "startTime")]
pub start_time: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceTimeseriesGroupResponseResultMetaUnitsItem {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RadarGetAiInferenceTimeseriesGroupResponseResultSerie0 {
pub timestamps: Vec<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RealtimekitChatMessage {
pub chat_download_url: String,
pub chat_download_url_expiry: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct RealtimekitGetSessionChatResponse {
pub data: Option<RealtimekitChatMessage>,
pub success: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeApiResponseCommon {
pub errors: Vec<std::collections::HashMap<String, serde_json::Value>>,
pub messages: Vec<std::collections::HashMap<String, serde_json::Value>>,
pub result: serde_json::Value,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeApiResponseSingle {
pub result: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeCreateIndexRequest {
pub config: serde_json::Value,
pub description: Option<VectorizeIndexDescription>,
pub name: VectorizeIndexName,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeCreateIndexResponse {
pub config: Option<VectorizeIndexDimensionConfiguration>,
pub created_on: Option<String>,
pub description: Option<VectorizeIndexDescription>,
pub modified_on: Option<String>,
pub name: Option<VectorizeIndexName>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeCreateMetadataIndexRequest {
#[serde(rename = "indexType")]
pub index_type: String,
#[serde(rename = "propertyName")]
pub property_name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeCreateMetadataIndexResponse {
#[serde(rename = "mutationId")]
pub mutation_id: Option<VectorizeMutationUuid>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeCreateMetadataIndexResponse2 {
pub result: Option<VectorizeCreateMetadataIndexResponse>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeCreateVectorizeIndexResponse {
pub result: Option<VectorizeCreateIndexResponse>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeDeleteMetadataIndexRequest {
#[serde(rename = "propertyName")]
pub property_name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeDeleteMetadataIndexResponse {
#[serde(rename = "mutationId")]
pub mutation_id: Option<VectorizeMutationUuid>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeDeleteMetadataIndexResponse2 {
pub result: Option<VectorizeDeleteMetadataIndexResponse>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeDeleteVectorizeIndexResponse {
pub result: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeDeleteVectorsByIdResponse {
pub result: Option<VectorizeIndexDeleteVectorsByIdV2Response>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeGetVectorizeIndexResponse {
pub result: Option<VectorizeCreateIndexResponse>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeGetVectorsByIdResponse {
pub result: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexDeleteVectorsByIdRequest {
pub ids: Option<Vec<VectorizeVectorIdentifier>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexDeleteVectorsByIdV2Response {
#[serde(rename = "mutationId")]
pub mutation_id: Option<VectorizeMutationUuid>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexDescription {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexDimensionConfiguration {
pub dimensions: VectorizeIndexDimensions,
pub metric: VectorizeIndexMetric,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexDimensions {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexGetVectorsByIdRequest {
pub ids: Option<Vec<VectorizeVectorIdentifier>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexGetVectorsByIdResponse {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexInfoResponse {
pub dimensions: Option<VectorizeIndexDimensions>,
#[serde(rename = "processedUpToDatetime")]
pub processed_up_to_datetime: Option<String>,
#[serde(rename = "processedUpToMutation")]
pub processed_up_to_mutation: Option<VectorizeMutationUuid>,
#[serde(rename = "vectorCount")]
pub vector_count: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexInfoResponse2 {
pub result: Option<VectorizeIndexInfoResponse>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexInsertV2Response {
#[serde(rename = "mutationId")]
pub mutation_id: Option<VectorizeMutationUuid>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexListVectorsResponse {
pub count: i64,
#[serde(rename = "cursorExpirationTimestamp")]
pub cursor_expiration_timestamp: Option<String>,
#[serde(rename = "isTruncated")]
pub is_truncated: bool,
#[serde(rename = "nextCursor")]
pub next_cursor: Option<String>,
#[serde(rename = "totalCount")]
pub total_count: i64,
pub vectors: Vec<VectorizeVectorListItem>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexMetric {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexName {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexQueryV2Request {
pub filter: Option<serde_json::Value>,
#[serde(rename = "returnMetadata")]
pub return_metadata: Option<String>,
#[serde(rename = "returnValues")]
pub return_values: Option<bool>,
#[serde(rename = "topK")]
pub top_k: Option<f64>,
pub vector: Vec<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexQueryV2Response {
pub count: Option<i64>,
pub matches: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeIndexUpsertV2Response {
#[serde(rename = "mutationId")]
pub mutation_id: Option<VectorizeMutationUuid>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeInsertVectorResponse {
pub result: Option<VectorizeIndexInsertV2Response>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeListMetadataIndexResponse {
#[serde(rename = "metadataIndexes")]
pub metadata_indexes: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeListMetadataIndexesResponse {
pub result: Option<VectorizeListMetadataIndexResponse>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeListVectorizeIndexesResponse {
pub result: Option<Vec<VectorizeCreateIndexResponse>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeListVectorsResponse {
pub result: Option<VectorizeIndexListVectorsResponse>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeMessages {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeMutationUuid {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeQueryVectorResponse {
pub result: Option<VectorizeIndexQueryV2Response>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeUpsertVectorResponse {
pub result: Option<VectorizeIndexUpsertV2Response>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeVectorIdentifier {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct VectorizeVectorListItem {
pub id: VectorizeVectorIdentifier,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiCreateFinetuneRequest {
pub description: Option<String>,
pub model: String,
pub name: String,
pub public: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiCreateFinetuneResponse {
pub result: WorkersAiCreateFinetuneResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiCreateFinetuneResponseResult {
pub created_at: String,
pub description: Option<String>,
pub id: String,
pub model: String,
pub modified_at: String,
pub name: String,
pub public: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiGetModelSchemaResponse {
pub result: WorkersAiGetModelSchemaResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiGetModelSchemaResponseResult {
pub input: WorkersAiGetModelSchemaResponseResultInput,
pub output: WorkersAiGetModelSchemaResponseResultOutput,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiGetModelSchemaResponseResultInput {
#[serde(rename = "additionalProperties")]
pub additional_properties: bool,
pub description: String,
#[serde(rename = "type")]
pub r#type: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiGetModelSchemaResponseResultOutput {
#[serde(rename = "additionalProperties")]
pub additional_properties: bool,
pub description: String,
#[serde(rename = "type")]
pub r#type: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiGetToMarkdownSupportedResponse {
pub result: Vec<WorkersAiGetToMarkdownSupportedResponseResultItem>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiGetToMarkdownSupportedResponseResultItem {
pub extension: String,
#[serde(rename = "mimeType")]
pub mime_type: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiListFinetunesResponse {
pub result: WorkersAiListFinetunesResponseResult,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiListFinetunesResponseResult {
pub created_at: String,
pub description: Option<String>,
pub id: String,
pub model: String,
pub modified_at: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiListPublicFinetunesResponse {
pub result: Vec<WorkersAiListPublicFinetunesResponseResultItem>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiListPublicFinetunesResponseResultItem {
pub created_at: String,
pub description: Option<String>,
pub id: String,
pub model: String,
pub modified_at: String,
pub name: String,
pub public: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfAi4bharatIndictrans2EnIndic1BRequest {
pub target_language: String,
pub text: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfAi4bharatNonomniIndictrans2EnIndic1bRequest {
pub target_language: String,
pub text: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfAisingaporeGemmaSeaLionV427bItRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiBgeBaseEnV15Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiBgeLargeEnV15Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiBgeM3Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiBgeRerankerBaseRequest {
pub contexts: Vec<WorkersAiPostRunCfBaaiBgeRerankerBaseRequestContextsItem>,
pub query: String,
pub top_k: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiBgeRerankerBaseRequestContextsItem {
pub text: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiBgeSmallEnV15Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiNonomniBgeBaseEnV15Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiNonomniBgeLargeEnV15Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiNonomniBgeM3Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiNonomniBgeSmallEnV15Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBlackForestLabsFlux1SchnellRequest {
pub prompt: String,
pub steps: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBlackForestLabsFlux2DevRequest {
pub multipart: WorkersAiPostRunCfBlackForestLabsFlux2DevRequestMultipart,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBlackForestLabsFlux2DevRequestMultipart {
pub body: Option<serde_json::Value>,
#[serde(rename = "contentType")]
pub content_type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBlackForestLabsFlux2Klein4BRequestMultipart {
pub body: Option<serde_json::Value>,
#[serde(rename = "contentType")]
pub content_type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBlackForestLabsFlux2Klein4bRequest {
pub multipart: WorkersAiPostRunCfBlackForestLabsFlux2Klein4BRequestMultipart,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBlackForestLabsFlux2Klein9BRequestMultipart {
pub body: Option<serde_json::Value>,
#[serde(rename = "contentType")]
pub content_type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBlackForestLabsFlux2Klein9bRequest {
pub multipart: WorkersAiPostRunCfBlackForestLabsFlux2Klein9BRequestMultipart,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfBytedanceStableDiffusionXlLightningRequest {
pub guidance: Option<f64>,
pub height: Option<i64>,
pub image: Option<Vec<f64>>,
pub image_b64: Option<String>,
pub mask: Option<Vec<f64>>,
pub negative_prompt: Option<String>,
pub num_steps: Option<i64>,
pub prompt: String,
pub seed: Option<i64>,
pub strength: Option<f64>,
pub width: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepgramAura1Request {
pub bit_rate: Option<f64>,
pub container: Option<String>,
pub encoding: Option<String>,
pub sample_rate: Option<f64>,
pub speaker: Option<String>,
pub text: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepgramAura2EnRequest {
pub bit_rate: Option<f64>,
pub container: Option<String>,
pub encoding: Option<String>,
pub sample_rate: Option<f64>,
pub speaker: Option<String>,
pub text: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepgramAura2EsRequest {
pub bit_rate: Option<f64>,
pub container: Option<String>,
pub encoding: Option<String>,
pub sample_rate: Option<f64>,
pub speaker: Option<String>,
pub text: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepgramFluxRequest {
pub eager_eot_threshold: Option<String>,
pub encoding: String,
pub eot_threshold: Option<String>,
pub eot_timeout_ms: Option<String>,
pub keyterm: Option<String>,
pub mip_opt_out: Option<String>,
pub sample_rate: String,
pub tag: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepgramNova3Request {
pub audio: WorkersAiPostRunCfDeepgramNova3RequestAudio,
pub channels: Option<f64>,
pub custom_intent: Option<String>,
pub custom_intent_mode: Option<String>,
pub custom_topic: Option<String>,
pub custom_topic_mode: Option<String>,
pub detect_entities: Option<bool>,
pub detect_language: Option<bool>,
pub diarize: Option<bool>,
pub dictation: Option<bool>,
pub encoding: Option<String>,
pub endpointing: Option<String>,
pub extra: Option<String>,
pub filler_words: Option<bool>,
pub interim_results: Option<bool>,
pub keyterm: Option<String>,
pub keywords: Option<String>,
pub language: Option<String>,
pub measurements: Option<bool>,
pub mip_opt_out: Option<bool>,
pub mode: Option<String>,
pub multichannel: Option<bool>,
pub numerals: Option<bool>,
pub paragraphs: Option<bool>,
pub profanity_filter: Option<bool>,
pub punctuate: Option<bool>,
pub redact: Option<String>,
pub replace: Option<String>,
pub search: Option<String>,
pub sentiment: Option<bool>,
pub smart_format: Option<bool>,
pub topics: Option<bool>,
pub utt_split: Option<f64>,
pub utterance_end_ms: Option<bool>,
pub utterances: Option<bool>,
pub vad_events: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepgramNova3RequestAudio {
pub body: serde_json::Value,
#[serde(rename = "contentType")]
pub content_type: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepseekAiDeepseekMath7bInstructRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepseekAiDeepseekR1DistillQwen32bRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfDefogSqlcoder7b2Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfFacebookBartLargeCnnRequest {
pub input_text: String,
pub max_length: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfFacebookNonomniBartLargeCnnRequest {
pub input_text: String,
pub max_length: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfFblgitUnaCybertron7bV2Bf16Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfGoogleEmbeddinggemma300mRequest {
pub text: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfGoogleGemma2bItLoraRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfGoogleGemma312bItRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfGoogleGemma7bItLoraRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfGoogleNonomniEmbeddinggemma300mRequest {
pub text: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfHuggingfaceDistilbertSst2Int8Request {
pub text: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfHuggingfaceNonomniDistilbertSst2Int8Request {
pub text: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfIbmGraniteGranite40HMicroRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfLeonardoLucidOriginRequest {
pub guidance: Option<f64>,
pub height: Option<i64>,
pub num_steps: Option<i64>,
pub prompt: String,
pub seed: Option<i64>,
pub steps: Option<i64>,
pub width: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfLeonardoPhoenix10Request {
pub guidance: Option<f64>,
pub height: Option<i64>,
pub negative_prompt: Option<String>,
pub num_steps: Option<i64>,
pub prompt: String,
pub seed: Option<i64>,
pub width: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfLykonDreamshaper8LcmRequest {
pub guidance: Option<f64>,
pub height: Option<i64>,
pub image: Option<Vec<f64>>,
pub image_b64: Option<String>,
pub mask: Option<Vec<f64>>,
pub negative_prompt: Option<String>,
pub num_steps: Option<i64>,
pub prompt: String,
pub seed: Option<i64>,
pub strength: Option<f64>,
pub width: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama27bChatFp16Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama27bChatInt8Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama3170bInstructFp8FastRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama318bInstructAwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama318bInstructFp8FastRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama318bInstructFp8Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama3211bVisionInstructRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama321bInstructRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama323bInstructRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama3370bInstructFp8FastRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama38bInstructAwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama38bInstructRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama4Scout17b16eInstructRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlamaGuard38BRequestMessagesItem {
pub content: String,
pub role: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlamaGuard38BRequestResponseFormat {
#[serde(rename = "type")]
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlamaGuard38bRequest {
pub max_tokens: Option<i64>,
pub messages: Vec<WorkersAiPostRunCfMetaLlamaGuard38BRequestMessagesItem>,
pub response_format: Option<WorkersAiPostRunCfMetaLlamaGuard38BRequestResponseFormat>,
pub temperature: Option<f64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlamaLlama27bChatHfLoraRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaM2m10012bRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMicrosoftPhi2Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMistralMistral7bInstructV01Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMistralMistral7bInstructV02LoraRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMistralaiMistralSmall3124bInstructRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMoonshotaiKimiK25Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfMyshellAiMelottsRequest {
pub lang: Option<String>,
pub prompt: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfNvidiaNemotron3120bA12bRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfOpenaiGptOss120bRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfOpenaiGptOss20bRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfOpenaiWhisperLargeV3TurboRequest {
pub audio: serde_json::Value,
pub beam_size: Option<i64>,
pub compression_ratio_threshold: Option<f64>,
pub condition_on_previous_text: Option<bool>,
pub hallucination_silence_threshold: Option<f64>,
pub initial_prompt: Option<String>,
pub language: Option<String>,
pub log_prob_threshold: Option<f64>,
pub no_speech_threshold: Option<f64>,
pub prefix: Option<String>,
pub task: Option<String>,
pub vad_filter: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfOpenchatOpenchat350106Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfPfnetPlamoEmbedding1bRequest {
pub text: serde_json::Value,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen1505bChatRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen1514bChatAwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen1518bChatRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen157bChatAwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen25Coder32bInstructRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen330bA3bFp8Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen3Embedding06bRequest {
pub documents: Option<serde_json::Value>,
pub instruction: Option<String>,
pub queries: Option<serde_json::Value>,
pub text: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwq32bRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfRunwaymlStableDiffusionV15Img2imgRequest {
pub guidance: Option<f64>,
pub height: Option<i64>,
pub image: Option<Vec<f64>>,
pub image_b64: Option<String>,
pub mask: Option<Vec<f64>>,
pub negative_prompt: Option<String>,
pub num_steps: Option<i64>,
pub prompt: String,
pub seed: Option<i64>,
pub strength: Option<f64>,
pub width: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfRunwaymlStableDiffusionV15InpaintingRequest {
pub guidance: Option<f64>,
pub height: Option<i64>,
pub image: Option<Vec<f64>>,
pub image_b64: Option<String>,
pub mask: Option<Vec<f64>>,
pub negative_prompt: Option<String>,
pub num_steps: Option<i64>,
pub prompt: String,
pub seed: Option<i64>,
pub strength: Option<f64>,
pub width: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfStabilityaiStableDiffusionXlBase10Request {
pub guidance: Option<f64>,
pub height: Option<i64>,
pub image: Option<Vec<f64>>,
pub image_b64: Option<String>,
pub mask: Option<Vec<f64>>,
pub negative_prompt: Option<String>,
pub num_steps: Option<i64>,
pub prompt: String,
pub seed: Option<i64>,
pub strength: Option<f64>,
pub width: Option<i64>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfTheblokeDiscolmGerman7bV1AwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfTiiuaeFalcon7bInstructRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfTinyllamaTinyllama11bChatV10Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunCfZaiOrgGlm47FlashRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunHfGoogleGemma7bItRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunHfMistralMistral7bInstructV02Request {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunHfNexusflowStarlingLm7bBetaRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunHfNousresearchHermes2ProMistral7bRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeDeepseekCoder67bBaseAwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeDeepseekCoder67bInstructAwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeLlama213bChatAwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeMistral7bInstructV01AwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeNeuralChat7bV31AwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeOpenhermes25Mistral7bAwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeZephyr7bBetaAwqRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunModelRequest {
#[serde(flatten)]
pub data: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostRunModelResponse {
pub result: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostToMarkdownResponse {
pub result: Vec<WorkersAiPostToMarkdownResponseResultItem>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiPostToMarkdownResponseResultItem {
pub data: String,
pub format: String,
#[serde(rename = "mimeType")]
pub mime_type: String,
pub name: String,
pub tokens: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiSearchAuthorResponse {
pub errors: Vec<serde_json::Value>,
pub messages: Vec<String>,
pub result: Vec<serde_json::Value>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiSearchModelResponse {
pub errors: Vec<serde_json::Value>,
pub messages: Vec<String>,
pub result: Vec<serde_json::Value>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiSearchTaskResponse {
pub errors: Vec<serde_json::Value>,
pub messages: Vec<String>,
pub result: Vec<serde_json::Value>,
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonHash)]
pub struct WorkersAiUploadFinetuneAssetResponse {
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigListEvaluatorsArgs {
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
pub order_by: Option<String>,
pub order_by_direction: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigListGatewayArgs {
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
pub search: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigCreateGatewayArgs {
pub account_id: String,
pub body: AigConfigCreateGatewayRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigListDatasetArgs {
pub account_id: String,
pub gateway_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
pub name: Option<String>,
pub enable: Option<String>,
pub search: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigCreateDatasetArgs {
pub gateway_id: String,
pub account_id: String,
pub body: AigConfigCreateDatasetRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigFetchDatasetArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigUpdateDatasetArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
pub body: AigConfigUpdateDatasetRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigDeleteDatasetArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigListEvaluationsArgs {
pub account_id: String,
pub gateway_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
pub name: Option<String>,
pub processed: Option<String>,
pub search: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigCreateEvaluationsArgs {
pub gateway_id: String,
pub account_id: String,
pub body: AigConfigCreateEvaluationsRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigFetchEvaluationsArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigDeleteEvaluationsArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigListGatewayLogsArgs {
pub account_id: String,
pub gateway_id: String,
pub search: Option<String>,
pub page: Option<String>,
pub per_page: Option<String>,
pub order_by: Option<String>,
pub order_by_direction: Option<String>,
pub filters: Option<String>,
pub meta_info: Option<String>,
pub direction: Option<String>,
pub start_date: Option<String>,
pub end_date: Option<String>,
pub min_cost: Option<String>,
pub max_cost: Option<String>,
pub min_tokens_in: Option<String>,
pub max_tokens_in: Option<String>,
pub min_tokens_out: Option<String>,
pub max_tokens_out: Option<String>,
pub min_total_tokens: Option<String>,
pub max_total_tokens: Option<String>,
pub min_duration: Option<String>,
pub max_duration: Option<String>,
pub feedback: Option<String>,
pub success: Option<String>,
pub cached: Option<String>,
pub model: Option<String>,
pub model_type: Option<String>,
pub provider: Option<String>,
pub request_content_type: Option<String>,
pub response_content_type: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigDeleteGatewayLogsArgs {
pub account_id: String,
pub gateway_id: String,
pub order_by: Option<String>,
pub order_by_direction: Option<String>,
pub filters: Option<String>,
pub limit: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigGetGatewayLogDetailArgs {
pub id: String,
pub gateway_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigPatchGatewayLogArgs {
pub id: String,
pub gateway_id: String,
pub account_id: String,
pub body: AigConfigPatchGatewayLogRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigGetGatewayLogRequestArgs {
pub id: String,
pub gateway_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigGetGatewayLogResponseArgs {
pub id: String,
pub gateway_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigListProvidersArgs {
pub account_id: String,
pub gateway_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigCreateProvidersArgs {
pub account_id: String,
pub gateway_id: String,
pub body: AigConfigCreateProvidersRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigUpdateProvidersArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
pub body: AigConfigUpdateProvidersRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigDeleteProvidersArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRoutesArgs {
pub account_id: String,
pub gateway_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteArgs {
pub account_id: String,
pub gateway_id: String,
pub body: AigConfigPostGatewayDynamicRouteRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigGetGatewayDynamicRouteArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigUpdateGatewayDynamicRouteArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
pub body: AigConfigUpdateGatewayDynamicRouteRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigDeleteGatewayDynamicRouteArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRouteDeploymentsArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteDeploymentArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
pub body: AigConfigPostGatewayDynamicRouteDeploymentRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigListGatewayDynamicRouteVersionsArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigPostGatewayDynamicRouteVersionArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
pub body: AigConfigPostGatewayDynamicRouteVersionRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigGetGatewayDynamicRouteVersionArgs {
pub account_id: String,
pub gateway_id: String,
pub id: String,
pub version_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigGetGatewayUrlArgs {
pub gateway_id: String,
pub account_id: String,
pub provider: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigFetchGatewayArgs {
pub account_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigUpdateGatewayArgs {
pub account_id: String,
pub id: String,
pub body: AigConfigUpdateGatewayRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AigConfigDeleteGatewayArgs {
pub account_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchListInstancesArgs {
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
pub namespace: Option<String>,
pub search: Option<String>,
pub order_by: Option<String>,
pub order_by_direction: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchCreateInstancesArgs {
pub account_id: String,
pub body: AiSearchCreateInstancesRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchFetchInstancesArgs {
pub id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchUpdateInstancesArgs {
pub account_id: String,
pub id: String,
pub body: AiSearchUpdateInstancesRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchDeleteInstancesArgs {
pub id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchInstanceChatCompletionArgs {
pub id: String,
pub account_id: String,
pub body: AiSearchInstanceChatCompletionRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchInstanceListJobsArgs {
pub id: String,
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchInstanceCreateJobArgs {
pub id: String,
pub account_id: String,
pub body: AiSearchInstanceCreateJobRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchInstanceGetJobArgs {
pub id: String,
pub job_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchInstanceChangeJobStatusArgs {
pub id: String,
pub job_id: String,
pub account_id: String,
pub body: AiSearchInstanceChangeJobStatusRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchInstanceListJobLogsArgs {
pub id: String,
pub job_id: String,
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchInstanceSearchArgs {
pub id: String,
pub account_id: String,
pub body: AiSearchInstanceSearchRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchStatsArgs {
pub id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchListTokensArgs {
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
pub order_by: Option<String>,
pub order_by_direction: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchCreateTokensArgs {
pub account_id: String,
pub body: AiSearchCreateTokensRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchFetchTokensArgs {
pub account_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchUpdateTokensArgs {
pub account_id: String,
pub id: String,
pub body: AiSearchUpdateTokensRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AiSearchDeleteTokensArgs {
pub account_id: String,
pub id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiSearchAuthorArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiListFinetunesArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiCreateFinetuneArgs {
pub account_id: String,
pub body: WorkersAiCreateFinetuneRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiListPublicFinetunesArgs {
pub account_id: String,
pub limit: Option<String>,
pub offset: Option<String>,
pub order_by: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiUploadFinetuneAssetArgs {
pub account_id: String,
pub finetune_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiGetModelSchemaArgs {
pub account_id: String,
pub model: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiSearchModelArgs {
pub account_id: String,
pub per_page: Option<String>,
pub page: Option<String>,
pub task: Option<String>,
pub author: Option<String>,
pub source: Option<String>,
pub hide_experimental: Option<String>,
pub search: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfAi4BharatIndictrans2EnIndic1BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfAi4bharatIndictrans2EnIndic1BRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfAi4BharatNonomniIndictrans2EnIndic1BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfAi4bharatNonomniIndictrans2EnIndic1bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfAisingaporeGemmaSeaLionV427BItArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfAisingaporeGemmaSeaLionV427bItRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiBgeBaseEnV15Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBaaiBgeBaseEnV15Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiBgeLargeEnV15Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBaaiBgeLargeEnV15Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiBgeM3Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBaaiBgeM3Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiBgeRerankerBaseArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBaaiBgeRerankerBaseRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiBgeSmallEnV15Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBaaiBgeSmallEnV15Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiNonomniBgeBaseEnV15Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBaaiNonomniBgeBaseEnV15Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiNonomniBgeLargeEnV15Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBaaiNonomniBgeLargeEnV15Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiNonomniBgeM3Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBaaiNonomniBgeM3Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBaaiNonomniBgeSmallEnV15Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBaaiNonomniBgeSmallEnV15Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBlackForestLabsFlux1SchnellArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBlackForestLabsFlux1SchnellRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBlackForestLabsFlux2DevArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBlackForestLabsFlux2DevRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBlackForestLabsFlux2Klein4BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBlackForestLabsFlux2Klein4bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBlackForestLabsFlux2Klein9BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBlackForestLabsFlux2Klein9bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfBytedanceStableDiffusionXlLightningArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfBytedanceStableDiffusionXlLightningRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfDeepgramAuraArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfDeepgramAura1Args {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepgramAura1Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfDeepgramAura1Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfDeepgramAura1InternalArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfDeepgramAura2Args {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfDeepgramAura2EnArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepgramAura2EnArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfDeepgramAura2EnRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfDeepgramAura2EsArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepgramAura2EsArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfDeepgramAura2EsRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfDeepgramFluxArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepgramFluxArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfDeepgramFluxRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfDeepgramNova3Args {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepgramNova3Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfDeepgramNova3Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfDeepgramNova3InternalArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfDeepgramNova3WsArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepseekAiDeepseekMath7BInstructArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfDeepseekAiDeepseekMath7bInstructRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfDeepseekAiDeepseekR1DistillQwen32BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfDeepseekAiDeepseekR1DistillQwen32bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfDefogSqlcoder7B2Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfDefogSqlcoder7b2Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfFacebookBartLargeCnnArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfFacebookBartLargeCnnRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfFacebookNonomniBartLargeCnnArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfFacebookNonomniBartLargeCnnRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfFacebookNonomniDetrResnet50Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfFblgitUnaCybertron7BV2Bf16Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfFblgitUnaCybertron7bV2Bf16Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfGoogleEmbeddinggemma300MArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfGoogleEmbeddinggemma300mRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfGoogleGemma2BItLoraArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfGoogleGemma2bItLoraRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfGoogleGemma312BItArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfGoogleGemma312bItRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfGoogleGemma7BItLoraArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfGoogleGemma7bItLoraRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfGoogleNonomniEmbeddinggemma300MArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfGoogleNonomniEmbeddinggemma300mRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfHuggingfaceDistilbertSst2Int8Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfHuggingfaceDistilbertSst2Int8Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfHuggingfaceNonomniDistilbertSst2Int8Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfHuggingfaceNonomniDistilbertSst2Int8Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfIbmGraniteGranite40HMicroArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfIbmGraniteGranite40HMicroRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfLeonardoLucidOriginArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfLeonardoLucidOriginRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfLeonardoPhoenix10Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfLeonardoPhoenix10Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfLykonDreamshaper8LcmArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfLykonDreamshaper8LcmRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlamaLlama27BChatHfLoraArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlamaLlama27bChatHfLoraRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama27BChatFp16Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama27bChatFp16Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama27BChatInt8Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama27bChatInt8Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama38BInstructArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama38bInstructRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama38BInstructAwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama38bInstructAwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama3170BInstructFp8FastArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama3170bInstructFp8FastRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama318BInstructAwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama318bInstructAwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama318BInstructFp8Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama318bInstructFp8Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama318BInstructFp8FastArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama318bInstructFp8FastRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama3211BVisionInstructArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama3211bVisionInstructRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama321BInstructArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama321bInstructRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama323BInstructArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama323bInstructRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama3370BInstructFp8FastArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama3370bInstructFp8FastRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlama4Scout17B16EInstructArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlama4Scout17b16eInstructRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaLlamaGuard38BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaLlamaGuard38bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMetaM2M10012BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMetaM2m10012bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMicrosoftNonomniResnet50Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMicrosoftPhi2Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMicrosoftPhi2Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMicrosoftResnet50Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMistralMistral7BInstructV01Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMistralMistral7bInstructV01Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMistralMistral7BInstructV02LoraArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMistralMistral7bInstructV02LoraRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMistralaiMistralSmall3124BInstructArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMistralaiMistralSmall3124bInstructRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMoonshotaiKimiK25Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMoonshotaiKimiK25Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfMyshellAiMelottsArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfMyshellAiMelottsRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfNvidiaNemotron3120BA12BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfNvidiaNemotron3120bA12bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfOpenaiGptOss120BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfOpenaiGptOss120bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfOpenaiGptOss20BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfOpenaiGptOss20bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfOpenaiWhisperArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfOpenaiWhisperLargeV3TurboArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfOpenaiWhisperLargeV3TurboRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfOpenaiWhisperTinyEnArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfOpenchatOpenchat350106Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfOpenchatOpenchat350106Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfPfnetPlamoEmbedding1BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfPfnetPlamoEmbedding1bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfPipecatAiSmartTurnV2Args {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfPipecatAiSmartTurnV3Args {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen1505BChatArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfQwenQwen1505bChatRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen1518BChatArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfQwenQwen1518bChatRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen1514BChatAwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfQwenQwen1514bChatAwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen157BChatAwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfQwenQwen157bChatAwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen25Coder32BInstructArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfQwenQwen25Coder32bInstructRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen330BA3BFp8Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfQwenQwen330bA3bFp8Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwen3Embedding06BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfQwenQwen3Embedding06bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfQwenQwq32BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfQwenQwq32bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfRunwaymlStableDiffusionV15Img2ImgArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfRunwaymlStableDiffusionV15Img2imgRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfRunwaymlStableDiffusionV15InpaintingArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfRunwaymlStableDiffusionV15InpaintingRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfStabilityaiStableDiffusionXlBase10Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfStabilityaiStableDiffusionXlBase10Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfSvenTestPipeHttpArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostWebsocketRunCfTestHelloWorldCogArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfTheblokeDiscolmGerman7BV1AwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfTheblokeDiscolmGerman7bV1AwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfTiiuaeFalcon7BInstructArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfTiiuaeFalcon7bInstructRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfTinyllamaTinyllama11BChatV10Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfTinyllamaTinyllama11bChatV10Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunCfZaiOrgGlm47FlashArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunCfZaiOrgGlm47FlashRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunHfGoogleGemma7BItArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunHfGoogleGemma7bItRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunHfMistralMistral7BInstructV02Args {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunHfMistralMistral7bInstructV02Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunHfNexusflowStarlingLm7BBetaArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunHfNexusflowStarlingLm7bBetaRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunHfNousresearchHermes2ProMistral7BArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunHfNousresearchHermes2ProMistral7bRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeDeepseekCoder67BBaseAwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunHfTheblokeDeepseekCoder67bBaseAwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeDeepseekCoder67BInstructAwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunHfTheblokeDeepseekCoder67bInstructAwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeLlama213BChatAwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunHfTheblokeLlama213bChatAwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeMistral7BInstructV01AwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunHfTheblokeMistral7bInstructV01AwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeNeuralChat7BV31AwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunHfTheblokeNeuralChat7bV31AwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeOpenhermes25Mistral7BAwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunHfTheblokeOpenhermes25Mistral7bAwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunHfTheblokeZephyr7BBetaAwqArgs {
pub account_id: String,
pub queue_request: Option<String>,
pub tags: Option<String>,
pub body: WorkersAiPostRunHfTheblokeZephyr7bBetaAwqRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostRunModelArgs {
pub account_id: String,
pub model_name: String,
pub body: WorkersAiPostRunModelRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiSearchTaskArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiPostToMarkdownArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct WorkersAiGetToMarkdownSupportedArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AutoragConfigAiSearchArgs {
pub id: String,
pub account_id: String,
pub body: AutoragConfigAiSearchRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AutoragConfigFilesArgs {
pub id: String,
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
pub search: Option<String>,
pub status: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AutoragConfigListJobsArgs {
pub id: String,
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AutoragConfigGetJobArgs {
pub id: String,
pub job_id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AutoragConfigListJobLogsArgs {
pub id: String,
pub job_id: String,
pub account_id: String,
pub page: Option<String>,
pub per_page: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AutoragConfigSearchArgs {
pub id: String,
pub account_id: String,
pub body: AutoragConfigSearchRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct AutoragConfigSyncArgs {
pub id: String,
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct GetSessionChatArgs {
pub account_id: String,
pub app_id: String,
pub session_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeListVectorizeIndexesArgs {
pub account_id: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeCreateVectorizeIndexArgs {
pub account_id: String,
pub body: VectorizeCreateIndexRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeGetVectorizeIndexArgs {
pub account_id: String,
pub index_name: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeDeleteVectorizeIndexArgs {
pub account_id: String,
pub index_name: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeDeleteVectorsByIdArgs {
pub account_id: String,
pub index_name: String,
pub body: VectorizeIndexDeleteVectorsByIdRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeGetVectorsByIdArgs {
pub account_id: String,
pub index_name: String,
pub body: VectorizeIndexGetVectorsByIdRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeIndexInfoArgs {
pub account_id: String,
pub index_name: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeInsertVectorArgs {
pub account_id: String,
pub index_name: String,
pub unparsable_behavior: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeListVectorsArgs {
pub account_id: String,
pub index_name: String,
pub count: Option<String>,
pub cursor: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeCreateMetadataIndexArgs {
pub account_id: String,
pub index_name: String,
pub body: VectorizeCreateMetadataIndexRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeDeleteMetadataIndexArgs {
pub account_id: String,
pub index_name: String,
pub body: VectorizeDeleteMetadataIndexRequest,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeListMetadataIndexesArgs {
pub account_id: String,
pub index_name: String,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeQueryVectorArgs {
pub account_id: String,
pub index_name: String,
pub body: VectorizeIndexQueryV2Request,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct VectorizeUpsertVectorArgs {
pub account_id: String,
pub index_name: String,
pub unparsable_behavior: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct RadarGetAiBotsSummaryArgs {
pub dimension: String,
pub name: Option<String>,
pub date_range: Option<String>,
pub date_start: Option<String>,
pub date_end: Option<String>,
pub asn: Option<String>,
pub location: Option<String>,
pub continent: Option<String>,
pub crawl_purpose: Option<String>,
pub user_agent: Option<String>,
pub vertical: Option<String>,
pub industry: Option<String>,
pub content_type: Option<String>,
pub limit_per_group: Option<String>,
pub format: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesArgs {
pub agg_interval: Option<String>,
pub name: Option<String>,
pub date_range: Option<String>,
pub date_start: Option<String>,
pub date_end: Option<String>,
pub asn: Option<String>,
pub location: Option<String>,
pub continent: Option<String>,
pub crawl_purpose: Option<String>,
pub user_agent: Option<String>,
pub industry: Option<String>,
pub vertical: Option<String>,
pub content_type: Option<String>,
pub limit_per_group: Option<String>,
pub format: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct RadarGetAiBotsTimeseriesGroupArgs {
pub dimension: String,
pub agg_interval: Option<String>,
pub name: Option<String>,
pub date_range: Option<String>,
pub date_start: Option<String>,
pub date_end: Option<String>,
pub asn: Option<String>,
pub location: Option<String>,
pub continent: Option<String>,
pub crawl_purpose: Option<String>,
pub user_agent: Option<String>,
pub industry: Option<String>,
pub vertical: Option<String>,
pub content_type: Option<String>,
pub limit_per_group: Option<String>,
pub normalization: Option<String>,
pub format: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct RadarGetAiInferenceSummaryArgs {
pub dimension: String,
pub name: Option<String>,
pub date_range: Option<String>,
pub date_start: Option<String>,
pub date_end: Option<String>,
pub asn: Option<String>,
pub location: Option<String>,
pub continent: Option<String>,
pub limit_per_group: Option<String>,
pub format: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, JsonHash)]
pub struct RadarGetAiInferenceTimeseriesGroupArgs {
pub dimension: String,
pub agg_interval: Option<String>,
pub name: Option<String>,
pub date_range: Option<String>,
pub date_start: Option<String>,
pub date_end: Option<String>,
pub asn: Option<String>,
pub location: Option<String>,
pub continent: Option<String>,
pub limit_per_group: Option<String>,
pub normalization: Option<String>,
pub format: Option<String>,
}
pub async fn aig_config_list_evaluators_request<F>(
client: DynNetClient,
args: &AigConfigListEvaluatorsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigListEvaluatorsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/evaluation-types",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("order_by", args.order_by.as_deref());
builder = builder.query("order_by_direction", args.order_by_direction.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigListEvaluatorsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_list_gateway_request<F>(
client: DynNetClient,
args: &AigConfigListGatewayArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigListGatewayResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("search", args.search.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigListGatewayResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_create_gateway_request<F>(
client: DynNetClient,
args: &AigConfigCreateGatewayArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigCreateGatewayResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigCreateGatewayResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_list_dataset_request<F>(
client: DynNetClient,
args: &AigConfigListDatasetArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigListDatasetResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/datasets",
args.account_id,
args.gateway_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("name", args.name.as_deref());
builder = builder.query("enable", args.enable.as_deref());
builder = builder.query("search", args.search.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigListDatasetResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_create_dataset_request<F>(
client: DynNetClient,
args: &AigConfigCreateDatasetArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigCreateDatasetResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/datasets",
args.account_id,
args.gateway_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigCreateDatasetResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_fetch_dataset_request<F>(
client: DynNetClient,
args: &AigConfigFetchDatasetArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigFetchDatasetResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/datasets/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigFetchDatasetResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_update_dataset_request<F>(
client: DynNetClient,
args: &AigConfigUpdateDatasetArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigUpdateDatasetResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/datasets/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::put(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigUpdateDatasetResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_delete_dataset_request<F>(
client: DynNetClient,
args: &AigConfigDeleteDatasetArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigDeleteDatasetResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/datasets/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigDeleteDatasetResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_list_evaluations_request<F>(
client: DynNetClient,
args: &AigConfigListEvaluationsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigListEvaluationsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/evaluations",
args.account_id,
args.gateway_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("name", args.name.as_deref());
builder = builder.query("processed", args.processed.as_deref());
builder = builder.query("search", args.search.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigListEvaluationsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_create_evaluations_request<F>(
client: DynNetClient,
args: &AigConfigCreateEvaluationsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigCreateEvaluationsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/evaluations",
args.account_id,
args.gateway_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigCreateEvaluationsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_fetch_evaluations_request<F>(
client: DynNetClient,
args: &AigConfigFetchEvaluationsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigFetchEvaluationsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/evaluations/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigFetchEvaluationsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_delete_evaluations_request<F>(
client: DynNetClient,
args: &AigConfigDeleteEvaluationsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigDeleteEvaluationsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/evaluations/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigDeleteEvaluationsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_list_gateway_logs_request<F>(
client: DynNetClient,
args: &AigConfigListGatewayLogsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigListGatewayLogsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/logs",
args.account_id,
args.gateway_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("search", args.search.as_deref());
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("order_by", args.order_by.as_deref());
builder = builder.query("order_by_direction", args.order_by_direction.as_deref());
builder = builder.query("filters", args.filters.as_deref());
builder = builder.query("meta_info", args.meta_info.as_deref());
builder = builder.query("direction", args.direction.as_deref());
builder = builder.query("start_date", args.start_date.as_deref());
builder = builder.query("end_date", args.end_date.as_deref());
builder = builder.query("min_cost", args.min_cost.as_deref());
builder = builder.query("max_cost", args.max_cost.as_deref());
builder = builder.query("min_tokens_in", args.min_tokens_in.as_deref());
builder = builder.query("max_tokens_in", args.max_tokens_in.as_deref());
builder = builder.query("min_tokens_out", args.min_tokens_out.as_deref());
builder = builder.query("max_tokens_out", args.max_tokens_out.as_deref());
builder = builder.query("min_total_tokens", args.min_total_tokens.as_deref());
builder = builder.query("max_total_tokens", args.max_total_tokens.as_deref());
builder = builder.query("min_duration", args.min_duration.as_deref());
builder = builder.query("max_duration", args.max_duration.as_deref());
builder = builder.query("feedback", args.feedback.as_deref());
builder = builder.query("success", args.success.as_deref());
builder = builder.query("cached", args.cached.as_deref());
builder = builder.query("model", args.model.as_deref());
builder = builder.query("model_type", args.model_type.as_deref());
builder = builder.query("provider", args.provider.as_deref());
builder = builder.query("request_content_type", args.request_content_type.as_deref());
builder = builder.query("response_content_type", args.response_content_type.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigListGatewayLogsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_delete_gateway_logs_request<F>(
client: DynNetClient,
args: &AigConfigDeleteGatewayLogsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigDeleteGatewayLogsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/logs",
args.account_id,
args.gateway_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("order_by", args.order_by.as_deref());
builder = builder.query("order_by_direction", args.order_by_direction.as_deref());
builder = builder.query("filters", args.filters.as_deref());
builder = builder.query("limit", args.limit.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigDeleteGatewayLogsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_get_gateway_log_detail_request<F>(
client: DynNetClient,
args: &AigConfigGetGatewayLogDetailArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigGetGatewayLogDetailResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/logs/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigGetGatewayLogDetailResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_patch_gateway_log_request<F>(
client: DynNetClient,
args: &AigConfigPatchGatewayLogArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigPatchGatewayLogResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/logs/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::patch(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigPatchGatewayLogResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_get_gateway_log_request_request<F>(
client: DynNetClient,
args: &AigConfigGetGatewayLogRequestArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/logs/{}/request",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_get_gateway_log_response_request<F>(
client: DynNetClient,
args: &AigConfigGetGatewayLogResponseArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/logs/{}/response",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_list_providers_request<F>(
client: DynNetClient,
args: &AigConfigListProvidersArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigListProvidersResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/provider_configs",
args.account_id,
args.gateway_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigListProvidersResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_create_providers_request<F>(
client: DynNetClient,
args: &AigConfigCreateProvidersArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigCreateProvidersResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/provider_configs",
args.account_id,
args.gateway_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigCreateProvidersResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_update_providers_request<F>(
client: DynNetClient,
args: &AigConfigUpdateProvidersArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigUpdateProvidersResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/provider_configs/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::put(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigUpdateProvidersResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_delete_providers_request<F>(
client: DynNetClient,
args: &AigConfigDeleteProvidersArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigDeleteProvidersResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/provider_configs/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigDeleteProvidersResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_list_gateway_dynamic_routes_request<F>(
client: DynNetClient,
args: &AigConfigListGatewayDynamicRoutesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigListGatewayDynamicRoutesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/routes",
args.account_id,
args.gateway_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigListGatewayDynamicRoutesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_post_gateway_dynamic_route_request<F>(
client: DynNetClient,
args: &AigConfigPostGatewayDynamicRouteArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigPostGatewayDynamicRouteResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/routes",
args.account_id,
args.gateway_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigPostGatewayDynamicRouteResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_get_gateway_dynamic_route_request<F>(
client: DynNetClient,
args: &AigConfigGetGatewayDynamicRouteArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigGetGatewayDynamicRouteResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/routes/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigGetGatewayDynamicRouteResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_update_gateway_dynamic_route_request<F>(
client: DynNetClient,
args: &AigConfigUpdateGatewayDynamicRouteArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigUpdateGatewayDynamicRouteResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/routes/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::patch(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigUpdateGatewayDynamicRouteResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_delete_gateway_dynamic_route_request<F>(
client: DynNetClient,
args: &AigConfigDeleteGatewayDynamicRouteArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigDeleteGatewayDynamicRouteResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/routes/{}",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigDeleteGatewayDynamicRouteResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_list_gateway_dynamic_route_deployments_request<F>(
client: DynNetClient,
args: &AigConfigListGatewayDynamicRouteDeploymentsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigListGatewayDynamicRouteDeploymentsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/routes/{}/deployments",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigListGatewayDynamicRouteDeploymentsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_post_gateway_dynamic_route_deployment_request<F>(
client: DynNetClient,
args: &AigConfigPostGatewayDynamicRouteDeploymentArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigPostGatewayDynamicRouteDeploymentResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/routes/{}/deployments",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigPostGatewayDynamicRouteDeploymentResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_list_gateway_dynamic_route_versions_request<F>(
client: DynNetClient,
args: &AigConfigListGatewayDynamicRouteVersionsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigListGatewayDynamicRouteVersionsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/routes/{}/versions",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigListGatewayDynamicRouteVersionsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_post_gateway_dynamic_route_version_request<F>(
client: DynNetClient,
args: &AigConfigPostGatewayDynamicRouteVersionArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigPostGatewayDynamicRouteVersionResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/routes/{}/versions",
args.account_id,
args.gateway_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigPostGatewayDynamicRouteVersionResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_get_gateway_dynamic_route_version_request<F>(
client: DynNetClient,
args: &AigConfigGetGatewayDynamicRouteVersionArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigGetGatewayDynamicRouteVersionResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/routes/{}/versions/{}",
args.account_id,
args.gateway_id,
args.id,
args.version_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigGetGatewayDynamicRouteVersionResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_get_gateway_url_request<F>(
client: DynNetClient,
args: &AigConfigGetGatewayUrlArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigGetGatewayUrlResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}/url/{}",
args.account_id,
args.gateway_id,
args.provider,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigGetGatewayUrlResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_fetch_gateway_request<F>(
client: DynNetClient,
args: &AigConfigFetchGatewayArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigFetchGatewayResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigFetchGatewayResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_update_gateway_request<F>(
client: DynNetClient,
args: &AigConfigUpdateGatewayArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigUpdateGatewayResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::put(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigUpdateGatewayResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn aig_config_delete_gateway_request<F>(
client: DynNetClient,
args: &AigConfigDeleteGatewayArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AigConfigDeleteGatewayResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-gateway/gateways/{}",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AigConfigDeleteGatewayResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_list_instances_request<F>(
client: DynNetClient,
args: &AiSearchListInstancesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchListInstancesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("namespace", args.namespace.as_deref());
builder = builder.query("search", args.search.as_deref());
builder = builder.query("order_by", args.order_by.as_deref());
builder = builder.query("order_by_direction", args.order_by_direction.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchListInstancesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_create_instances_request<F>(
client: DynNetClient,
args: &AiSearchCreateInstancesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchCreateInstancesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchCreateInstancesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_fetch_instances_request<F>(
client: DynNetClient,
args: &AiSearchFetchInstancesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchFetchInstancesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances/{}",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchFetchInstancesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_update_instances_request<F>(
client: DynNetClient,
args: &AiSearchUpdateInstancesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchUpdateInstancesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances/{}",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::put(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchUpdateInstancesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_delete_instances_request<F>(
client: DynNetClient,
args: &AiSearchDeleteInstancesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchDeleteInstancesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances/{}",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchDeleteInstancesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_instance_chat_completion_request<F>(
client: DynNetClient,
args: &AiSearchInstanceChatCompletionArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchInstanceChatCompletionResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances/{}/chat/completions",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchInstanceChatCompletionResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_instance_list_jobs_request<F>(
client: DynNetClient,
args: &AiSearchInstanceListJobsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchInstanceListJobsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances/{}/jobs",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchInstanceListJobsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_instance_create_job_request<F>(
client: DynNetClient,
args: &AiSearchInstanceCreateJobArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchInstanceCreateJobResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances/{}/jobs",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchInstanceCreateJobResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_instance_get_job_request<F>(
client: DynNetClient,
args: &AiSearchInstanceGetJobArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchInstanceGetJobResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances/{}/jobs/{}",
args.account_id,
args.id,
args.job_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchInstanceGetJobResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_instance_change_job_status_request<F>(
client: DynNetClient,
args: &AiSearchInstanceChangeJobStatusArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchInstanceChangeJobStatusResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances/{}/jobs/{}",
args.account_id,
args.id,
args.job_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::patch(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchInstanceChangeJobStatusResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_instance_list_job_logs_request<F>(
client: DynNetClient,
args: &AiSearchInstanceListJobLogsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchInstanceListJobLogsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances/{}/jobs/{}/logs",
args.account_id,
args.id,
args.job_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchInstanceListJobLogsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_instance_search_request<F>(
client: DynNetClient,
args: &AiSearchInstanceSearchArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchInstanceSearchResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances/{}/search",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchInstanceSearchResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_stats_request<F>(
client: DynNetClient,
args: &AiSearchStatsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchStatsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/instances/{}/stats",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchStatsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_list_tokens_request<F>(
client: DynNetClient,
args: &AiSearchListTokensArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchListTokensResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/tokens",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("order_by", args.order_by.as_deref());
builder = builder.query("order_by_direction", args.order_by_direction.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchListTokensResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_create_tokens_request<F>(
client: DynNetClient,
args: &AiSearchCreateTokensArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchCreateTokensResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/tokens",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchCreateTokensResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_fetch_tokens_request<F>(
client: DynNetClient,
args: &AiSearchFetchTokensArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchFetchTokensResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/tokens/{}",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchFetchTokensResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_update_tokens_request<F>(
client: DynNetClient,
args: &AiSearchUpdateTokensArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchUpdateTokensResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/tokens/{}",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::put(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchUpdateTokensResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn ai_search_delete_tokens_request<F>(
client: DynNetClient,
args: &AiSearchDeleteTokensArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AiSearchDeleteTokensResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai-search/tokens/{}",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AiSearchDeleteTokensResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_search_author_request<F>(
client: DynNetClient,
args: &WorkersAiSearchAuthorArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<WorkersAiSearchAuthorResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/authors/search",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: WorkersAiSearchAuthorResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_list_finetunes_request<F>(
client: DynNetClient,
args: &WorkersAiListFinetunesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<WorkersAiListFinetunesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/finetunes",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: WorkersAiListFinetunesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_create_finetune_request<F>(
client: DynNetClient,
args: &WorkersAiCreateFinetuneArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<WorkersAiCreateFinetuneResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/finetunes",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: WorkersAiCreateFinetuneResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_list_public_finetunes_request<F>(
client: DynNetClient,
args: &WorkersAiListPublicFinetunesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<WorkersAiListPublicFinetunesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/finetunes/public",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("limit", args.limit.as_deref());
builder = builder.query("offset", args.offset.as_deref());
builder = builder.query("orderBy", args.order_by.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: WorkersAiListPublicFinetunesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_upload_finetune_asset_request<F>(
client: DynNetClient,
args: &WorkersAiUploadFinetuneAssetArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<WorkersAiUploadFinetuneAssetResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/finetunes/{}/finetune-assets",
args.account_id,
args.finetune_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: WorkersAiUploadFinetuneAssetResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_get_model_schema_request<F>(
client: DynNetClient,
args: &WorkersAiGetModelSchemaArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<WorkersAiGetModelSchemaResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/models/schema",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("model", args.model.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: WorkersAiGetModelSchemaResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_search_model_request<F>(
client: DynNetClient,
args: &WorkersAiSearchModelArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<WorkersAiSearchModelResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/models/search",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("page", args.page.as_deref());
builder = builder.query("task", args.task.as_deref());
builder = builder.query("author", args.author.as_deref());
builder = builder.query("source", args.source.as_deref());
builder = builder.query("hide_experimental", args.hide_experimental.as_deref());
builder = builder.query("search", args.search.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: WorkersAiSearchModelResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_ai4bharat_indictrans2_en_indic_1_b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfAi4BharatIndictrans2EnIndic1BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/ai4bharat/indictrans2-en-indic-1B",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_ai4bharat_nonomni_indictrans2_en_indic_1b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfAi4BharatNonomniIndictrans2EnIndic1BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/ai4bharat/nonomni-indictrans2-en-indic-1b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_aisingapore_gemma_sea_lion_v4_27b_it_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfAisingaporeGemmaSeaLionV427BItArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/aisingapore/gemma-sea-lion-v4-27b-it",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_baai_bge_base_en_v1_5_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBaaiBgeBaseEnV15Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/baai/bge-base-en-v1.5",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_baai_bge_large_en_v1_5_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBaaiBgeLargeEnV15Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/baai/bge-large-en-v1.5",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_baai_bge_m3_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBaaiBgeM3Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/baai/bge-m3",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_baai_bge_reranker_base_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBaaiBgeRerankerBaseArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/baai/bge-reranker-base",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_baai_bge_small_en_v1_5_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBaaiBgeSmallEnV15Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/baai/bge-small-en-v1.5",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_baai_nonomni_bge_base_en_v1_5_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBaaiNonomniBgeBaseEnV15Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/baai/nonomni-bge-base-en-v1.5",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_baai_nonomni_bge_large_en_v1_5_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBaaiNonomniBgeLargeEnV15Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/baai/nonomni-bge-large-en-v1.5",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_baai_nonomni_bge_m3_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBaaiNonomniBgeM3Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/baai/nonomni-bge-m3",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_baai_nonomni_bge_small_en_v1_5_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBaaiNonomniBgeSmallEnV15Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/baai/nonomni-bge-small-en-v1.5",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_black_forest_labs_flux_1_schnell_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBlackForestLabsFlux1SchnellArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/black-forest-labs/flux-1-schnell",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_black_forest_labs_flux_2_dev_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBlackForestLabsFlux2DevArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/black-forest-labs/flux-2-dev",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_black_forest_labs_flux_2_klein_4b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBlackForestLabsFlux2Klein4BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/black-forest-labs/flux-2-klein-4b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_black_forest_labs_flux_2_klein_9b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBlackForestLabsFlux2Klein9BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/black-forest-labs/flux-2-klein-9b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_bytedance_stable_diffusion_xl_lightning_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfBytedanceStableDiffusionXlLightningArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/bytedance/stable-diffusion-xl-lightning",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_websocket_run_cf_deepgram_aura_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfDeepgramAuraArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/aura",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_websocket_run_cf_deepgram_aura_1_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfDeepgramAura1Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/aura-1",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_run_cf_deepgram_aura_1_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfDeepgramAura1Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/aura-1",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_websocket_run_cf_deepgram_aura_1_internal_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfDeepgramAura1InternalArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/aura-1-internal",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_websocket_run_cf_deepgram_aura_2_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfDeepgramAura2Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/aura-2",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_websocket_run_cf_deepgram_aura_2_en_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfDeepgramAura2EnArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/aura-2-en",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_run_cf_deepgram_aura_2_en_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfDeepgramAura2EnArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/aura-2-en",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_websocket_run_cf_deepgram_aura_2_es_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfDeepgramAura2EsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/aura-2-es",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_run_cf_deepgram_aura_2_es_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfDeepgramAura2EsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/aura-2-es",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_websocket_run_cf_deepgram_flux_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfDeepgramFluxArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/flux",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_run_cf_deepgram_flux_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfDeepgramFluxArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/flux",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_websocket_run_cf_deepgram_nova_3_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfDeepgramNova3Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/nova-3",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_run_cf_deepgram_nova_3_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfDeepgramNova3Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/nova-3",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_websocket_run_cf_deepgram_nova_3_internal_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfDeepgramNova3InternalArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/nova-3-internal",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_websocket_run_cf_deepgram_nova_3_ws_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfDeepgramNova3WsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepgram/nova-3-ws",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_run_cf_deepseek_ai_deepseek_math_7b_instruct_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfDeepseekAiDeepseekMath7BInstructArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepseek-ai/deepseek-math-7b-instruct",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_deepseek_ai_deepseek_r1_distill_qwen_32b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfDeepseekAiDeepseekR1DistillQwen32BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_defog_sqlcoder_7b_2_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfDefogSqlcoder7B2Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/defog/sqlcoder-7b-2",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_facebook_bart_large_cnn_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfFacebookBartLargeCnnArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/facebook/bart-large-cnn",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_facebook_nonomni_bart_large_cnn_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfFacebookNonomniBartLargeCnnArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/facebook/nonomni-bart-large-cnn",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_facebook_nonomni_detr_resnet_50_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfFacebookNonomniDetrResnet50Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/facebook/nonomni-detr-resnet-50",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_fblgit_una_cybertron_7b_v2_bf16_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfFblgitUnaCybertron7BV2Bf16Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/fblgit/una-cybertron-7b-v2-bf16",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_google_embeddinggemma_300m_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfGoogleEmbeddinggemma300MArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/google/embeddinggemma-300m",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_google_gemma_2b_it_lora_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfGoogleGemma2BItLoraArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/google/gemma-2b-it-lora",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_google_gemma_3_12b_it_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfGoogleGemma312BItArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/google/gemma-3-12b-it",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_google_gemma_7b_it_lora_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfGoogleGemma7BItLoraArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/google/gemma-7b-it-lora",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_google_nonomni_embeddinggemma_300m_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfGoogleNonomniEmbeddinggemma300MArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/google/nonomni-embeddinggemma-300m",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_huggingface_distilbert_sst_2_int8_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfHuggingfaceDistilbertSst2Int8Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/huggingface/distilbert-sst-2-int8",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_huggingface_nonomni_distilbert_sst_2_int8_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfHuggingfaceNonomniDistilbertSst2Int8Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/huggingface/nonomni-distilbert-sst-2-int8",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_ibm_granite_granite_4_0_h_micro_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfIbmGraniteGranite40HMicroArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/ibm-granite/granite-4.0-h-micro",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_leonardo_lucid_origin_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfLeonardoLucidOriginArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/leonardo/lucid-origin",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_leonardo_phoenix_1_0_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfLeonardoPhoenix10Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/leonardo/phoenix-1.0",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_lykon_dreamshaper_8_lcm_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfLykonDreamshaper8LcmArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/lykon/dreamshaper-8-lcm",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_llama_2_7b_chat_hf_lora_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlamaLlama27BChatHfLoraArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta-llama/llama-2-7b-chat-hf-lora",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_2_7b_chat_fp16_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama27BChatFp16Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-2-7b-chat-fp16",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_2_7b_chat_int8_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama27BChatInt8Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-2-7b-chat-int8",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_3_8b_instruct_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama38BInstructArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-3-8b-instruct",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_3_8b_instruct_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama38BInstructAwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-3-8b-instruct-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_3_1_70b_instruct_fp8_fast_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama3170BInstructFp8FastArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-3.1-70b-instruct-fp8-fast",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_3_1_8b_instruct_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama318BInstructAwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-3.1-8b-instruct-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_3_1_8b_instruct_fp8_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama318BInstructFp8Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-3.1-8b-instruct-fp8",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_3_1_8b_instruct_fp8_fast_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama318BInstructFp8FastArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-3.1-8b-instruct-fp8-fast",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_3_2_11b_vision_instruct_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama3211BVisionInstructArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-3.2-11b-vision-instruct",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_3_2_1b_instruct_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama321BInstructArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-3.2-1b-instruct",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_3_2_3b_instruct_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama323BInstructArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-3.2-3b-instruct",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_3_3_70b_instruct_fp8_fast_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama3370BInstructFp8FastArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-3.3-70b-instruct-fp8-fast",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_4_scout_17b_16e_instruct_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlama4Scout17B16EInstructArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-4-scout-17b-16e-instruct",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_llama_guard_3_8b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaLlamaGuard38BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/llama-guard-3-8b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_meta_m2m100_1_2b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMetaM2M10012BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/meta/m2m100-1.2b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_microsoft_nonomni_resnet_50_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMicrosoftNonomniResnet50Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/microsoft/nonomni-resnet-50",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_microsoft_phi_2_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMicrosoftPhi2Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/microsoft/phi-2",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_microsoft_resnet_50_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMicrosoftResnet50Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/microsoft/resnet-50",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_mistral_mistral_7b_instruct_v0_1_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMistralMistral7BInstructV01Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/mistral/mistral-7b-instruct-v0.1",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_mistral_mistral_7b_instruct_v0_2_lora_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMistralMistral7BInstructV02LoraArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/mistral/mistral-7b-instruct-v0.2-lora",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_mistralai_mistral_small_3_1_24b_instruct_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMistralaiMistralSmall3124BInstructArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/mistralai/mistral-small-3.1-24b-instruct",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_moonshotai_kimi_k2_5_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMoonshotaiKimiK25Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/moonshotai/kimi-k2.5",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_myshell_ai_melotts_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfMyshellAiMelottsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/myshell-ai/melotts",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_nvidia_nemotron_3_120b_a12b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfNvidiaNemotron3120BA12BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/nvidia/nemotron-3-120b-a12b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_openai_gpt_oss_120b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfOpenaiGptOss120BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/openai/gpt-oss-120b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_openai_gpt_oss_20b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfOpenaiGptOss20BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/openai/gpt-oss-20b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_openai_whisper_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfOpenaiWhisperArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/openai/whisper",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_openai_whisper_large_v3_turbo_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfOpenaiWhisperLargeV3TurboArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/openai/whisper-large-v3-turbo",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_openai_whisper_tiny_en_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfOpenaiWhisperTinyEnArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/openai/whisper-tiny-en",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_openchat_openchat_3_5_0106_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfOpenchatOpenchat350106Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/openchat/openchat-3.5-0106",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_pfnet_plamo_embedding_1b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfPfnetPlamoEmbedding1BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/pfnet/plamo-embedding-1b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_websocket_run_cf_pipecat_ai_smart_turn_v2_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfPipecatAiSmartTurnV2Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/pipecat-ai/smart-turn-v2",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_websocket_run_cf_pipecat_ai_smart_turn_v3_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfPipecatAiSmartTurnV3Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/pipecat-ai/smart-turn-v3",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_run_cf_qwen_qwen1_5_0_5b_chat_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfQwenQwen1505BChatArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/qwen/qwen1.5-0.5b-chat",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_qwen_qwen1_5_1_8b_chat_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfQwenQwen1518BChatArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/qwen/qwen1.5-1.8b-chat",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_qwen_qwen1_5_14b_chat_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfQwenQwen1514BChatAwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/qwen/qwen1.5-14b-chat-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_qwen_qwen1_5_7b_chat_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfQwenQwen157BChatAwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/qwen/qwen1.5-7b-chat-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_qwen_qwen2_5_coder_32b_instruct_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfQwenQwen25Coder32BInstructArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/qwen/qwen2.5-coder-32b-instruct",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_qwen_qwen3_30b_a3b_fp8_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfQwenQwen330BA3BFp8Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/qwen/qwen3-30b-a3b-fp8",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_qwen_qwen3_embedding_0_6b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfQwenQwen3Embedding06BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/qwen/qwen3-embedding-0.6b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_qwen_qwq_32b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfQwenQwq32BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/qwen/qwq-32b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_runwayml_stable_diffusion_v1_5_img2img_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfRunwaymlStableDiffusionV15Img2ImgArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/runwayml/stable-diffusion-v1-5-img2img",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_runwayml_stable_diffusion_v1_5_inpainting_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfRunwaymlStableDiffusionV15InpaintingArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/runwayml/stable-diffusion-v1-5-inpainting",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_stabilityai_stable_diffusion_xl_base_1_0_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfStabilityaiStableDiffusionXlBase10Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/stabilityai/stable-diffusion-xl-base-1.0",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_websocket_run_cf_sven_test_pipe_http_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfSvenTestPipeHttpArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/sven/test-pipe-http",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_websocket_run_cf_test_hello_world_cog_request<F>(
client: DynNetClient,
args: &WorkersAiPostWebsocketRunCfTestHelloWorldCogArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<()>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/test/hello-world-cog",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
Ok(ApiResponse { status: status as u16, headers, body: () })
}
pub async fn workers_ai_post_run_cf_thebloke_discolm_german_7b_v1_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfTheblokeDiscolmGerman7BV1AwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/thebloke/discolm-german-7b-v1-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_tiiuae_falcon_7b_instruct_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfTiiuaeFalcon7BInstructArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/tiiuae/falcon-7b-instruct",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_tinyllama_tinyllama_1_1b_chat_v1_0_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfTinyllamaTinyllama11BChatV10Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/tinyllama/tinyllama-1.1b-chat-v1.0",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_cf_zai_org_glm_4_7_flash_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunCfZaiOrgGlm47FlashArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@cf/zai-org/glm-4.7-flash",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_hf_google_gemma_7b_it_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunHfGoogleGemma7BItArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@hf/google/gemma-7b-it",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_hf_mistral_mistral_7b_instruct_v0_2_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunHfMistralMistral7BInstructV02Args,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@hf/mistral/mistral-7b-instruct-v0.2",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_hf_nexusflow_starling_lm_7b_beta_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunHfNexusflowStarlingLm7BBetaArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@hf/nexusflow/starling-lm-7b-beta",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_hf_nousresearch_hermes_2_pro_mistral_7b_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunHfNousresearchHermes2ProMistral7BArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@hf/nousresearch/hermes-2-pro-mistral-7b",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_hf_thebloke_deepseek_coder_6_7b_base_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunHfTheblokeDeepseekCoder67BBaseAwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@hf/thebloke/deepseek-coder-6.7b-base-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_hf_thebloke_deepseek_coder_6_7b_instruct_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunHfTheblokeDeepseekCoder67BInstructAwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@hf/thebloke/deepseek-coder-6.7b-instruct-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_hf_thebloke_llama_2_13b_chat_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunHfTheblokeLlama213BChatAwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@hf/thebloke/llama-2-13b-chat-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_hf_thebloke_mistral_7b_instruct_v0_1_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunHfTheblokeMistral7BInstructV01AwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@hf/thebloke/mistral-7b-instruct-v0.1-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_hf_thebloke_neural_chat_7b_v3_1_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunHfTheblokeNeuralChat7BV31AwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@hf/thebloke/neural-chat-7b-v3-1-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_hf_thebloke_openhermes_2_5_mistral_7b_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunHfTheblokeOpenhermes25Mistral7BAwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@hf/thebloke/openhermes-2.5-mistral-7b-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_hf_thebloke_zephyr_7b_beta_awq_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunHfTheblokeZephyr7BBetaAwqArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<serde_json::Value>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/@hf/thebloke/zephyr-7b-beta-awq",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("queueRequest", args.queue_request.as_deref());
builder = builder.query("tags", args.tags.as_deref());
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: serde_json::Value = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_run_model_request<F>(
client: DynNetClient,
args: &WorkersAiPostRunModelArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<WorkersAiPostRunModelResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/run/{}",
args.account_id,
args.model_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: WorkersAiPostRunModelResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_search_task_request<F>(
client: DynNetClient,
args: &WorkersAiSearchTaskArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<WorkersAiSearchTaskResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/tasks/search",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: WorkersAiSearchTaskResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_post_to_markdown_request<F>(
client: DynNetClient,
args: &WorkersAiPostToMarkdownArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<WorkersAiPostToMarkdownResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/tomarkdown",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: WorkersAiPostToMarkdownResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn workers_ai_get_to_markdown_supported_request<F>(
client: DynNetClient,
args: &WorkersAiGetToMarkdownSupportedArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<WorkersAiGetToMarkdownSupportedResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/ai/tomarkdown/supported",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: WorkersAiGetToMarkdownSupportedResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn autorag_config_ai_search_request<F>(
client: DynNetClient,
args: &AutoragConfigAiSearchArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AutoragConfigAiSearchResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/autorag/rags/{}/ai-search",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AutoragConfigAiSearchResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn autorag_config_files_request<F>(
client: DynNetClient,
args: &AutoragConfigFilesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AutoragConfigFilesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/autorag/rags/{}/files",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
builder = builder.query("search", args.search.as_deref());
builder = builder.query("status", args.status.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AutoragConfigFilesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn autorag_config_list_jobs_request<F>(
client: DynNetClient,
args: &AutoragConfigListJobsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AutoragConfigListJobsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/autorag/rags/{}/jobs",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AutoragConfigListJobsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn autorag_config_get_job_request<F>(
client: DynNetClient,
args: &AutoragConfigGetJobArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AutoragConfigGetJobResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/autorag/rags/{}/jobs/{}",
args.account_id,
args.id,
args.job_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AutoragConfigGetJobResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn autorag_config_list_job_logs_request<F>(
client: DynNetClient,
args: &AutoragConfigListJobLogsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AutoragConfigListJobLogsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/autorag/rags/{}/jobs/{}/logs",
args.account_id,
args.id,
args.job_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("page", args.page.as_deref());
builder = builder.query("per_page", args.per_page.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AutoragConfigListJobLogsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn autorag_config_search_request<F>(
client: DynNetClient,
args: &AutoragConfigSearchArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AutoragConfigSearchResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/autorag/rags/{}/search",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AutoragConfigSearchResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn autorag_config_sync_request<F>(
client: DynNetClient,
args: &AutoragConfigSyncArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<AutoragConfigSyncResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/autorag/rags/{}/sync",
args.account_id,
args.id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::patch(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: AutoragConfigSyncResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn get_session_chat_request<F>(
client: DynNetClient,
args: &GetSessionChatArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RealtimekitGetSessionChatResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/realtime/kit/{}/sessions/{}/chat",
args.account_id,
args.app_id,
args.session_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: RealtimekitGetSessionChatResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_list_vectorize_indexes_request<F>(
client: DynNetClient,
args: &VectorizeListVectorizeIndexesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeListVectorizeIndexesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeListVectorizeIndexesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_create_vectorize_index_request<F>(
client: DynNetClient,
args: &VectorizeCreateVectorizeIndexArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeCreateVectorizeIndexResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes",
args.account_id,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeCreateVectorizeIndexResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_get_vectorize_index_request<F>(
client: DynNetClient,
args: &VectorizeGetVectorizeIndexArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeGetVectorizeIndexResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeGetVectorizeIndexResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_delete_vectorize_index_request<F>(
client: DynNetClient,
args: &VectorizeDeleteVectorizeIndexArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeDeleteVectorizeIndexResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::delete(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeDeleteVectorizeIndexResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_delete_vectors_by_id_request<F>(
client: DynNetClient,
args: &VectorizeDeleteVectorsByIdArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeDeleteVectorsByIdResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}/delete_by_ids",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeDeleteVectorsByIdResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_get_vectors_by_id_request<F>(
client: DynNetClient,
args: &VectorizeGetVectorsByIdArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeGetVectorsByIdResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}/get_by_ids",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeGetVectorsByIdResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_index_info_request<F>(
client: DynNetClient,
args: &VectorizeIndexInfoArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeIndexInfoResponse2>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}/info",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeIndexInfoResponse2 = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_insert_vector_request<F>(
client: DynNetClient,
args: &VectorizeInsertVectorArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeInsertVectorResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}/insert",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("unparsable-behavior", args.unparsable_behavior.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeInsertVectorResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_list_vectors_request<F>(
client: DynNetClient,
args: &VectorizeListVectorsArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeListVectorsResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}/list",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("count", args.count.as_deref());
builder = builder.query("cursor", args.cursor.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeListVectorsResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_create_metadata_index_request<F>(
client: DynNetClient,
args: &VectorizeCreateMetadataIndexArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeCreateMetadataIndexResponse2>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}/metadata_index/create",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeCreateMetadataIndexResponse2 = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_delete_metadata_index_request<F>(
client: DynNetClient,
args: &VectorizeDeleteMetadataIndexArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeDeleteMetadataIndexResponse2>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}/metadata_index/delete",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeDeleteMetadataIndexResponse2 = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_list_metadata_indexes_request<F>(
client: DynNetClient,
args: &VectorizeListMetadataIndexesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeListMetadataIndexesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}/metadata_index/list",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeListMetadataIndexesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_query_vector_request<F>(
client: DynNetClient,
args: &VectorizeQueryVectorArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeQueryVectorResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}/query",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.body_json(&args.body)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeQueryVectorResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn vectorize_upsert_vector_request<F>(
client: DynNetClient,
args: &VectorizeUpsertVectorArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<VectorizeUpsertVectorResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/accounts/{}/vectorize/v2/indexes/{}/upsert",
args.account_id,
args.index_name,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::post(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("unparsable-behavior", args.unparsable_behavior.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: VectorizeUpsertVectorResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn radar_get_ai_bots_summary_request<F>(
client: DynNetClient,
args: &RadarGetAiBotsSummaryArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RadarGetAiBotsSummaryResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/radar/ai/bots/summary/{}",
args.dimension,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("name", args.name.as_deref());
builder = builder.query("dateRange", args.date_range.as_deref());
builder = builder.query("dateStart", args.date_start.as_deref());
builder = builder.query("dateEnd", args.date_end.as_deref());
builder = builder.query("asn", args.asn.as_deref());
builder = builder.query("location", args.location.as_deref());
builder = builder.query("continent", args.continent.as_deref());
builder = builder.query("crawlPurpose", args.crawl_purpose.as_deref());
builder = builder.query("userAgent", args.user_agent.as_deref());
builder = builder.query("vertical", args.vertical.as_deref());
builder = builder.query("industry", args.industry.as_deref());
builder = builder.query("contentType", args.content_type.as_deref());
builder = builder.query("limitPerGroup", args.limit_per_group.as_deref());
builder = builder.query("format", args.format.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: RadarGetAiBotsSummaryResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn radar_get_ai_bots_timeseries_request<F>(
client: DynNetClient,
args: &RadarGetAiBotsTimeseriesArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RadarGetAiBotsTimeseriesResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/radar/ai/bots/timeseries",
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("aggInterval", args.agg_interval.as_deref());
builder = builder.query("name", args.name.as_deref());
builder = builder.query("dateRange", args.date_range.as_deref());
builder = builder.query("dateStart", args.date_start.as_deref());
builder = builder.query("dateEnd", args.date_end.as_deref());
builder = builder.query("asn", args.asn.as_deref());
builder = builder.query("location", args.location.as_deref());
builder = builder.query("continent", args.continent.as_deref());
builder = builder.query("crawlPurpose", args.crawl_purpose.as_deref());
builder = builder.query("userAgent", args.user_agent.as_deref());
builder = builder.query("industry", args.industry.as_deref());
builder = builder.query("vertical", args.vertical.as_deref());
builder = builder.query("contentType", args.content_type.as_deref());
builder = builder.query("limitPerGroup", args.limit_per_group.as_deref());
builder = builder.query("format", args.format.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: RadarGetAiBotsTimeseriesResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn radar_get_ai_bots_timeseries_group_request<F>(
client: DynNetClient,
args: &RadarGetAiBotsTimeseriesGroupArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RadarGetAiBotsTimeseriesGroupResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/radar/ai/bots/timeseries_groups/{}",
args.dimension,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("aggInterval", args.agg_interval.as_deref());
builder = builder.query("name", args.name.as_deref());
builder = builder.query("dateRange", args.date_range.as_deref());
builder = builder.query("dateStart", args.date_start.as_deref());
builder = builder.query("dateEnd", args.date_end.as_deref());
builder = builder.query("asn", args.asn.as_deref());
builder = builder.query("location", args.location.as_deref());
builder = builder.query("continent", args.continent.as_deref());
builder = builder.query("crawlPurpose", args.crawl_purpose.as_deref());
builder = builder.query("userAgent", args.user_agent.as_deref());
builder = builder.query("industry", args.industry.as_deref());
builder = builder.query("vertical", args.vertical.as_deref());
builder = builder.query("contentType", args.content_type.as_deref());
builder = builder.query("limitPerGroup", args.limit_per_group.as_deref());
builder = builder.query("normalization", args.normalization.as_deref());
builder = builder.query("format", args.format.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: RadarGetAiBotsTimeseriesGroupResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn radar_get_ai_inference_summary_request<F>(
client: DynNetClient,
args: &RadarGetAiInferenceSummaryArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RadarGetAiInferenceSummaryResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/radar/ai/inference/summary/{}",
args.dimension,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("name", args.name.as_deref());
builder = builder.query("dateRange", args.date_range.as_deref());
builder = builder.query("dateStart", args.date_start.as_deref());
builder = builder.query("dateEnd", args.date_end.as_deref());
builder = builder.query("asn", args.asn.as_deref());
builder = builder.query("location", args.location.as_deref());
builder = builder.query("continent", args.continent.as_deref());
builder = builder.query("limitPerGroup", args.limit_per_group.as_deref());
builder = builder.query("format", args.format.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: RadarGetAiInferenceSummaryResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}
pub async fn radar_get_ai_inference_timeseries_group_request<F>(
client: DynNetClient,
args: &RadarGetAiInferenceTimeseriesGroupArgs,
base_url: &str,
builder_mod: Option<F>,
) -> Result<ApiResponse<RadarGetAiInferenceTimeseriesGroupResponse>, super::shared::ApiError>
where
F: FnOnce(&mut PreparedRequestBuilder),
{
let path = format!("/radar/ai/inference/timeseries_groups/{}",
args.dimension,
);
let endpoint_url = format!("{}{}", base_url, path);
let mut builder = PreparedRequestBuilder::get(&endpoint_url)
.map_err(|e| super::shared::ApiError::RequestBuildFailed(e.to_string()))?;
builder = builder.query("aggInterval", args.agg_interval.as_deref());
builder = builder.query("name", args.name.as_deref());
builder = builder.query("dateRange", args.date_range.as_deref());
builder = builder.query("dateStart", args.date_start.as_deref());
builder = builder.query("dateEnd", args.date_end.as_deref());
builder = builder.query("asn", args.asn.as_deref());
builder = builder.query("location", args.location.as_deref());
builder = builder.query("continent", args.continent.as_deref());
builder = builder.query("limitPerGroup", args.limit_per_group.as_deref());
builder = builder.query("normalization", args.normalization.as_deref());
builder = builder.query("format", args.format.as_deref());
if let Some(f) = builder_mod {
f(&mut builder);
}
let response = client.send_async(builder.build()).await
.map_err(|e| super::shared::ApiError::RequestSendFailed(e.to_string()))?;
let status: usize = response.get_status().into();
let headers = response.get_headers_ref().clone();
if status < 200 || status >= 300 {
let error_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let body = (!error_bytes.is_empty())
.then(|| String::from_utf8_lossy(&error_bytes).into_owned());
return Err(super::shared::ApiError::HttpStatus { code: status as u16, headers, body });
}
let body_bytes = foundation_netio::shared::client::body_reader::collect_bytes_from_send_safe(response.take_body());
let parsed: RadarGetAiInferenceTimeseriesGroupResponse = serde_json::from_slice(&body_bytes).map_err(|e: serde_json::Error| super::shared::ApiError::ParseFailed(e.to_string()))?;
Ok(ApiResponse { status: status as u16, headers, body: parsed })
}