1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! JSON-RPC Requests
use ;
use DeserializeOwned;
use Serialize;
use Debug;
pub use ;
pub use ;
pub use ;
/// Implemented by Odoo "method" types (e.g.,
/// [`Execute`](crate::service::object::Execute) or
/// [`SessionAuthenticate`](crate::service::web::SessionAuthenticate))
///
/// When building an [`JsonRpcRequest`] object, the `params` field is actually
/// set to [`JsonRpcParams::Container`], not the concrete "method" type. This
/// allows for flexibility in the [`Serialize`] impl.
///
/// For example, the `Execute` method uses [`OdooApiContainer`] as its container,
/// which injects the `service` and `method` keys into the request struct:
/// ```json
/// {
/// "jsonrpc": "2.0",
/// "method": "call",
/// "id": 1000,
/// "params": {
/// "service": "object",
/// "method": "execute",
/// "args": <Execute is serialized here>
/// }
/// }
/// ```
///
/// Whereas the `SessionAuthenticate` method's container ([`OdooWebContainer`])
/// has a transparent Serialize impl, so the `SessionAuthenticate` data is set
/// directly on the `params` key:
/// ```json
/// {
/// "jsonrpc": "2.0",
/// "method": "call",
/// "id": 1000,
/// "params": <SessionAuthenticate is serialized here>
/// }
/// ```
/// A struct representing the full JSON-RPC request body
///
/// See [`JsonRpcParams`] for more info about the strange `params` field type.