Java tutorial
/** * Bitbucket API * Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework. * * OpenAPI spec version: 2.0 * Contact: support@bitbucket.org * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package cl.tinet.devops.metrics.gen.bitbucket.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.joda.time.DateTime; /** * WebhookSubscription */ @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-07-04T23:42:53.141-04:00") public class WebhookSubscription extends Object { @JsonProperty("type") private String type = null; /** * The type of entity, which is `repository` in the case of webhook subscriptions on repositories. */ public enum SubjectTypeEnum { USER("user"), REPOSITORY("repository"), TEAM("team"); private String value; SubjectTypeEnum(String value) { this.value = value; } @Override public String toString() { return String.valueOf(value); } } @JsonProperty("subject_type") private SubjectTypeEnum subjectType = null; @JsonProperty("uuid") private String uuid = null; @JsonProperty("url") private String url = null; @JsonProperty("created_at") private DateTime createdAt = null; @JsonProperty("description") private String description = null; @JsonProperty("active") private Boolean active = null; /** * Gets or Sets events */ public enum EventsEnum { PULLREQUEST_UPDATED("pullrequest:updated"), REPO_COMMIT_STATUS_CREATED("repo:commit_status_created"), REPO_UPDATED("repo:updated"), ISSUE_COMMENT_CREATED("issue:comment_created"), PROJECT_UPDATED("project:updated"), PULLREQUEST_REJECTED("pullrequest:rejected"), PULLREQUEST_FULFILLED("pullrequest:fulfilled"), REPO_IMPORTED("repo:imported"), REPO_DELETED("repo:deleted"), PULLREQUEST_COMMENT_CREATED("pullrequest:comment_created"), PULLREQUEST_COMMENT_DELETED("pullrequest:comment_deleted"), REPO_FORK("repo:fork"), ISSUE_CREATED("issue:created"), REPO_COMMIT_COMMENT_CREATED("repo:commit_comment_created"), PULLREQUEST_APPROVED("pullrequest:approved"), REPO_COMMIT_STATUS_UPDATED("repo:commit_status_updated"), PULLREQUEST_COMMENT_UPDATED("pullrequest:comment_updated"), ISSUE_UPDATED("issue:updated"), PULLREQUEST_UNAPPROVED("pullrequest:unapproved"), PULLREQUEST_CREATED("pullrequest:created"), REPO_PUSH("repo:push"); private String value; EventsEnum(String value) { this.value = value; } @Override public String toString() { return String.valueOf(value); } } @JsonProperty("events") private List<EventsEnum> events = new ArrayList<EventsEnum>(); @JsonProperty("subject") private Object subject = null; public WebhookSubscription type(String type) { this.type = type; return this; } /** * Get type * @return type **/ @ApiModelProperty(example = "null", required = true, value = "") public String getType() { return type; } public void setType(String type) { this.type = type; } public WebhookSubscription subjectType(SubjectTypeEnum subjectType) { this.subjectType = subjectType; return this; } /** * The type of entity, which is `repository` in the case of webhook subscriptions on repositories. * @return subjectType **/ @ApiModelProperty(example = "null", value = "The type of entity, which is `repository` in the case of webhook subscriptions on repositories.") public SubjectTypeEnum getSubjectType() { return subjectType; } public void setSubjectType(SubjectTypeEnum subjectType) { this.subjectType = subjectType; } public WebhookSubscription uuid(String uuid) { this.uuid = uuid; return this; } /** * The webhook's id * @return uuid **/ @ApiModelProperty(example = "null", value = "The webhook's id") public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public WebhookSubscription url(String url) { this.url = url; return this; } /** * The URL events get delivered to. * @return url **/ @ApiModelProperty(example = "null", value = "The URL events get delivered to.") public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public WebhookSubscription createdAt(DateTime createdAt) { this.createdAt = createdAt; return this; } /** * Get createdAt * @return createdAt **/ @ApiModelProperty(example = "null", value = "") public DateTime getCreatedAt() { return createdAt; } public void setCreatedAt(DateTime createdAt) { this.createdAt = createdAt; } public WebhookSubscription description(String description) { this.description = description; return this; } /** * A user-defined description of the webhook. * @return description **/ @ApiModelProperty(example = "null", value = "A user-defined description of the webhook.") public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public WebhookSubscription active(Boolean active) { this.active = active; return this; } /** * Get active * @return active **/ @ApiModelProperty(example = "null", value = "") public Boolean getActive() { return active; } public void setActive(Boolean active) { this.active = active; } public WebhookSubscription events(List<EventsEnum> events) { this.events = events; return this; } /** * The events this webhook is subscribed to. * @return events **/ @ApiModelProperty(example = "null", value = "The events this webhook is subscribed to.") public List<EventsEnum> getEvents() { return events; } public void setEvents(List<EventsEnum> events) { this.events = events; } public WebhookSubscription subject(Object subject) { this.subject = subject; return this; } /** * Get subject * @return subject **/ @ApiModelProperty(example = "null", value = "") public Object getSubject() { return subject; } public void setSubject(Object subject) { this.subject = subject; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } WebhookSubscription webhookSubscription = (WebhookSubscription) o; return Objects.equals(this.type, webhookSubscription.type) && Objects.equals(this.subjectType, webhookSubscription.subjectType) && Objects.equals(this.uuid, webhookSubscription.uuid) && Objects.equals(this.url, webhookSubscription.url) && Objects.equals(this.createdAt, webhookSubscription.createdAt) && Objects.equals(this.description, webhookSubscription.description) && Objects.equals(this.active, webhookSubscription.active) && Objects.equals(this.events, webhookSubscription.events) && Objects.equals(this.subject, webhookSubscription.subject) && super.equals(o); } @Override public int hashCode() { return Objects.hash(type, subjectType, uuid, url, createdAt, description, active, events, subject, super.hashCode()); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class WebhookSubscription {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" subjectType: ").append(toIndentedString(subjectType)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" url: ").append(toIndentedString(url)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" active: ").append(toIndentedString(active)).append("\n"); sb.append(" events: ").append(toIndentedString(events)).append("\n"); sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }