Skip to main content

clientapi_pve/models/
access_ticket_create_ticket_request.rs

1/*
2 * Proxmox Virtual Environment API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
5 *
6 * The version of the OpenAPI document: 9.x
7 * 
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 AccessTicketCreateTicketRequest {
16
17    /// This parameter is now ignored and assumed to be 1.
18    #[serde(rename = "new-format", skip_serializing_if = "Option::is_none")]
19    pub new_format: Option<models::PveBoolean>,
20
21    /// One-time password for Two-factor authentication.
22    #[serde(rename = "otp", skip_serializing_if = "Option::is_none")]
23    pub otp: Option<String>,
24
25    /// The secret password. This can also be a valid ticket.
26    #[serde(rename = "password")]
27    pub password: String,
28
29    /// Verify ticket, and check if user have access 'privs' on 'path'
30    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
31    pub path: Option<String>,
32
33    /// Verify ticket, and check if user have access 'privs' on 'path'
34    #[serde(rename = "privs", skip_serializing_if = "Option::is_none")]
35    pub privs: Option<String>,
36
37    /// You can optionally pass the realm using this parameter. Normally the realm is simply added to the username <username>@<realm>.
38    #[serde(rename = "realm", skip_serializing_if = "Option::is_none")]
39    pub realm: Option<String>,
40
41    /// The signed TFA challenge string the user wants to respond to.
42    #[serde(rename = "tfa-challenge", skip_serializing_if = "Option::is_none")]
43    pub tfa_challenge: Option<String>,
44
45    /// User name
46    #[serde(rename = "username")]
47    pub username: String,
48
49
50}
51
52impl AccessTicketCreateTicketRequest {
53    pub fn new(password: String, username: String) -> AccessTicketCreateTicketRequest {
54        AccessTicketCreateTicketRequest {
55            
56            new_format: None,
57            
58            otp: None,
59            
60            password,
61            
62            path: None,
63            
64            privs: None,
65            
66            realm: None,
67            
68            tfa_challenge: None,
69            
70            username,
71            
72        }
73    }
74}
75
76