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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
use super::{ReviewApp, ReviewAppConfig};
use crate::framework::endpoint::{HerokuEndpoint, Method};
pub struct ReviewAppDetails {
pub review_id: String,
}
impl ReviewAppDetails {
pub fn new(review_id: String) -> ReviewAppDetails {
ReviewAppDetails { review_id }
}
}
impl HerokuEndpoint<ReviewApp> for ReviewAppDetails {
fn method(&self) -> Method {
Method::Get
}
fn path(&self) -> String {
format!("review-apps/{}", self.review_id)
}
}
pub struct ReviewAppByAppDetails {
pub app_id: String,
}
impl ReviewAppByAppDetails {
pub fn new(app_id: String) -> ReviewAppByAppDetails {
ReviewAppByAppDetails { app_id }
}
}
impl HerokuEndpoint<ReviewApp> for ReviewAppByAppDetails {
fn method(&self) -> Method {
Method::Get
}
fn path(&self) -> String {
format!("apps/{}/review-app", self.app_id)
}
}
pub struct ReviewAppByPipelineList {
pub pipeline_id: String,
}
impl ReviewAppByPipelineList {
pub fn new(pipeline_id: String) -> ReviewAppByPipelineList {
ReviewAppByPipelineList { pipeline_id }
}
}
impl HerokuEndpoint<Vec<ReviewApp>> for ReviewAppByPipelineList {
fn method(&self) -> Method {
Method::Get
}
fn path(&self) -> String {
format!("pipelines/{}/review-apps", self.pipeline_id)
}
}
pub struct ReviewAppConfigDetails<'a> {
pub pipeline_id: &'a str,
}
impl<'a> ReviewAppConfigDetails<'a> {
pub fn new(pipeline_id: &'a str) -> ReviewAppConfigDetails<'a> {
ReviewAppConfigDetails { pipeline_id }
}
}
impl<'a> HerokuEndpoint<ReviewAppConfig> for ReviewAppConfigDetails<'a> {
fn method(&self) -> Method {
Method::Get
}
fn path(&self) -> String {
format!("pipelines/{}/review-app-config", self.pipeline_id)
}
}