p7m_appointment/models/extra_question.rs
1/*
2 * Appointments Backend
3 *
4 * # API for appointment scheduling related data This is the API of the service at P7M that manages the scheduling and management of appointments. It is used by the booking widget (see the **WidgetApi** tag) with functions that are public and don't require the user to be authenticated. For endpoints in other tags the caller has to be authenticated with the system and provide a JWT token in the Authorization header of the HTTP request. When using the API you typically get this token by authenticating first with OAuth 2.0. When you are trying this API using the Swagger interface, you need to click the `Authorize` button and then again the Authorize button in the pop-up that gets opened.
5 *
6 * The version of the OpenAPI document: 0.13.5
7 * Contact: tech@p7m.de
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ExtraQuestion {
16 /// The question that gets asked to the patient on booking an appointment
17 #[serde(rename = "text")]
18 pub text: String,
19 /// Whether the patient has to select exactly one answer, or multiple answers are allowed
20 #[serde(rename = "exactly_one")]
21 pub exactly_one: bool,
22 /// The answer options
23 #[serde(rename = "options")]
24 pub options: Vec<models::AnswerOption>,
25}
26
27impl ExtraQuestion {
28 pub fn new(text: String, exactly_one: bool, options: Vec<models::AnswerOption>) -> ExtraQuestion {
29 ExtraQuestion {
30 text,
31 exactly_one,
32 options,
33 }
34 }
35}
36