reasoninglayer 1.0.3

Rust client SDK for the Reasoning Layer API
Documentation
//! Hand-written extensions on top of the generated DTOs.
//!
//! Lives next to [`super::generated`] so that:
//! * convenience constructors (`with_name`, `new`, …),
//! * cross-cutting prose docs that don't belong on a single schema,
//! * and any `From`/`Into` bridges or trait impls
//!
//! can be added without touching the auto-generated file. Rust's open-ended
//! `impl` rules let us extend the generated structs from this sibling module
//! freely. **Add to this file, not to `generated.rs`** — the latter is
//! overwritten on every `cargo codegen` run.

use super::generated::CreateSortRequest;

impl CreateSortRequest {
    /// A sort with only a name; everything else is the typify-generated default.
    ///
    /// ```
    /// use reasoninglayer::api_spec::CreateSortRequest;
    /// let req = CreateSortRequest::with_name("person");
    /// assert_eq!(req.name.as_deref(), Some("person"));
    /// ```
    pub fn with_name(name: impl Into<String>) -> Self {
        Self {
            name: Some(name.into()),
            ..Default::default()
        }
    }
}