//! Server implementation of openapi_client. #![allow(unused_imports)] use futures::{self, Future}; use chrono; use std::collections::HashMap; use std::marker::PhantomData; use swagger; use swagger::{Has, XSpanIdString}; use openapi_client::{Api, ApiError, DataSourcesDataSourceIdEntitiesEntityIdChangesPostResponse, DataSourcesDataSourceIdSynchronizationStateGetResponse, DataSourcesGetResponse, DataSourcesPostResponse }; use openapi_client::models; #[derive(Copy, Clone)] pub struct Server { marker: PhantomData, } impl Server { pub fn new() -> Self { Server{marker: PhantomData} } } impl Api for Server where C: Has{ /// Sync changes from data source fn data_sources_data_source_id_entities_entity_id_changes_post(&self, data_source_id: String, entity_id: String, data_source: Option<&Vec>, context: &C) -> Box> { let context = context.clone(); println!("data_sources_data_source_id_entities_entity_id_changes_post(\"{}\", \"{}\", {:?}) - X-Span-ID: {:?}", data_source_id, entity_id, data_source, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Lists synchronization status for your data sources fn data_sources_data_source_id_synchronization_state_get(&self, data_source_id: String, context: &C) -> Box> { let context = context.clone(); println!("data_sources_data_source_id_synchronization_state_get(\"{}\") - X-Span-ID: {:?}", data_source_id, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// List registered datasources fn data_sources_get(&self, context: &C) -> Box> { let context = context.clone(); println!("data_sources_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Register a data source fn data_sources_post(&self, data_source: Option, context: &C) -> Box> { let context = context.clone(); println!("data_sources_post({:?}) - X-Span-ID: {:?}", data_source, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } }