All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rust.hyper.client.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
use std::rc::Rc;

use hyper;
use super::configuration::Configuration;

pub struct APIClient {
{{#apiInfo}}
{{#apis}}
{{#operations}}
{{#operation}}
    {{#-last}}
    {{{classFilename}}}: Box,
    {{/-last}}
{{/operation}}
{{/operations}}
{{/apis}}
{{/apiInfo}}
}

impl APIClient {
    pub fn new(configuration: Configuration) -> APIClient {
        let rc = Rc::new(configuration);

        APIClient {
{{#apiInfo}}
{{#apis}}
{{#operations}}
{{#operation}}
            {{#-last}}
            {{{classFilename}}}: Box::new(crate::apis::{{{classname}}}Client::new(rc.clone())),
            {{/-last}}
{{/operation}}
{{/operations}}
{{/apis}}
{{/apiInfo}}
        }
    }

{{#apiInfo}}
{{#apis}}
{{#operations}}
{{#operation}}
{{#-last}}
    pub fn {{{classFilename}}}(&self) -> &dyn crate::apis::{{{classname}}}{
        self.{{{classFilename}}}.as_ref()
    }

{{/-last}}
{{/operation}}
{{/operations}}
{{/apis}}
{{/apiInfo}}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy