wait-human 0.1.1

Rust client library for WaitHuman - pause execution and request human input on demand
Documentation
// This file is auto-generated by build.rs from ../app/backend/src/shared_types.rs
// Do not edit manually - changes will be overwritten

use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

/// The structure stored in DB for question
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct ConfirmationQuestion {
    pub method: QuestionMethod,
    pub subject: String,
    pub body: Option<String>,
    pub answer_format: AnswerFormat,
}

/// The structure stored in DB for answers
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct ConfirmationAnswer {
    pub answer_content: AnswerContent,
}

#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "snake_case", tag = "type")]
pub enum QuestionMethod {
    Push,
}

#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct ConfirmationAnswerWithDate {
    pub answer: ConfirmationAnswer,
    pub answered_at: DateTime<Utc>,
}

#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "snake_case", tag = "type")]
pub enum AnswerFormat {
    FreeText,
    Options {
        options: Vec<String>,
        multiple: bool,
    },
}

#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "snake_case", tag = "type")]
pub enum AnswerContent {
    FreeText { text: String },
    Options { selected_indexes: Vec<u32> },
}