/*
* langfuse
*
* ## 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
*
* The version of the OpenAPI document:
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct CreateBlobStorageIntegrationRequest {
/// ID of the project in which to configure the blob storage integration
#[serde(rename = "projectId")]
pub project_id: String,
#[serde(rename = "type")]
pub r#type: models::BlobStorageIntegrationType,
/// 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).
#[serde(rename = "bucketName")]
pub bucket_name: String,
/// Custom endpoint URL (required for S3_COMPATIBLE type)
#[serde(
rename = "endpoint",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub endpoint: Option<Option<String>>,
/// Storage region
#[serde(rename = "region")]
pub region: String,
/// Access key ID for authentication
#[serde(
rename = "accessKeyId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub access_key_id: Option<Option<String>>,
/// Secret access key for authentication (will be encrypted when stored)
#[serde(
rename = "secretAccessKey",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub secret_access_key: Option<Option<String>>,
/// Path prefix for exported files (must end with forward slash if provided)
#[serde(
rename = "prefix",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub prefix: Option<Option<String>>,
#[serde(rename = "exportFrequency")]
pub export_frequency: models::BlobStorageExportFrequency,
/// Whether the integration is active
#[serde(rename = "enabled")]
pub enabled: bool,
/// Use path-style URLs for S3 requests
#[serde(rename = "forcePathStyle")]
pub force_path_style: bool,
#[serde(rename = "fileType")]
pub file_type: models::BlobStorageIntegrationFileType,
#[serde(rename = "exportMode")]
pub export_mode: models::BlobStorageExportMode,
/// Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE)
#[serde(
rename = "exportStartDate",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub export_start_date: Option<Option<chrono::DateTime<chrono::FixedOffset>>>,
/// Enable gzip compression for exported files (.csv.gz, .json.gz, .jsonl.gz). Defaults to true.
#[serde(
rename = "compressed",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub compressed: Option<Option<bool>>,
#[serde(rename = "exportSource", skip_serializing_if = "Option::is_none")]
pub export_source: Option<models::BlobStorageExportSource>,
/// Field groups to include in each exported row. For exportSource `OBSERVATIONS_V2` or `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS`: must include `core` if provided. When omitted on create, the column default (all groups) applies. When omitted on update, the existing value is preserved. For exportSource `LEGACY_TRACES_OBSERVATIONS`: this field must be omitted or null. Sending an array (including an empty array) returns 400, because that source uses a fixed column set and does not honor field groups. `exportFieldGroups` requires `exportSource` to be provided in the same request.
#[serde(
rename = "exportFieldGroups",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub export_field_groups: Option<Option<Vec<models::BlobStorageExportFieldGroup>>>,
}
impl CreateBlobStorageIntegrationRequest {
pub fn new(
project_id: String,
r#type: models::BlobStorageIntegrationType,
bucket_name: String,
region: String,
export_frequency: models::BlobStorageExportFrequency,
enabled: bool,
force_path_style: bool,
file_type: models::BlobStorageIntegrationFileType,
export_mode: models::BlobStorageExportMode,
) -> CreateBlobStorageIntegrationRequest {
CreateBlobStorageIntegrationRequest {
project_id,
r#type,
bucket_name,
endpoint: None,
region,
access_key_id: None,
secret_access_key: None,
prefix: None,
export_frequency,
enabled,
force_path_style,
file_type,
export_mode,
export_start_date: None,
compressed: None,
export_source: None,
export_field_groups: None,
}
}
}