OpenAgentID documentation
Source referencesRust module referenceoas-document

oas-document · calendar

Declared module signatures, types, configuration, and source documentation.

Source: oas/oas/oas-document/src/calendar.rs. SHA-256: a47a74b8f5b6ee89de670909f0e7440e59138bbfcf5445dbd729930b7df83c11.

This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.

calendar::ScheduleWindow

A recurring time window (e.g., office hours on a specific day).

Examples

use oas_document::calendar::ScheduleWindow;

let window = ScheduleWindow {
    day: "monday".to_string(),
    start: "09:00".to_string(),
    end: "17:00".to_string(),
    timezone: "America/New_York".to_string(),
};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ScheduleWindow {
/// Day of week: `"monday"` through `"sunday"`, or `"daily"` for every day.

pub day: String,
/// Start time in 24h format (e.g., `"09:00"`).

pub start: String,
/// End time in 24h format (e.g., `"17:00"`).

pub end: String,
/// IANA timezone for this window (e.g., `"America/New_York"`).

pub timezone: String
}

Source line: 29.

calendar::BookingEndpoint

A booking or scheduling endpoint.

Each booking entry can have its own visibility — an agent might expose a public booking link for external clients but restrict an internal scheduling API to organization members only.

Examples

use oas_document::calendar::BookingEndpoint;
use oas_document::visibility::Visibility;

let booking = BookingEndpoint {
    id: "booking-public".to_string(),
    url: "https://cal.com/agent42/30min".to_string(),
    label: Some("30-min consultation".to_string()),
    booking_type: Some("consultation".to_string()),
    visibility: Visibility::Public,
};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BookingEndpoint {
/// Fragment identifier (e.g., "booking-public", "booking-internal").

pub id: String,
/// The booking URL (e.g., Calendly, Cal.com, custom API).

pub url: String,
/// Human-readable label (e.g., "30-min consultation", "Priority support").

#[serde(skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
/// Type of booking: `"consultation"`, `"support"`, `"meeting"`, `"task"`, `"custom"`.

#[serde(skip_serializing_if = "Option::is_none")]
pub booking_type: Option<String>,
/// Who can access this booking endpoint.

#[serde(default)]
pub visibility: Visibility
}

Source line: 65.

calendar::CalendarSection

Calendar and scheduling section of an OAS Identity Document.

Examples

use oas_document::calendar::{CalendarSection, BookingEndpoint, ScheduleWindow};
use oas_document::visibility::Visibility;

let calendar = CalendarSection {
    booking_endpoints: vec![
        BookingEndpoint {
            id: "booking-external".to_string(),
            url: "https://cal.com/agent42/intro".to_string(),
            label: Some("Intro call".to_string()),
            booking_type: Some("consultation".to_string()),
            visibility: Visibility::Public,
        },
        BookingEndpoint {
            id: "booking-internal".to_string(),
            url: "https://internal.acme.com/schedule/agent42".to_string(),
            label: Some("Internal sync".to_string()),
            booking_type: Some("meeting".to_string()),
            visibility: Visibility::Organization,
        },
    ],
    availability_feed: Some("https://cal.com/agent42/availability.ics".to_string()),
    scheduling_protocol: Some("ical-invite".to_string()),
    office_hours: vec![
        ScheduleWindow {
            day: "monday".to_string(),
            start: "09:00".to_string(),
            end: "17:00".to_string(),
            timezone: "America/New_York".to_string(),
        },
    ],
    timezone: Some("America/New_York".to_string()),
};
assert_eq!(calendar.booking_endpoints.len(), 2);
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CalendarSection {
/// Booking endpoints, each with independent visibility.

#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub booking_endpoints: Vec<BookingEndpoint>,
/// iCal/CalDAV URL for real-time availability (free/busy).

#[serde(skip_serializing_if = "Option::is_none")]
pub availability_feed: Option<String>,
/// Preferred scheduling protocol:

/// `"ical-invite"`, `"api"`, `"agent-negotiation"`, `"manual"`.

#[serde(skip_serializing_if = "Option::is_none")]
pub scheduling_protocol: Option<String>,
/// Recurring office hours / availability windows.

#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub office_hours: Vec<ScheduleWindow>,
/// Default IANA timezone for this entity's schedule.

#[serde(skip_serializing_if = "Option::is_none")]
pub timezone: Option<String>
}

Source line: 126.

calendar::booking_types

Standard booking types.

pub mod booking_types;

Source line: 150.

calendar::booking_types::CONSULTATION

pub const CONSULTATION: &str;

Source line: 151.

calendar::booking_types::SUPPORT

pub const SUPPORT: &str;

Source line: 152.

calendar::booking_types::MEETING

pub const MEETING: &str;

Source line: 153.

calendar::booking_types::TASK

pub const TASK: &str;

Source line: 154.

calendar::booking_types::CUSTOM

pub const CUSTOM: &str;

Source line: 155.

calendar::scheduling_protocols

Standard scheduling protocols.

pub mod scheduling_protocols;

Source line: 159.

calendar::scheduling_protocols::ICAL_INVITE

iCalendar invite via email.

pub const ICAL_INVITE: &str;

Source line: 161.

calendar::scheduling_protocols::API

Direct API call to booking endpoint.

pub const API: &str;

Source line: 163.

calendar::scheduling_protocols::AGENT_NEGOTIATION

Agent-to-agent negotiation via MAP protocols.

pub const AGENT_NEGOTIATION: &str;

Source line: 165.

calendar::scheduling_protocols::MANUAL

Manual / human-in-the-loop scheduling.

pub const MANUAL: &str;

Source line: 167.

On this page