Skip to main content

open_logistics/shiprocket/models/
auth_response.rs

1/*
2 * Open Logistics — Shiprocket
3 *
4 * OpenAPI description of the Shiprocket endpoints wrapped by `open-logistics`.  Source of truth for generated Python and Rust clients. Operation IDs and schema field names are intentionally snake_case so every language exposes the same names.  Two TypeScript methods (`checkServiceability` and `calculateRates`) call `GET /courier/serviceability`; OpenAPI permits one operation per path + method, so this spec exposes a single `courier_serviceability` operation. Language facades may alias it as `calculate_rates`. 
5 *
6 * The version of the OpenAPI document: 0.3.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::shiprocket::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AuthResponse {
16    #[serde(rename = "token")]
17    pub token: String,
18    #[serde(rename = "email")]
19    pub email: String,
20    #[serde(rename = "first_name")]
21    pub first_name: String,
22    #[serde(rename = "last_name")]
23    pub last_name: String,
24    #[serde(rename = "company_id")]
25    pub company_id: i32,
26}
27
28impl AuthResponse {
29    pub fn new(token: String, email: String, first_name: String, last_name: String, company_id: i32) -> AuthResponse {
30        AuthResponse {
31            token,
32            email,
33            first_name,
34            last_name,
35            company_id,
36        }
37    }
38}
39