pub async fn new<K, S>(client_id: K, client_secret: S) -> Self
    where
        K: ToString,
        S: ToString,
    {
        let client = Client::builder().build();
        match client {
            Ok(c) => {
                let mut ramp = Self {
                    client_id: client_id.to_string(),
                    client_secret: client_secret.to_string(),
                    token: "".to_string(),

                    client: Arc::new(c),
                };

                // Let's get the token.
                ramp.get_token().await.unwrap();

                ramp
            }
            Err(e) => panic!("creating client failed: {:?}", e),
        }
    }
/// Create a new Ramp client struct. It takes a type that can convert into
/// an &str (`String` or `Vec<u8>` for example). As long as the function is
/// given a valid API client ID and secret your requests will work.
Create a new Ramp client struct. It takes a type that can convert into
an &str (`String` or `Vec` for example). As long as the function is
given a valid API client ID and secret your requests will work.
Create a new Ramp client struct . It takes a type that can convert into an &str ( ` String ` or ` Vec ` for example ) . As long as the function is given a valid API client ID and secret your requests will work .
pub async fn new<K, S>(client_id: K, client_secret: S) -> Self
    where
        K: ToString,
        S: ToString,
    {
        let client = Client::builder().build();
        match client {
            Ok(c) => {
                let mut ramp = Self {
                    client_id: client_id.to_string(),
                    client_secret: client_secret.to_string(),
                    token: "".to_string(),
                    client: Arc::new(c),
                };
                // Let's get the token.
                ramp.get_token().await.unwrap();
                ramp
            }
            Err(e) => panic!("creating client failed: {:?}", e),
        }
    }
pub async fn new < K , S > ( client_id : K , client_secret : S ) -> Self where K : ToString , S : ToString , { let client = Client :: builder ( ) . build ( ) ; match client { Ok ( c ) => { let mut ramp = Self { client_id : client_id . to_string ( ) , client_secret : client_secret . to_string ( ) , token : " " . to_string ( ) , client : Arc :: new ( c ) , } ; // Let's get the token. ramp . get_token ( ) . await . unwrap ( ) ; ramp } Err ( e ) => panic ! ( " " e ) , } }
Create a new Ramp client struct.
Create a new Ramp client struct .
client_id
K
client_secret
S
client_id
K
client_secret
S