Skip to main content

nhl_stats/async/
stats_api.rs

1/*
2 * NHL API
3 *
4 * Documenting the publicly accessible portions of the NHL API.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use std::rc::Rc;
12use std::borrow::Borrow;
13
14use hyper;
15use serde_json;
16use futures::Future;
17
18use super::{Error, configuration};
19use super::request as __internal_request;
20
21pub struct StatsApiClient<C: hyper::client::Connect> {
22    configuration: Rc<configuration::Configuration<C>>,
23}
24
25impl<C: hyper::client::Connect> StatsApiClient<C> {
26    pub fn new(configuration: Rc<configuration::Configuration<C>>) -> StatsApiClient<C> {
27        StatsApiClient {
28            configuration: configuration,
29        }
30    }
31}
32
33pub trait StatsApi {
34    fn get_stat_types(&self, ) -> Box<Future<Item = crate::models::StatTypes, Error = Error<serde_json::Value>>>;
35}
36
37
38impl<C: hyper::client::Connect>StatsApi for StatsApiClient<C> {
39    fn get_stat_types(&self, ) -> Box<Future<Item = crate::models::StatTypes, Error = Error<serde_json::Value>>> {
40        __internal_request::Request::new(hyper::Method::Get, "/statTypes".to_string())
41            .execute(self.configuration.borrow())
42    }
43
44}