You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WebhookDto.java 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2021 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonar.db.webhook;
  21. import javax.annotation.Nullable;
  22. public class WebhookDto {
  23. /** Technical unique identifier, can't be null */
  24. private String uuid;
  25. /** Name, can't be null */
  26. private String name;
  27. /** URL, can't be null */
  28. private String url;
  29. @Nullable
  30. private String projectUuid;
  31. /**
  32. * The optional secret used to generate payload signature
  33. */
  34. @Nullable
  35. private String secret;
  36. private long createdAt;
  37. private long updatedAt;
  38. public WebhookDto setUuid(String uuid) {
  39. this.uuid = uuid;
  40. return this;
  41. }
  42. public WebhookDto setName(String name) {
  43. this.name = name;
  44. return this;
  45. }
  46. public WebhookDto setUrl(String url) {
  47. this.url = url;
  48. return this;
  49. }
  50. public WebhookDto setProjectUuid(@Nullable String projectUuid) {
  51. this.projectUuid = projectUuid;
  52. return this;
  53. }
  54. public WebhookDto setSecret(@Nullable String s) {
  55. this.secret = s;
  56. return this;
  57. }
  58. WebhookDto setCreatedAt(long createdAt) {
  59. this.createdAt = createdAt;
  60. return this;
  61. }
  62. WebhookDto setUpdatedAt(long updatedAt) {
  63. this.updatedAt = updatedAt;
  64. return this;
  65. }
  66. public String getUuid() {
  67. return uuid;
  68. }
  69. public String getName() {
  70. return name;
  71. }
  72. public String getUrl() {
  73. return url;
  74. }
  75. @Nullable
  76. public String getProjectUuid() {
  77. return projectUuid;
  78. }
  79. @Nullable
  80. public String getSecret() {
  81. return secret;
  82. }
  83. public long getCreatedAt() {
  84. return createdAt;
  85. }
  86. @Nullable
  87. public long getUpdatedAt() {
  88. return updatedAt;
  89. }
  90. }