1use structopt::StructOpt;
2
3#[derive(Debug, StructOpt)]
4#[structopt(about = "Imgur API client.")]
5pub enum Opt {
6 #[structopt(about = "Delete an image.")]
7 DeleteImage(DeleteImageInput),
8 #[structopt(about = "Favorite an image.")]
9 FavoriteImage(FavoriteImageInput),
10 #[structopt(about = "Generates an access token from given refresh token.")]
11 GenerateAccessToken(GenerateAccessTokenInput),
12 #[structopt(about = "Get information about an account.")]
13 GetAccount(GetAccountInput),
14 #[structopt(about = "Get information about an image of an account.")]
15 GetAccountImage(GetAccountImageInput),
16 #[structopt(about = "Get the total number of images associated with the account.")]
17 GetAccountImagesCount(GetAccountImagesCountInput),
18 #[structopt(about = "Get information about an image.")]
19 GetImage(GetImageInput),
20 #[structopt(about = "List account images.")]
21 ListAccountImages(ListAccountImagesInput),
22 #[structopt(about = "Update information about an image.")]
23 UpdateImage(UpdateImageInput),
24 #[structopt(about = "Upload a new image.")]
25 UploadImage(UploadImageInput),
26}
27
28#[derive(Debug, StructOpt)]
29pub struct DeleteImageInput {
30 #[structopt(long)]
31 pub access_token: Option<String>,
32 #[structopt(long)]
33 pub client_id: Option<String>,
34 pub hash: String,
35}
36
37#[derive(Debug, StructOpt)]
38pub struct FavoriteImageInput {
39 #[structopt(long)]
40 pub access_token: String,
41 pub hash: String,
42}
43
44#[derive(Debug, StructOpt)]
45pub struct GenerateAccessTokenInput {
46 pub client_id: String,
47 pub client_secret: String,
48 pub refresh_token: String,
49}
50
51#[derive(Debug, StructOpt)]
52pub struct GetAccountInput {
53 #[structopt(long)]
54 pub access_token: Option<String>,
55 #[structopt(long)]
56 pub client_id: Option<String>,
57 pub user_name: String,
58}
59
60#[derive(Debug, StructOpt)]
61pub struct GetAccountImageInput {
62 #[structopt(long)]
63 pub access_token: String,
64 pub user_name: String,
65 pub image_id: String,
66}
67
68#[derive(Debug, StructOpt)]
69pub struct GetAccountImagesCountInput {
70 #[structopt(long)]
71 pub access_token: String,
72 pub user_name: String,
73}
74
75#[derive(Debug, StructOpt)]
76pub struct GetImageInput {
77 #[structopt(long)]
78 pub access_token: Option<String>,
79 #[structopt(long)]
80 pub client_id: Option<String>,
81 pub hash: String,
82}
83
84#[derive(Debug, StructOpt)]
85pub struct ListAccountImagesInput {
86 #[structopt(long)]
87 pub access_token: String,
88 pub user_name: String,
89 #[structopt(long)]
90 pub page: Option<u32>,
91 #[structopt(long)]
92 pub per_page: Option<u8>,
93}
94
95#[derive(Debug, StructOpt)]
96pub struct UpdateImageInput {
97 #[structopt(long)]
98 pub access_token: Option<String>,
99 #[structopt(long)]
100 pub client_id: Option<String>,
101 pub hash: String,
102 #[structopt(long)]
103 pub description: Option<String>,
104 #[structopt(long)]
105 pub title: Option<String>,
106}
107
108#[derive(Debug, StructOpt)]
109pub struct UploadImageInput {
110 #[structopt(long)]
111 pub access_token: Option<String>,
112 #[structopt(long)]
113 pub client_id: Option<String>,
114 pub file_path: String,
115 #[structopt(long)]
116 pub album: Option<String>,
117 #[structopt(long)]
118 pub description: Option<String>,
119 #[structopt(long)]
120 pub name: Option<String>,
121 #[structopt(long)]
122 pub title: Option<String>,
123}