|
| 1 | +package org.gitlab4j.api.models; |
| 2 | + |
| 3 | +import java.io.Serializable; |
| 4 | + |
| 5 | +import org.gitlab4j.api.GitLabApiForm; |
| 6 | + |
| 7 | +public class WebHookParams implements Serializable { |
| 8 | + private static final long serialVersionUID = 1L; |
| 9 | + |
| 10 | + private String url; |
| 11 | + private String name; |
| 12 | + private String description; |
| 13 | + private Boolean pushEvents; |
| 14 | + private String pushEventsBranchFilter; |
| 15 | + private String branchFilterStrategy; |
| 16 | + private Boolean issuesEvents; |
| 17 | + private Boolean confidentialIssuesEvents; |
| 18 | + private Boolean mergeRequestsEvents; |
| 19 | + private Boolean tagPushEvents; |
| 20 | + private Boolean noteEvents; |
| 21 | + private Boolean confidentialNoteEvents; |
| 22 | + private Boolean jobEvents; |
| 23 | + private Boolean pipelineEvents; |
| 24 | + private Boolean wikiPageEvents; |
| 25 | + private Boolean deploymentEvents; |
| 26 | + private Boolean featureFlagEvents; |
| 27 | + private Boolean releasesEvents; |
| 28 | + private Boolean subgroupEvents; |
| 29 | + private Boolean memberEvents; |
| 30 | + private Boolean enableSslVerification; |
| 31 | + private String token; |
| 32 | + private Boolean resourceAccessTokenEvents; |
| 33 | + private String customWebhookTemplate; |
| 34 | + |
| 35 | + public GitLabApiForm getForm() { |
| 36 | + |
| 37 | + return new GitLabApiForm() |
| 38 | + .withParam("url", url, true) |
| 39 | + .withParam("name", name) |
| 40 | + .withParam("description", description) |
| 41 | + .withParam("push_events", pushEvents) |
| 42 | + .withParam("push_events_branch_filter", pushEventsBranchFilter) |
| 43 | + .withParam("branch_filter_strategy", branchFilterStrategy) |
| 44 | + .withParam("issues_events", issuesEvents) |
| 45 | + .withParam("confidential_issues_events", confidentialIssuesEvents) |
| 46 | + .withParam("merge_requests_events", mergeRequestsEvents) |
| 47 | + .withParam("tag_push_events", tagPushEvents) |
| 48 | + .withParam("note_events", noteEvents) |
| 49 | + .withParam("confidential_note_events", confidentialNoteEvents) |
| 50 | + .withParam("job_events", jobEvents) |
| 51 | + .withParam("pipeline_events", pipelineEvents) |
| 52 | + .withParam("wiki_page_events", wikiPageEvents) |
| 53 | + .withParam("deployment_events", deploymentEvents) |
| 54 | + .withParam("feature_flag_events", featureFlagEvents) |
| 55 | + .withParam("releases_events", releasesEvents) |
| 56 | + .withParam("subgroup_events", subgroupEvents) |
| 57 | + .withParam("member_events", memberEvents) |
| 58 | + .withParam("enable_ssl_verification", enableSslVerification) |
| 59 | + .withParam("token", token) |
| 60 | + .withParam("resource_access_token_events", resourceAccessTokenEvents) |
| 61 | + .withParam("custom_webhook_template", customWebhookTemplate); |
| 62 | + } |
| 63 | + |
| 64 | + public WebHookParams setBranchFilterStrategy(String branchFilterStrategy) { |
| 65 | + this.branchFilterStrategy = branchFilterStrategy; |
| 66 | + return this; |
| 67 | + } |
| 68 | + |
| 69 | + public WebHookParams setUrl(String url) { |
| 70 | + this.url = url; |
| 71 | + return this; |
| 72 | + } |
| 73 | + |
| 74 | + public WebHookParams setName(String name) { |
| 75 | + this.name = name; |
| 76 | + return this; |
| 77 | + } |
| 78 | + |
| 79 | + public WebHookParams setDescription(String description) { |
| 80 | + this.description = description; |
| 81 | + return this; |
| 82 | + } |
| 83 | + |
| 84 | + public WebHookParams setPushEvents(Boolean pushEvents) { |
| 85 | + this.pushEvents = pushEvents; |
| 86 | + return this; |
| 87 | + } |
| 88 | + |
| 89 | + public WebHookParams setPushEventsBranchFilter(String pushEventsBranchFilter) { |
| 90 | + this.pushEventsBranchFilter = pushEventsBranchFilter; |
| 91 | + return this; |
| 92 | + } |
| 93 | + |
| 94 | + public WebHookParams setIssuesEvents(Boolean issuesEvents) { |
| 95 | + this.issuesEvents = issuesEvents; |
| 96 | + return this; |
| 97 | + } |
| 98 | + |
| 99 | + public WebHookParams setConfidentialIssuesEvents(Boolean confidentialIssuesEvents) { |
| 100 | + this.confidentialIssuesEvents = confidentialIssuesEvents; |
| 101 | + return this; |
| 102 | + } |
| 103 | + |
| 104 | + public WebHookParams setMergeRequestsEvents(Boolean mergeRequestsEvents) { |
| 105 | + this.mergeRequestsEvents = mergeRequestsEvents; |
| 106 | + return this; |
| 107 | + } |
| 108 | + |
| 109 | + public WebHookParams setTagPushEvents(Boolean tagPushEvents) { |
| 110 | + this.tagPushEvents = tagPushEvents; |
| 111 | + return this; |
| 112 | + } |
| 113 | + |
| 114 | + public WebHookParams setNoteEvents(Boolean noteEvents) { |
| 115 | + this.noteEvents = noteEvents; |
| 116 | + return this; |
| 117 | + } |
| 118 | + |
| 119 | + public WebHookParams setConfidentialNoteEvents(Boolean confidentialNoteEvents) { |
| 120 | + this.confidentialNoteEvents = confidentialNoteEvents; |
| 121 | + return this; |
| 122 | + } |
| 123 | + |
| 124 | + public WebHookParams setJobEvents(Boolean jobEvents) { |
| 125 | + this.jobEvents = jobEvents; |
| 126 | + return this; |
| 127 | + } |
| 128 | + |
| 129 | + public WebHookParams setPipelineEvents(Boolean pipelineEvents) { |
| 130 | + this.pipelineEvents = pipelineEvents; |
| 131 | + return this; |
| 132 | + } |
| 133 | + |
| 134 | + public WebHookParams setWikiPageEvents(Boolean wikiPageEvents) { |
| 135 | + this.wikiPageEvents = wikiPageEvents; |
| 136 | + return this; |
| 137 | + } |
| 138 | + |
| 139 | + public WebHookParams setDeploymentEvents(Boolean deploymentEvents) { |
| 140 | + this.deploymentEvents = deploymentEvents; |
| 141 | + return this; |
| 142 | + } |
| 143 | + |
| 144 | + public WebHookParams setFeatureFlagEvents(Boolean featureFlagEvents) { |
| 145 | + this.featureFlagEvents = featureFlagEvents; |
| 146 | + return this; |
| 147 | + } |
| 148 | + |
| 149 | + public WebHookParams setReleasesEvents(Boolean releasesEvents) { |
| 150 | + this.releasesEvents = releasesEvents; |
| 151 | + return this; |
| 152 | + } |
| 153 | + |
| 154 | + public WebHookParams setSubgroupEvents(Boolean subgroupEvents) { |
| 155 | + this.subgroupEvents = subgroupEvents; |
| 156 | + return this; |
| 157 | + } |
| 158 | + |
| 159 | + public WebHookParams setMemberEvents(Boolean memberEvents) { |
| 160 | + this.memberEvents = memberEvents; |
| 161 | + return this; |
| 162 | + } |
| 163 | + |
| 164 | + public WebHookParams setEnableSslVerification(Boolean enableSslVerification) { |
| 165 | + this.enableSslVerification = enableSslVerification; |
| 166 | + return this; |
| 167 | + } |
| 168 | + |
| 169 | + public WebHookParams setToken(String token) { |
| 170 | + this.token = token; |
| 171 | + return this; |
| 172 | + } |
| 173 | + |
| 174 | + public WebHookParams setResourceAccessTokenEvents(Boolean resourceAccessTokenEvents) { |
| 175 | + this.resourceAccessTokenEvents = resourceAccessTokenEvents; |
| 176 | + return this; |
| 177 | + } |
| 178 | + |
| 179 | + public WebHookParams setCustomWebhookTemplate(String customWebhookTemplate) { |
| 180 | + this.customWebhookTemplate = customWebhookTemplate; |
| 181 | + return this; |
| 182 | + } |
| 183 | +} |
0 commit comments