deriv_api_schema/api_token_request.rs
1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/api_token/send.json
4
5// Use direct crate names for imports
6use serde::{Deserialize, Serialize};
7use serde_json::Value;
8
9
10
11// Import required types from the *same* crate
12use crate::valid_for_current_ip_only::ValidForCurrentIpOnly;
13use crate::new_token_scope_item::NewTokenScopeItem;
14
15/// This call manages API tokens
16#[derive(Debug, Clone, Serialize, Deserialize)]
17#[serde(rename_all = "snake_case")]
18pub struct ApiTokenRequest {
19 /// Must be `1`\n
20 // Correct serde attribute construction - Use helper
21
22 pub api_token: i64,
23 /// [Optional] The token to remove.\n
24 // Correct serde attribute construction - Use helper
25 #[serde(skip_serializing_if = "Option::is_none")]
26 pub delete_token: Option<String>,
27 /// [Optional] The login id of the user. Mandatory when multiple tokens were provided during authorize.\n
28 // Correct serde attribute construction - Use helper
29 #[serde(skip_serializing_if = "Option::is_none")]
30 pub loginid: Option<String>,
31 /// [Optional] The name of the created token.\n
32 // Correct serde attribute construction - Use helper
33 #[serde(skip_serializing_if = "Option::is_none")]
34 pub new_token: Option<String>,
35 /// [Optional] List of permission scopes to provide with the token.\n
36 // Correct serde attribute construction - Use helper
37 #[serde(skip_serializing_if = "Option::is_none")]
38 pub new_token_scopes: Option<Vec<NewTokenScopeItem>>,
39 /// [Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.\n
40 // Correct serde attribute construction - Use helper
41 #[serde(skip_serializing_if = "Option::is_none")]
42 pub passthrough: Option<Value>,
43 /// [Optional] Used to map request to response.\n
44 // Correct serde attribute construction - Use helper
45 #[serde(skip_serializing_if = "Option::is_none")]
46 pub req_id: Option<i64>,
47 /// [Optional] If you set this parameter during token creation, then the token created will only work for the IP address that was used to create the token\n
48 // Correct serde attribute construction - Use helper
49 #[serde(skip_serializing_if = "Option::is_none")]
50 pub valid_for_current_ip_only: Option<ValidForCurrentIpOnly>,
51}
52