Skip to content
Merged

V3 #7

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
318 changes: 305 additions & 13 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
members = [
"libft-api", "libft-api-derive",
"libft-api", "libft-api-derive", "libft-api-v3", "libft-api-v3-pace"
]
resolver = "2"

Expand Down
21 changes: 21 additions & 0 deletions libft-api-v3-pace/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "libft-api-v3-pace"
version = "1.14.6"
authors = ["OpenAPI Generator team and contributors"]
description = "Pace and milestone management"
# Override this license by providing a License Object in the OpenAPI.
license = "Unlicense"
edition = "2021"

[dependencies]
serde = { version = "^1.0", features = ["derive"] }
serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] }
serde_json = "^1.0"
serde_repr = "^0.1"
url = "^2.5"
reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] }

[features]
default = ["native-tls"]
native-tls = ["reqwest/native-tls"]
rustls-tls = ["reqwest/rustls-tls"]
273 changes: 273 additions & 0 deletions libft-api-v3-pace/src/apis/campus_api.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
/*
* Intra v3 - Pace System
*
* Pace and milestone management
*
* The version of the OpenAPI document: 1.14.6
*
* Generated by: https://openapi-generator.tech
*/


use reqwest;
use serde::{Deserialize, Serialize, de::Error as _};
use crate::{apis::ResponseContent, models};
use super::{Error, configuration, ContentType};


/// struct for typed errors of method [`delete_campus_webhook_campus_campus_id_webhook_delete`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteCampusWebhookCampusCampusIdWebhookDeleteError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`get_campus_by_id_campus_campus_id_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetCampusByIdCampusCampusIdGetError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`list_campuses_campus_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListCampusesCampusGetError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`update_campus_campus_campus_id_patch`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateCampusCampusCampusIdPatchError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`update_campus_webhook_campus_campus_id_webhook_patch`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateCampusWebhookCampusCampusIdWebhookPatchError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}


/// Delete specific `Campus` webhook
pub async fn delete_campus_webhook_campus_campus_id_webhook_delete(configuration: &configuration::Configuration, campus_id: i32) -> Result<models::Campus, Error<DeleteCampusWebhookCampusCampusIdWebhookDeleteError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_campus_id = campus_id;

let uri_str = format!("{}/campus/{campus_id}/webhook", configuration.base_path, campus_id=p_path_campus_id);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);

if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};

let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;

let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);

if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Campus`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Campus`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteCampusWebhookCampusCampusIdWebhookDeleteError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

/// Retrieve specific `Campus`
pub async fn get_campus_by_id_campus_campus_id_get(configuration: &configuration::Configuration, campus_id: i32) -> Result<models::Campus, Error<GetCampusByIdCampusCampusIdGetError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_campus_id = campus_id;

let uri_str = format!("{}/campus/{campus_id}", configuration.base_path, campus_id=p_path_campus_id);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};

let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;

let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);

if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Campus`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Campus`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetCampusByIdCampusCampusIdGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

/// List all `Campus` entities
pub async fn list_campuses_campus_get(configuration: &configuration::Configuration, page: Option<i32>, size: Option<i32>, all: Option<bool>) -> Result<models::PageCampus, Error<ListCampusesCampusGetError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_page = page;
let p_query_size = size;
let p_query_all = all;

let uri_str = format!("{}/campus/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", &param_value.to_string())]);
}
if let Some(ref param_value) = p_query_size {
req_builder = req_builder.query(&[("size", &param_value.to_string())]);
}
if let Some(ref param_value) = p_query_all {
req_builder = req_builder.query(&[("all", &param_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};

let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;

let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);

if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PageCampus`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PageCampus`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListCampusesCampusGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

/// Update specific `Campus`
pub async fn update_campus_campus_campus_id_patch(configuration: &configuration::Configuration, campus_id: i32, update_campus: models::UpdateCampus) -> Result<models::Campus, Error<UpdateCampusCampusCampusIdPatchError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_campus_id = campus_id;
let p_body_update_campus = update_campus;

let uri_str = format!("{}/campus/{campus_id}", configuration.base_path, campus_id=p_path_campus_id);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);

if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_update_campus);

let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;

let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);

if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Campus`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Campus`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateCampusCampusCampusIdPatchError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

/// Update specific `Campus` webhook
pub async fn update_campus_webhook_campus_campus_id_webhook_patch(configuration: &configuration::Configuration, campus_id: i32, update_campus: models::UpdateCampus) -> Result<models::Campus, Error<UpdateCampusWebhookCampusCampusIdWebhookPatchError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_campus_id = campus_id;
let p_body_update_campus = update_campus;

let uri_str = format!("{}/campus/{campus_id}/webhook", configuration.base_path, campus_id=p_path_campus_id);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);

if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_update_campus);

let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;

let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);

if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Campus`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Campus`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateCampusWebhookCampusCampusIdWebhookPatchError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

48 changes: 48 additions & 0 deletions libft-api-v3-pace/src/apis/configuration.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Intra v3 - Pace System
*
* Pace and milestone management
*
* The version of the OpenAPI document: 1.14.6
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Debug, Clone)]
pub struct Configuration {
pub base_path: String,
pub user_agent: Option<String>,
pub client: reqwest::Client,
pub basic_auth: Option<BasicAuth>,
pub oauth_access_token: Option<String>,
pub bearer_access_token: Option<String>,
pub api_key: Option<ApiKey>,
}

pub type BasicAuth = (String, Option<String>);

#[derive(Debug, Clone)]
pub struct ApiKey {
pub prefix: Option<String>,
pub key: String,
}

impl Configuration {
pub fn new() -> Configuration {
Configuration::default()
}
}

impl Default for Configuration {
fn default() -> Self {
Configuration {
base_path: "/api/v1".to_owned(),
user_agent: Some("OpenAPI-Generator/1.14.6/rust".to_owned()),
client: reqwest::Client::new(),
basic_auth: None,
oauth_access_token: None,
bearer_access_token: None,
api_key: None,
}
}
}
Loading
Loading