Function call_api_endpoint

Source
pub async fn call_api_endpoint<'a, R: DeserializeOwned>(
    api_key: &String,
    endpoint: CCAPIEndpoint,
    unit: CCUnit,
    params: Vec<Param<'a>>,
    additional_params: Option<String>,
) -> Result<R, Error>
Expand description

Constructs a URL for API request, sends the request, and returns the deserialzied response.

ยงInput

  • api_key: CCData API key
  • endpoint: Enum that represents the CCData API endpoint for function to send the request to
  • unit: Unit for data to be binned by (e.g., Day, Hour)
  • params: List of parameters expected by the CCData API endpoint
  • additional_params: Additional parameters to add to the request