ipfs_api_prelude/response/
commands.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 CommandsResponseOptions {
15    #[serde(deserialize_with = "serde::deserialize_vec")]
16    pub names: Vec<String>,
17}
18
19#[derive(Debug, Deserialize)]
20#[serde(rename_all = "PascalCase")]
21pub struct CommandsResponse {
22    pub name: String,
23
24    #[serde(deserialize_with = "serde::deserialize_vec")]
25    pub subcommands: Vec<CommandsResponse>,
26
27    #[serde(deserialize_with = "serde::deserialize_vec")]
28    pub options: Vec<CommandsResponseOptions>,
29}
30
31#[cfg(test)]
32mod tests {
33    deserialize_test!(v0_commands_0, CommandsResponse);
34}