vapi-client 0.4.2

Unofficial crate for Vapi - Voice AI for developers.
Documentation
/*
 * Vapi API
 *
 * Voice AI for developers.
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OpenAiFunctionParameters {
    /// This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties.
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
    /// This provides a description of the properties required by the function. JSON Schema can be used to specify expectations for each property. Refer to [this doc](https://ajv.js.org/json-schema.html#json-data-type) for a comprehensive guide on JSON Schema.
    #[serde(rename = "properties")]
    pub properties: std::collections::HashMap<String, models::JsonSchema>,
    /// This specifies the properties that are required by the function.
    #[serde(rename = "required", skip_serializing_if = "Option::is_none")]
    pub required: Option<Vec<String>>,
}

impl OpenAiFunctionParameters {
    pub fn new(
        r#type: TypeTrue,
        properties: std::collections::HashMap<String, models::JsonSchema>,
    ) -> OpenAiFunctionParameters {
        OpenAiFunctionParameters {
            r#type,
            properties,
            required: None,
        }
    }
}
/// This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
    #[serde(rename = "object")]
    Object,
}

impl Default for TypeTrue {
    fn default() -> TypeTrue {
        Self::Object
    }
}