use std::collections::HashMap;
use serde::{Deserialize, Serialize};
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct HojinInfoResponse {
pub errors: Option<Vec<ApiError>>,
#[serde(rename = "hojin-infos")]
pub hojin_infos: Option<Vec<HojinInfo>>,
pub id: Option<String>,
pub message: Option<String>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ApiError {
pub item: Option<String>,
pub message: Option<String>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct HojinInfo {
pub business_items: Option<Vec<String>>,
pub business_summary: Option<String>,
pub capital_stock: Option<usize>,
pub certification: Option<Vec<CertificationInfo>>,
pub close_cause: Option<String>,
pub close_date: Option<String>,
pub commendation: Option<Vec<CommendationInfo>>,
pub company_size_female: Option<usize>,
pub company_size_male: Option<usize>,
pub company_url: Option<String>,
pub corporate_number: Option<String>,
pub date_of_establishment: Option<String>,
pub employee_number: Option<usize>,
pub finance: Option<Finance>,
pub founding_year: Option<usize>,
pub kana: Option<String>,
pub location: Option<String>,
pub name: Option<String>,
pub name_en: Option<String>,
pub number_of_activity: Option<String>,
pub patent: Option<Vec<PatentInfo>>,
pub postal_code: Option<String>,
pub procurement: Option<Vec<ProcurementInfo>>,
pub qualification_grade: Option<String>,
pub representative_name: Option<String>,
pub representative_position: Option<String>,
pub status: Option<String>,
pub subsidy: Option<Vec<SubsidyInfo>>,
pub update_date: Option<String>,
pub workplace_info: Option<WorkplaceInfoBean>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CertificationInfo {
pub category: Option<String>,
pub date_of_approval: Option<String>,
pub enterprise_scale: Option<String>,
pub expiration_date: Option<String>,
pub government_departments: Option<String>,
pub target: Option<String>,
pub title: Option<String>,
}
impl HojinInfo {
pub fn name(&self) -> &str {
match &self.name {
None => { "" }
Some(v) => { v.as_str() }
}
}
pub fn corporate_number(&self) -> &str {
match &self.corporate_number {
None => { "" }
Some(v) => { v.as_str() }
}
}
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CommendationInfo {
pub category: Option<String>,
pub date_of_commendation: Option<String>,
pub government_departments: Option<String>,
pub target: Option<String>,
pub title: Option<String>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Finance {
pub accounting_standards: Option<String>,
pub fiscal_year_cover_page: Option<String>,
pub major_shareholders: Option<Vec<MajorShareholders>>,
pub management_index: Option<Vec<ManagementIndex>>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PatentInfo {
pub application_date: Option<String>,
pub application_number: Option<String>,
pub classifications: Option<Vec<HashMap<String, String>>>,
pub patent_type: Option<String>,
pub title: Option<String>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ProcurementInfo {
pub amount: Option<usize>,
pub date_of_order: Option<String>,
pub government_departments: Option<String>,
pub joint_signatures: Option<Vec<String>>,
pub title: Option<String>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct SubsidyInfo {
pub amount: Option<String>,
pub date_of_approval: Option<String>,
pub government_departments: Option<String>,
pub joint_signatures: Option<Vec<String>>,
pub note: Option<String>,
pub subsidy_resource: Option<String>,
pub target: Option<String>,
pub title: Option<String>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct WorkplaceInfoBean {
pub base_infos: Option<WorkplaceBaseInfos>,
pub compatibility_of_childcare_and_work: Option<CompatibilityOfChildcareAndWork>,
pub women_activity_infos: Option<WomenActivityInfos>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct MajorShareholders {
pub name_major_shareholders: Option<String>,
pub shareholding_ratio: Option<f32>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ManagementIndex {
pub capital_stock_summary_of_business_results: Option<usize>,
pub capital_stock_summary_of_business_results_unit_ref: Option<String>,
pub gross_operating_revenue_summary_of_business_results: Option<usize>,
pub gross_operating_revenue_summary_of_business_results_unit_ref: Option<String>,
pub net_assets_summary_of_business_results: Option<usize>,
pub net_assets_summary_of_business_results_unit_ref: Option<String>,
pub net_income_loss_summary_of_business_results: Option<isize>,
pub net_income_loss_summary_of_business_results_unit_ref: Option<String>,
pub net_premiums_written_summary_of_business_results_ins: Option<usize>,
pub net_premiums_written_summary_of_business_results_ins_unit_ref: Option<String>,
pub net_sales_summary_of_business_results: Option<usize>,
pub net_sales_summary_of_business_results_unit_ref: Option<String>,
pub number_of_employees: Option<usize>,
pub number_of_employees_unit_ref: Option<String>,
pub operating_revenue1_summary_of_business_results: Option<isize>,
pub operating_revenue1_summary_of_business_results_unit_ref: Option<String>,
pub operating_revenue2_summary_of_business_results: Option<isize>,
pub operating_revenue2_summary_of_business_results_unit_ref: Option<String>,
pub ordinary_income_loss_summary_of_business_results: Option<isize>,
pub ordinary_income_loss_summary_of_business_results_unit_ref: Option<String>,
pub ordinary_income_summary_of_business_results: Option<isize>,
pub ordinary_income_summary_of_business_results_unit_ref: Option<String>,
pub period: Option<String>,
pub total_assets_summary_of_business_results: Option<isize>,
pub total_assets_summary_of_business_results_unit_ref: Option<String>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct WorkplaceBaseInfos {
pub average_age: Option<usize>,
pub average_continuous_service_years: Option<usize>,
#[serde(rename = "average_continuous_service_years_Female")]
pub average_continuous_service_years_female: Option<usize>,
#[serde(rename = "average_continuous_service_years_Male")]
pub average_continuous_service_years_male: Option<usize>,
pub average_continuous_service_years_type: Option<String>,
pub month_average_predetermined_overtime_hours: Option<usize>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CompatibilityOfChildcareAndWork {
pub maternity_leave_acquisition_num: Option<usize>,
pub number_of_maternity_leave: Option<usize>,
pub number_of_paternity_leave: Option<usize>,
pub paternity_leave_acquisition_num: Option<usize>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct WomenActivityInfos {
pub female_share_of_manager: Option<usize>,
pub female_share_of_officers: Option<usize>,
pub female_workers_proportion: Option<f32>,
pub female_workers_proportion_type: Option<usize>,
pub gender_total_of_manager: Option<f32>,
pub gender_total_of_officers: Option<usize>,
}