pub struct SignedRequestBuilder<'a, E, S>where
E: HasHttpClient,
S: SigningStrategy,{ /* private fields */ }Expand description
Generic builder for creating authenticated API requests.
This builder encapsulates the common workflow:
- Parameter building with fluent API
- Request signing via
SigningStrategy - HTTP execution via
HasHttpClient
Implementations§
Source§impl<'a, E, S> SignedRequestBuilder<'a, E, S>where
E: HasHttpClient,
S: SigningStrategy,
impl<'a, E, S> SignedRequestBuilder<'a, E, S>where
E: HasHttpClient,
S: SigningStrategy,
Sourcepub fn new(exchange: &'a E, strategy: S, endpoint: impl Into<String>) -> Self
pub fn new(exchange: &'a E, strategy: S, endpoint: impl Into<String>) -> Self
Create a new signed request builder.
Sourcepub fn method(self, method: HttpMethod) -> Self
pub fn method(self, method: HttpMethod) -> Self
Set the HTTP method (default: GET).
Sourcepub fn param(self, key: impl Into<String>, value: &dyn ToString) -> Self
pub fn param(self, key: impl Into<String>, value: &dyn ToString) -> Self
Add a required parameter.
Sourcepub fn optional_param<T: ToString>(
self,
key: impl Into<String>,
value: Option<T>,
) -> Self
pub fn optional_param<T: ToString>( self, key: impl Into<String>, value: Option<T>, ) -> Self
Add an optional parameter (only if Some).
Sourcepub fn params(self, params: BTreeMap<String, String>) -> Self
pub fn params(self, params: BTreeMap<String, String>) -> Self
Add multiple parameters from a BTreeMap.
Sourcepub fn merge_json_params(self, params: Option<Value>) -> Self
pub fn merge_json_params(self, params: Option<Value>) -> Self
Merge parameters from a JSON Value object.
Only string, number, and boolean values are supported. Nested objects and arrays are ignored.
Auto Trait Implementations§
impl<'a, E, S> Freeze for SignedRequestBuilder<'a, E, S>where
S: Freeze,
impl<'a, E, S> RefUnwindSafe for SignedRequestBuilder<'a, E, S>where
S: RefUnwindSafe,
E: RefUnwindSafe,
impl<'a, E, S> Send for SignedRequestBuilder<'a, E, S>where
E: Sync,
impl<'a, E, S> Sync for SignedRequestBuilder<'a, E, S>where
E: Sync,
impl<'a, E, S> Unpin for SignedRequestBuilder<'a, E, S>where
S: Unpin,
impl<'a, E, S> UnwindSafe for SignedRequestBuilder<'a, E, S>where
S: UnwindSafe,
E: RefUnwindSafe,
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