Skip to content

Commit

Permalink
Merge pull request #132 from pragmatrix/status-details-cancelled
Browse files Browse the repository at this point in the history
Add CancelledReason to ResponseStatusDetail
  • Loading branch information
dongri authored Nov 28, 2024
2 parents 73e4881 + 7edd669 commit fe38e13
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/realtime/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ pub enum ResponseStatus {
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(tag = "type")]
pub enum ResponseStatusDetail {
#[serde(rename = "cancelled")]
Cancelled { reason: CancelledReason },
#[serde(rename = "incomplete")]
Incomplete { reason: IncompleteReason },
#[serde(rename = "failed")]
Expand All @@ -230,6 +232,13 @@ pub struct FailedError {
pub message: String,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "snake_case")]
pub enum CancelledReason {
TurnDetected,
ClientCancelled,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "snake_case")]
pub enum IncompleteReason {
Expand Down

0 comments on commit fe38e13

Please sign in to comment.