mirror of
https://github.com/Tribufu/TribufuRust
synced 2026-08-09 21:01:07 +00:00
Generate api client with openapi-generator (#3)
* Generate api client with openapi-generator * Add wrapper struct * Add basic example
This commit is contained in:
parent
e701f20c1a
commit
23af141e2d
69 changed files with 6886 additions and 880 deletions
78
src/models/ip_address.rs
Normal file
78
src/models/ip_address.rs
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* 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 IpAddress {
|
||||
#[serde(rename = "address", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub address: Option<Option<String>>,
|
||||
#[serde(rename = "version", skip_serializing_if = "Option::is_none")]
|
||||
pub version: Option<i32>,
|
||||
#[serde(rename = "network", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub network: Option<Option<String>>,
|
||||
#[serde(rename = "reserved", skip_serializing_if = "Option::is_none")]
|
||||
pub reserved: Option<bool>,
|
||||
#[serde(rename = "asn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub asn: Option<Option<String>>,
|
||||
#[serde(rename = "isp", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub isp: Option<Option<String>>,
|
||||
#[serde(rename = "continent", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub continent: Option<Option<String>>,
|
||||
#[serde(rename = "country", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub country: Option<Option<String>>,
|
||||
#[serde(rename = "region", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub region: Option<Option<String>>,
|
||||
#[serde(rename = "city", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub city: Option<Option<String>>,
|
||||
#[serde(rename = "postal_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub postal_code: Option<Option<String>>,
|
||||
#[serde(rename = "calling_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub calling_code: Option<Option<String>>,
|
||||
#[serde(rename = "tld", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub tld: Option<Option<String>>,
|
||||
#[serde(rename = "language", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub language: Option<Option<String>>,
|
||||
#[serde(rename = "timezone", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub timezone: Option<Option<String>>,
|
||||
#[serde(rename = "currency", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub currency: Option<Option<String>>,
|
||||
#[serde(rename = "latitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub latitude: Option<Option<f32>>,
|
||||
#[serde(rename = "longitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub longitude: Option<Option<f32>>,
|
||||
}
|
||||
|
||||
impl IpAddress {
|
||||
pub fn new() -> IpAddress {
|
||||
IpAddress {
|
||||
address: None,
|
||||
version: None,
|
||||
network: None,
|
||||
reserved: None,
|
||||
asn: None,
|
||||
isp: None,
|
||||
continent: None,
|
||||
country: None,
|
||||
region: None,
|
||||
city: None,
|
||||
postal_code: None,
|
||||
calling_code: None,
|
||||
tld: None,
|
||||
language: None,
|
||||
timezone: None,
|
||||
currency: None,
|
||||
latitude: None,
|
||||
longitude: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue