aboutsummaryrefslogtreecommitdiff
path: root/src/structures.rs
blob: 3b5a59eb2d749948eeefb17654aa54005eb7458c (plain) (blame)
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
// Copyright (C) 2021-2021 the senpy club
// SPDX-License-Identifier: GPL-3.0-only

use serde_derive::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug)]
pub struct GitHubAPIResponse {
  pub sha:       String,
  pub url:       String,
  pub tree:      Vec<GitHubAPIResponseTree>,
  pub truncated: bool,
}
impl Default for GitHubAPIResponse {
  fn default() -> Self {
    GitHubAPIResponse {
      sha:       "rate limited".to_string(),
      url:       "rate limited".to_string(),
      tree:      vec![],
      truncated: false,
    }
  }
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GitHubAPIResponseTree {
  pub path:  String,
  pub mode:  String,
  #[serde(rename = "type")]
  pub _type: String,
  pub sha:   String,
  pub url:   String,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct SenpyRandom {
  pub language: String,
  pub image:    String,
}