Understand the structure of generated client methods
mainGenerated client methods in Progenitor wrap their return values and errors in specific wrapper types: ResponseValue<T> for successful responses and Error<E> for failures. This allows the client to provide metadata like HTTP status codes and headers alongside the actual data.
A typical method signature looks like this:
impl Client {
pub async fn operation_name<'a>(
&'a self,
// parameters ...
) -> Result<
ResponseValue<types::SuccessResponseType>,
Error<types::ErrorResponseType>
> {
// ...
}
}impl Client {
pub async fn operation_name<'a>(
&'a self,
// parameters ...
) -> Result<
ResponseValue<types::SuccessResponseType>,
Error<types::ErrorResponseType>>
{
// ...
}
}