ipfs_api_prelude/response/
id.rs

1// Copyright 2017 rust-ipfs-api Developers
2//
3// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// http://opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
7//
8
9use crate::response::serde;
10use crate::serde::Deserialize;
11
12#[derive(Debug, Deserialize)]
13#[serde(rename_all = "PascalCase")]
14pub struct IdResponse {
15    #[serde(rename = "ID")]
16    pub id: String,
17
18    pub public_key: String,
19
20    #[serde(deserialize_with = "serde::deserialize_vec")]
21    pub addresses: Vec<String>,
22
23    pub agent_version: String,
24    pub protocol_version: String,
25}
26
27#[cfg(test)]
28mod tests {
29    deserialize_test!(v0_id_0, IdResponse);
30}