Generate api client with openapi-generator (#3)

* Generate api client with openapi-generator

* Add wrapper struct

* Add basic example
This commit is contained in:
Guilherme Werner
2025-06-03 19:47:49 -03:00
committed by GitHub
parent e701f20c1a
commit 23af141e2d
69 changed files with 6886 additions and 880 deletions

View File

@@ -0,0 +1,48 @@
/*
* Tribufu API
*
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TokenRequest {
#[serde(rename = "grant_type", skip_serializing_if = "Option::is_none")]
pub grant_type: Option<models::GrantType>,
#[serde(rename = "code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub code: Option<Option<String>>,
#[serde(rename = "username", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub username: Option<Option<String>>,
#[serde(rename = "password", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub password: Option<Option<String>>,
#[serde(rename = "refresh_token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub refresh_token: Option<Option<String>>,
#[serde(rename = "client_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub client_id: Option<Option<String>>,
#[serde(rename = "redirect_uri", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub redirect_uri: Option<Option<String>>,
#[serde(rename = "code_verifier", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub code_verifier: Option<Option<String>>,
}
impl TokenRequest {
pub fn new() -> TokenRequest {
TokenRequest {
grant_type: None,
code: None,
username: None,
password: None,
refresh_token: None,
client_id: None,
redirect_uri: None,
code_verifier: None,
}
}
}