pub struct TokenRequest {
pub grant_type: String,
pub refresh_token: String,
pub client_id: String,
}Expand description
The form the client sends to the token service to trade a refresh token for an access token.
The client builds and sends it for you. It is public so you can see the exact wire form. It is sent as
application/x-www-form-urlencoded.
§Examples
use brokapi_bcs_protocol::http::models::TokenRequest;
let form = TokenRequest {
grant_type: "refresh_token".into(),
refresh_token: "my-refresh-token".into(),
client_id: "trade-api-read".into(),
};
assert_eq!(
serde_urlencoded::to_string(&form)?,
"grant_type=refresh_token&refresh_token=my-refresh-token&client_id=trade-api-read"
);Fields§
§grant_type: StringAlways refresh_token here: the OAuth grant that renews a token.
refresh_token: StringThe refresh token. A secret.
client_id: Stringtrade-api-read for a read token, trade-api-write for a trading token.
Trait Implementations§
Source§impl Clone for TokenRequest
impl Clone for TokenRequest
Source§fn clone(&self) -> TokenRequest
fn clone(&self) -> TokenRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TokenRequest
impl Debug for TokenRequest
Auto Trait Implementations§
impl Freeze for TokenRequest
impl RefUnwindSafe for TokenRequest
impl Send for TokenRequest
impl Sync for TokenRequest
impl Unpin for TokenRequest
impl UnsafeUnpin for TokenRequest
impl UnwindSafe for TokenRequest
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