langfuse_client_base/models/
create_blob_storage_integration_request.rs

1/*
2 * langfuse
3 *
4 * ## 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 - Postman collection: https://cloud.langfuse.com/generated/postman/collection.json
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
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
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)
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<String>>,
79}
80
81impl CreateBlobStorageIntegrationRequest {
82    pub fn new(
83        project_id: String,
84        r#type: models::BlobStorageIntegrationType,
85        bucket_name: String,
86        region: String,
87        export_frequency: models::BlobStorageExportFrequency,
88        enabled: bool,
89        force_path_style: bool,
90        file_type: models::BlobStorageIntegrationFileType,
91        export_mode: models::BlobStorageExportMode,
92    ) -> CreateBlobStorageIntegrationRequest {
93        CreateBlobStorageIntegrationRequest {
94            project_id,
95            r#type,
96            bucket_name,
97            endpoint: None,
98            region,
99            access_key_id: None,
100            secret_access_key: None,
101            prefix: None,
102            export_frequency,
103            enabled,
104            force_path_style,
105            file_type,
106            export_mode,
107            export_start_date: None,
108        }
109    }
110}