Skip to main content

windmill_api/models/
embed_token_response.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.741.0
7 * Contact: contact@windmill.dev
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 EmbedTokenResponse {
16    /// Narrowly-scoped embed token for the iframe. Absent for fully anonymous or raw apps, which load without a scoped token.
17    #[serde(rename = "token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
18    pub token: Option<Option<String>>,
19    /// Expiration of the embed token.
20    #[serde(rename = "expiration", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub expiration: Option<Option<String>>,
22    /// Raw apps render single-iframe and skip the opaque-viewer indirection and the embed token entirely.
23    #[serde(rename = "raw_app")]
24    pub raw_app: bool,
25    /// Publisher opted this app into sandbox isolation. When false the viewer runs the app same-origin with its full session.
26    #[serde(rename = "sandbox")]
27    pub sandbox: bool,
28    /// The resolved app path; the embedder uses it to scope the app's backing localStorage per app.
29    #[serde(rename = "app_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub app_path: Option<Option<String>>,
31    /// The resolved workspace; pairs with app_path so apps at the same path in different workspaces don't share a localStorage store.
32    #[serde(rename = "workspace_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub workspace_id: Option<Option<String>>,
34}
35
36impl EmbedTokenResponse {
37    pub fn new(raw_app: bool, sandbox: bool) -> EmbedTokenResponse {
38        EmbedTokenResponse {
39            token: None,
40            expiration: None,
41            raw_app,
42            sandbox,
43            app_path: None,
44            workspace_id: None,
45        }
46    }
47}
48