-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathWebhook.java
More file actions
125 lines (102 loc) · 3.39 KB
/
Webhook.java
File metadata and controls
125 lines (102 loc) · 3.39 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package com.julienvey.trello.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.julienvey.trello.Trello;
import java.util.Objects;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Webhook extends TrelloEntity {
private String id;
private String description;
private String idModel;
private String callbackURL;
private boolean active;
private int consecutiveFailures;
private String firstConsecutiveFailDate;
public String getId() {
return id;
}
public Webhook setId(String id) {
this.id = id;
return this;
}
public String getDescription() {
return description;
}
public Webhook setDescription(String description) {
this.description = description;
return this;
}
public String getIdModel() {
return idModel;
}
public Webhook setIdModel(String idModel) {
this.idModel = idModel;
return this;
}
public String getCallbackURL() {
return callbackURL;
}
public Webhook setCallbackURL(String callbackUrl) {
this.callbackURL = callbackUrl;
return this;
}
public boolean isActive() {
return active;
}
public Webhook setActive(boolean active) {
this.active = active;
return this;
}
public int getConsecutiveFailures() {
return consecutiveFailures;
}
public Webhook setConsecutiveFailures(int consecutiveFailures) {
this.consecutiveFailures = consecutiveFailures;
return this;
}
public String getFirstConsecutiveFailDate() {
return firstConsecutiveFailDate;
}
public Webhook setFirstConsecutiveFailDate(String firstConsecutiveFailDate) {
this.firstConsecutiveFailDate = firstConsecutiveFailDate;
return this;
}
public Webhook create() {
Webhook webhook = getTrelloService().createWebhook(this);
id = webhook.id;
return this;
}
@Override
@SuppressWarnings("unchecked")
public Webhook setInternalTrello(Trello trelloService) {
return super.setInternalTrello(trelloService);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Webhook webhook = (Webhook) o;
return active == webhook.active &&
consecutiveFailures == webhook.consecutiveFailures &&
id.equals(webhook.id) &&
Objects.equals(description, webhook.description) &&
idModel.equals(webhook.idModel) &&
callbackURL.equals(webhook.callbackURL) &&
Objects.equals(firstConsecutiveFailDate, webhook.firstConsecutiveFailDate);
}
@Override
public int hashCode() {
return Objects.hash(id, description, idModel, callbackURL, active, consecutiveFailures, firstConsecutiveFailDate);
}
@Override
public String toString() {
return "Webhook{" +
"id='" + id + '\'' +
", description='" + description + '\'' +
", idModel='" + idModel + '\'' +
", callbackUrl='" + callbackURL + '\'' +
", active=" + active +
", consecutiveFailures=" + consecutiveFailures +
", firstConsecutiveFailDate='" + firstConsecutiveFailDate + '\'' +
'}';
}
}