n4n5/commands/gh/
types.rsuse serde::{Deserialize, Serialize};
#[derive(Deserialize, Default, Debug)]
pub struct GhResponse {
pub data: GhData,
}
#[derive(Deserialize, Default, Debug)]
pub struct GhData {
pub user: GhUser,
}
#[derive(Deserialize, Default, Debug)]
pub struct GhUser {
#[serde(rename = "pullRequests")]
pub pull_requests: GhPullRequests,
}
#[derive(Deserialize, Default, Debug)]
pub struct GhPullRequests {
pub edges: Vec<GhPullRequest>,
#[serde(rename = "pageInfo")]
pub page_info: GhPageInfo,
}
#[derive(Deserialize, Default, Debug)]
pub struct GhPageInfo {
#[serde(rename = "endCursor")]
pub end_cursor: String,
#[serde(rename = "hasNextPage")]
pub has_next_page: bool,
}
#[derive(Deserialize, Serialize, Default, Debug)]
pub struct GhPullRequest {
node: GhPullRequestNode,
}
#[derive(Deserialize, Serialize, Default, Debug)]
pub struct GhPullRequestNode {
id: String,
number: i32,
title: String,
url: String,
state: String,
#[serde(rename = "createdAt")]
created_at: String,
#[serde(rename = "baseRepository")]
base_repository: GhBaseRepository,
}
#[derive(Deserialize, Serialize, Default, Debug)]
pub struct GhBaseRepository {
url: String,
name: String,
description: Option<String>,
owner: GhOwner,
languages: GhLanguages,
}
#[derive(Deserialize, Serialize, Default, Debug)]
pub struct GhOwner {
login: String,
}
#[derive(Deserialize, Serialize, Default, Debug)]
pub struct GhLanguages {
nodes: Vec<GhLanguage>,
}
#[derive(Deserialize, Serialize, Default, Debug)]
pub struct GhLanguage {
name: String,
color: Option<String>,
}
#[derive(Deserialize, Serialize, Default, Debug)]
pub struct GhProject {
pub url: String,
pub name: String,
pub description: Option<String>,
#[serde(rename = "stargazerCount")]
pub stargazer_count: i32,
#[serde(rename = "homepageUrl")]
pub homepage_url: Option<String>,
#[serde(rename = "primaryLanguage")]
pub primary_language: Option<GhLanguage>,
}