langfuse-client-base 0.12.0

Auto-generated Langfuse API client from OpenAPI specification
Documentation
/*
 * 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
    #[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<String>>,
    /// 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>>,
}

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,
        }
    }
}