langfuse_client_base/models/create_blob_storage_integration_request.rs
1/*
2 * server
3 *
4 * ## Real-time data The only real-time path to get tracing data is to ingest via OpenTelemetry (`POST /api/public/otel/v1/traces`) and retrieve via Observations API v2 (`GET /api/public/v2/observations`) and Metrics API v2 (`GET /api/public/v2/metrics`). Other public API write and read endpoints can delay data by about 10 minutes. Direct OpenTelemetry exporters must send the `x-langfuse-ingestion-version: 4` header; current Python and JS SDKs already do. See the [Public API docs](https://langfuse.com/docs/api-and-data-platform/features/public-api) and [real-time ingestion](https://langfuse.com/integrations/native/opentelemetry.md#real-time-ingestion). ## Authentication Authenticate with the API using [Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication), get API keys in the project settings: - username: Langfuse Public Key - password: Langfuse Secret Key ## Exports - OpenAPI spec: https://cloud.langfuse.com/generated/api/openapi.yml - Self-hosted deployments: interactive API reference at `/api/docs` and OpenAPI spec at `/api/openapi.yaml`
5 *
6 * The version of the OpenAPI document:
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
15pub struct CreateBlobStorageIntegrationRequest {
16 /// ID of the project in which to configure the blob storage integration
17 #[serde(rename = "projectId")]
18 pub project_id: String,
19 #[serde(rename = "type")]
20 pub r#type: models::BlobStorageIntegrationType,
21 /// Name of the storage bucket. For AZURE_BLOB_STORAGE, must be a valid Azure container name (3-63 chars, lowercase letters, numbers, and hyphens only, must start and end with a letter or number, no consecutive hyphens).
22 #[serde(rename = "bucketName")]
23 pub bucket_name: String,
24 /// Custom endpoint URL (required for S3_COMPATIBLE type)
25 #[serde(
26 rename = "endpoint",
27 default,
28 with = "::serde_with::rust::double_option",
29 skip_serializing_if = "Option::is_none"
30 )]
31 pub endpoint: Option<Option<String>>,
32 /// Storage region used by S3-compatible clients (AWS, GCS, Cloudflare R2, MinIO, Azure location IDs such as eastus, OCI). Leading and trailing whitespace is removed. The remaining value must be 1-63 letters, numbers, or hyphens, and cannot start or end with a hyphen. Examples: us-east-1, europe-west1, eastus, auto.
33 #[serde(rename = "region")]
34 pub region: String,
35 /// Access key ID for authentication
36 #[serde(
37 rename = "accessKeyId",
38 default,
39 with = "::serde_with::rust::double_option",
40 skip_serializing_if = "Option::is_none"
41 )]
42 pub access_key_id: Option<Option<String>>,
43 /// Secret access key for authentication (will be encrypted when stored)
44 #[serde(
45 rename = "secretAccessKey",
46 default,
47 with = "::serde_with::rust::double_option",
48 skip_serializing_if = "Option::is_none"
49 )]
50 pub secret_access_key: Option<Option<String>>,
51 /// Path prefix for exported files (must end with forward slash if provided)
52 #[serde(
53 rename = "prefix",
54 default,
55 with = "::serde_with::rust::double_option",
56 skip_serializing_if = "Option::is_none"
57 )]
58 pub prefix: Option<Option<String>>,
59 #[serde(rename = "exportFrequency")]
60 pub export_frequency: models::BlobStorageExportFrequency,
61 /// Whether the integration is active
62 #[serde(rename = "enabled")]
63 pub enabled: bool,
64 /// Use path-style URLs for S3 requests
65 #[serde(rename = "forcePathStyle")]
66 pub force_path_style: bool,
67 #[serde(rename = "fileType")]
68 pub file_type: models::BlobStorageIntegrationFileType,
69 #[serde(rename = "exportMode")]
70 pub export_mode: models::BlobStorageExportMode,
71 /// Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE). Must not be in the future (27 h tolerance for timezone differences).
72 #[serde(
73 rename = "exportStartDate",
74 default,
75 with = "::serde_with::rust::double_option",
76 skip_serializing_if = "Option::is_none"
77 )]
78 pub export_start_date: Option<Option<chrono::DateTime<chrono::FixedOffset>>>,
79 /// Enable gzip compression for exported files (.csv.gz, .json.gz, .jsonl.gz). Defaults to true.
80 #[serde(
81 rename = "compressed",
82 default,
83 with = "::serde_with::rust::double_option",
84 skip_serializing_if = "Option::is_none"
85 )]
86 pub compressed: Option<Option<bool>>,
87 #[serde(rename = "exportSource", skip_serializing_if = "Option::is_none")]
88 pub export_source: Option<models::BlobStorageExportSource>,
89 /// Field groups to include in each exported observation row. Applies to all export sources; must include `core` if provided. When omitted on create, the column default (all groups) applies. When omitted on update, the existing value is preserved. `exportFieldGroups` requires `exportSource` to be provided in the same request.
90 #[serde(
91 rename = "exportFieldGroups",
92 default,
93 with = "::serde_with::rust::double_option",
94 skip_serializing_if = "Option::is_none"
95 )]
96 pub export_field_groups: Option<Option<Vec<models::BlobStorageExportFieldGroup>>>,
97}
98
99impl CreateBlobStorageIntegrationRequest {
100 pub fn new(
101 project_id: String,
102 r#type: models::BlobStorageIntegrationType,
103 bucket_name: String,
104 region: String,
105 export_frequency: models::BlobStorageExportFrequency,
106 enabled: bool,
107 force_path_style: bool,
108 file_type: models::BlobStorageIntegrationFileType,
109 export_mode: models::BlobStorageExportMode,
110 ) -> CreateBlobStorageIntegrationRequest {
111 CreateBlobStorageIntegrationRequest {
112 project_id,
113 r#type,
114 bucket_name,
115 endpoint: None,
116 region,
117 access_key_id: None,
118 secret_access_key: None,
119 prefix: None,
120 export_frequency,
121 enabled,
122 force_path_style,
123 file_type,
124 export_mode,
125 export_start_date: None,
126 compressed: None,
127 export_source: None,
128 export_field_groups: None,
129 }
130 }
131}