pub struct AMPAPI {
pub base_uri: String,
pub data_source: String,
pub username: String,
pub password: String,
pub remember_me_token: String,
pub session_id: String,
/* private fields */
}
Expand description
AMPAPI - Struct for interacting with the AMP API
Fields§
§base_uri: String
base_uri - The base URI of the AMP instance
data_source: String
data_source - The data source URI of the AMP instance
username: String
username - The username to use for authentication
password: String
password - The password to use for authentication
remember_me_token: String
remember_me_token - The remember me token to use for authentication
session_id: String
session_id - The session ID to use for authentication
Implementations§
Source§impl AMPAPI
AMPAPI methods
impl AMPAPI
AMPAPI methods
Sourcepub fn new(
base_uri: String,
username: String,
password: String,
remember_me_token: String,
session_id: String,
) -> AMPAPI
pub fn new( base_uri: String, username: String, password: String, remember_me_token: String, session_id: String, ) -> AMPAPI
AMPAPI.new - Create a new AMPAPI struct
base_uri
- The base URI of the AMP instanceusername
- The username to use for authenticationpassword
- The password to use for authentication- Optional if using a remember me token
remember_me_token
- The remember me token to use for authentication- Optional
session_id
- The session ID to use for authentication- Optional, will be instantiated on login Returns AMPAPI
Sourcepub fn api_call<T: DeserializeOwned>(
&mut self,
endpoint: String,
args: HashMap<String, Value>,
) -> Result<T, Error>
pub fn api_call<T: DeserializeOwned>( &mut self, endpoint: String, args: HashMap<String, Value>, ) -> Result<T, Error>
AMPAPI.api_call - This function takes an endpoint and a map of arguments and returns the response
endpoint
- The endpoint to callargs
- A map of arguments to pass to the endpoint Returns Result<T, reqwest::Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AMPAPI
impl RefUnwindSafe for AMPAPI
impl Send for AMPAPI
impl Sync for AMPAPI
impl Unpin for AMPAPI
impl UnwindSafe for AMPAPI
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more