Skip to main content

Crate floopfloop

Crate floopfloop 

Source
Expand description

Official Rust SDK for the FloopFloop API.

§Quickstart

use floopfloop::{Client, CreateProjectInput};

let client = Client::new(std::env::var("FLOOP_API_KEY")?)?;

let created = client.projects().create(CreateProjectInput {
    prompt: "A landing page for a cat cafe".into(),
    subdomain: Some("cat-cafe".into()),
    bot_type: Some("site".into()),
    ..Default::default()
}).await?;

let live = client.projects().wait_for_live(&created.project.id, None).await?;
println!("Live at: {}", live.url.unwrap_or_default());

§Resources

  • projects — create / list / get / status / refine / cancel / reactivate / conversations / stream / wait_for_live
  • subdomains — check / suggest
  • secrets — list / set / remove
  • library — list / clone
  • usage — summary
  • api_keys — list / create / remove (remove accepts id OR name)
  • uploads — create (S3 presign + direct PUT)
  • user — me

Every resource method returns Result<T, FloopError> on failure. FloopError.code is a FloopErrorCode enum with a catch-all Other variant so unknown server codes still round-trip losslessly.

Structs§

ApiKeySummary
ApiKeys
Client
The main entry point. Construct once with Client::new or Client::builder and reuse across tasks; all methods are &self.
ClientBuilder
Configuration for Client::builder. Defaults:
CloneLibraryProjectInput
ClonedProject
ConversationMessage
ConversationsOptions
ConversationsResult
CreateApiKeyInput
CreateProjectInput
CreateUploadInput
Single file to upload. Explicit file_type overrides the extension guess. The payload is held as Bytes — streaming reqwest Body support can be layered on later if needed.
CreatedProject
Deployment
FloopError
The one error type every SDK call returns on failure. Pattern-match on .code to branch:
IssuedApiKey
Returned ONCE on Create — the raw_key is the only time the full secret ever leaves the server. Surface it to the user and do not persist it.
Library
LibraryListOptions
LibraryProject
ListProjectsOptions
Project
Projects
RefineAttachment
RefineInput
RefineResult
Three-shape discriminated result from Projects::refine. Exactly one of queued, saved_only, or processing is Some — pattern-match to branch.
SecretSummary
Secrets
StatusEvent
StreamOptions
Configures Projects::stream and Projects::wait_for_live.
SubdomainCheckResult
SubdomainSuggestResult
Subdomains
UploadedAttachment
Uploads
Usage
UsageSummary
User
UserApi
Named UserApi rather than User because the User type already owns the slot. Accessed via client.user() — matches the Go SDK’s client.User convention.

Enums§

FloopErrorCode
Error codes returned by the FloopFloop API plus a few the SDK itself produces for transport-level failures. Unknown server codes pass through verbatim in FloopError::code so callers can handle new codes without an SDK update.

Constants§

MAX_UPLOAD_BYTES
Per-file ceiling enforced by the backend. Matches the Node / Python / Go SDKs and the CLI.
VERSION
Library semver, kept in sync with the latest v* git tag.

Type Aliases§

StreamHandler
Callback invoked on every de-duplicated status snapshot — including the terminal event. Return Ok(()) to continue polling, or any Err to stop early (the error propagates from stream).
WaitForLiveOptions
Alias kept for parity with the Go SDK’s WaitForLiveOptions name.