1 package org.oxerr.viagogo.model.response.webhook; 2 3 import java.time.Instant; 4 import java.util.Arrays; 5 import java.util.List; 6 7 import org.apache.commons.lang3.builder.EqualsBuilder; 8 import org.apache.commons.lang3.builder.HashCodeBuilder; 9 import org.oxerr.viagogo.model.response.Resource; 10 11 import io.openapitools.jackson.dataformat.hal.HALLink; 12 import io.openapitools.jackson.dataformat.hal.annotation.Link; 13 14 public class Webhook extends Resource { 15 16 private static final long serialVersionUID = 2023080201L; 17 18 private Integer id; 19 20 private String name; 21 22 private String url; 23 24 private Instant createdAt; 25 26 private List<String> topics; 27 28 private String authorizationHeader; 29 30 @Link("webhook:delete") 31 private HALLink deleteLink; 32 33 @Link("webhook:ping") 34 private HALLink pingLink; 35 36 @Link("webhook:update") 37 private HALLink updateLink; 38 39 public Webhook() { 40 } 41 42 public Webhook(String name, String url, String... topics) { 43 this.name = name; 44 this.url = url; 45 this.topics = Arrays.asList(topics); 46 } 47 48 public Integer getId() { 49 return id; 50 } 51 52 public void setId(Integer id) { 53 this.id = id; 54 } 55 56 public String getName() { 57 return name; 58 } 59 60 public void setName(String name) { 61 this.name = name; 62 } 63 64 public String getUrl() { 65 return url; 66 } 67 68 public void setUrl(String url) { 69 this.url = url; 70 } 71 72 public Instant getCreatedAt() { 73 return createdAt; 74 } 75 76 public void setCreatedAt(Instant createdAt) { 77 this.createdAt = createdAt; 78 } 79 80 public List<String> getTopics() { 81 return topics; 82 } 83 84 public void setTopics(List<String> topics) { 85 this.topics = topics; 86 } 87 88 public String getAuthorizationHeader() { 89 return authorizationHeader; 90 } 91 92 public void setAuthorizationHeader(String authorizationHeader) { 93 this.authorizationHeader = authorizationHeader; 94 } 95 96 public HALLink getDeleteLink() { 97 return deleteLink; 98 } 99 100 public void setDeleteLink(HALLink deleteLink) { 101 this.deleteLink = deleteLink; 102 } 103 104 public HALLink getPingLink() { 105 return pingLink; 106 } 107 108 public void setPingLink(HALLink pingLink) { 109 this.pingLink = pingLink; 110 } 111 112 public HALLink getUpdateLink() { 113 return updateLink; 114 } 115 116 public void setUpdateLink(HALLink updateLink) { 117 this.updateLink = updateLink; 118 } 119 120 @Override 121 public int hashCode() { 122 return HashCodeBuilder.reflectionHashCode(this); 123 } 124 125 @Override 126 public boolean equals(Object obj) { 127 if (this == obj) { 128 return true; 129 } 130 if (!(obj instanceof Webhook)) { 131 return false; 132 } 133 Webhook rhs = (Webhook) obj; 134 return EqualsBuilder.reflectionEquals(this, rhs); 135 } 136 137 }