All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.merge.api.resources.ticketing.types.Ticket Maven / Gradle / Ivy

package com.merge.api.resources.ticketing.types;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

@JsonDeserialize(builder = Ticket.Builder.class)
public final class Ticket {
    private final Optional id;

    private final Optional remoteId;

    private final Optional name;

    private final Optional>> assignees;

    private final Optional creator;

    private final Optional dueDate;

    private final Optional status;

    private final Optional description;

    private final Optional>> collections;

    private final Optional ticketType;

    private final Optional account;

    private final Optional contact;

    private final Optional parentTicket;

    private final Optional>> attachments;

    private final Optional>> tags;

    private final Optional remoteCreatedAt;

    private final Optional remoteUpdatedAt;

    private final Optional completedAt;

    private final Optional remoteWasDeleted;

    private final Optional ticketUrl;

    private final Optional priority;

    private final Optional modifiedAt;

    private final Optional> fieldMappings;

    private final Optional> remoteData;

    private final Optional> remoteFields;

    private Ticket(
            Optional id,
            Optional remoteId,
            Optional name,
            Optional>> assignees,
            Optional creator,
            Optional dueDate,
            Optional status,
            Optional description,
            Optional>> collections,
            Optional ticketType,
            Optional account,
            Optional contact,
            Optional parentTicket,
            Optional>> attachments,
            Optional>> tags,
            Optional remoteCreatedAt,
            Optional remoteUpdatedAt,
            Optional completedAt,
            Optional remoteWasDeleted,
            Optional ticketUrl,
            Optional priority,
            Optional modifiedAt,
            Optional> fieldMappings,
            Optional> remoteData,
            Optional> remoteFields) {
        this.id = id;
        this.remoteId = remoteId;
        this.name = name;
        this.assignees = assignees;
        this.creator = creator;
        this.dueDate = dueDate;
        this.status = status;
        this.description = description;
        this.collections = collections;
        this.ticketType = ticketType;
        this.account = account;
        this.contact = contact;
        this.parentTicket = parentTicket;
        this.attachments = attachments;
        this.tags = tags;
        this.remoteCreatedAt = remoteCreatedAt;
        this.remoteUpdatedAt = remoteUpdatedAt;
        this.completedAt = completedAt;
        this.remoteWasDeleted = remoteWasDeleted;
        this.ticketUrl = ticketUrl;
        this.priority = priority;
        this.modifiedAt = modifiedAt;
        this.fieldMappings = fieldMappings;
        this.remoteData = remoteData;
        this.remoteFields = remoteFields;
    }

    @JsonProperty("id")
    public Optional getId() {
        return id;
    }

    /**
     * @return The third-party API ID of the matching object.
     */
    @JsonProperty("remote_id")
    public Optional getRemoteId() {
        return remoteId;
    }

    /**
     * @return The ticket's name.
     */
    @JsonProperty("name")
    public Optional getName() {
        return name;
    }

    @JsonProperty("assignees")
    public Optional>> getAssignees() {
        return assignees;
    }

    /**
     * @return The user who created this ticket.
     */
    @JsonProperty("creator")
    public Optional getCreator() {
        return creator;
    }

    /**
     * @return The ticket's due date.
     */
    @JsonProperty("due_date")
    public Optional getDueDate() {
        return dueDate;
    }

    /**
     * @return The current status of the ticket.
     * 
    *
  • OPEN - OPEN
  • *
  • CLOSED - CLOSED
  • *
  • IN_PROGRESS - IN_PROGRESS
  • *
  • ON_HOLD - ON_HOLD
  • *
*/ @JsonProperty("status") public Optional getStatus() { return status; } /** * @return The ticket’s description. HTML version of description is mapped if supported by the third-party platform. */ @JsonProperty("description") public Optional getDescription() { return description; } @JsonProperty("collections") public Optional>> getCollections() { return collections; } /** * @return The ticket's type. */ @JsonProperty("ticket_type") public Optional getTicketType() { return ticketType; } /** * @return The account associated with the ticket. */ @JsonProperty("account") public Optional getAccount() { return account; } /** * @return The contact associated with the ticket. */ @JsonProperty("contact") public Optional getContact() { return contact; } /** * @return The ticket's parent ticket. */ @JsonProperty("parent_ticket") public Optional getParentTicket() { return parentTicket; } @JsonProperty("attachments") public Optional>> getAttachments() { return attachments; } @JsonProperty("tags") public Optional>> getTags() { return tags; } /** * @return When the third party's ticket was created. */ @JsonProperty("remote_created_at") public Optional getRemoteCreatedAt() { return remoteCreatedAt; } /** * @return When the third party's ticket was updated. */ @JsonProperty("remote_updated_at") public Optional getRemoteUpdatedAt() { return remoteUpdatedAt; } /** * @return When the ticket was completed. */ @JsonProperty("completed_at") public Optional getCompletedAt() { return completedAt; } @JsonProperty("remote_was_deleted") public Optional getRemoteWasDeleted() { return remoteWasDeleted; } /** * @return The 3rd party url of the Ticket. */ @JsonProperty("ticket_url") public Optional getTicketUrl() { return ticketUrl; } /** * @return The priority or urgency of the Ticket. *
    *
  • URGENT - URGENT
  • *
  • HIGH - HIGH
  • *
  • NORMAL - NORMAL
  • *
  • LOW - LOW
  • *
*/ @JsonProperty("priority") public Optional getPriority() { return priority; } /** * @return This is the datetime that this object was last updated by Merge */ @JsonProperty("modified_at") public Optional getModifiedAt() { return modifiedAt; } @JsonProperty("field_mappings") public Optional> getFieldMappings() { return fieldMappings; } @JsonProperty("remote_data") public Optional> getRemoteData() { return remoteData; } @JsonProperty("remote_fields") public Optional> getRemoteFields() { return remoteFields; } @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Ticket && equalTo((Ticket) other); } private boolean equalTo(Ticket other) { return id.equals(other.id) && remoteId.equals(other.remoteId) && name.equals(other.name) && assignees.equals(other.assignees) && creator.equals(other.creator) && dueDate.equals(other.dueDate) && status.equals(other.status) && description.equals(other.description) && collections.equals(other.collections) && ticketType.equals(other.ticketType) && account.equals(other.account) && contact.equals(other.contact) && parentTicket.equals(other.parentTicket) && attachments.equals(other.attachments) && tags.equals(other.tags) && remoteCreatedAt.equals(other.remoteCreatedAt) && remoteUpdatedAt.equals(other.remoteUpdatedAt) && completedAt.equals(other.completedAt) && remoteWasDeleted.equals(other.remoteWasDeleted) && ticketUrl.equals(other.ticketUrl) && priority.equals(other.priority) && modifiedAt.equals(other.modifiedAt) && fieldMappings.equals(other.fieldMappings) && remoteData.equals(other.remoteData) && remoteFields.equals(other.remoteFields); } @Override public int hashCode() { return Objects.hash( this.id, this.remoteId, this.name, this.assignees, this.creator, this.dueDate, this.status, this.description, this.collections, this.ticketType, this.account, this.contact, this.parentTicket, this.attachments, this.tags, this.remoteCreatedAt, this.remoteUpdatedAt, this.completedAt, this.remoteWasDeleted, this.ticketUrl, this.priority, this.modifiedAt, this.fieldMappings, this.remoteData, this.remoteFields); } @Override public String toString() { return "Ticket{" + "id: " + id + ", remoteId: " + remoteId + ", name: " + name + ", assignees: " + assignees + ", creator: " + creator + ", dueDate: " + dueDate + ", status: " + status + ", description: " + description + ", collections: " + collections + ", ticketType: " + ticketType + ", account: " + account + ", contact: " + contact + ", parentTicket: " + parentTicket + ", attachments: " + attachments + ", tags: " + tags + ", remoteCreatedAt: " + remoteCreatedAt + ", remoteUpdatedAt: " + remoteUpdatedAt + ", completedAt: " + completedAt + ", remoteWasDeleted: " + remoteWasDeleted + ", ticketUrl: " + ticketUrl + ", priority: " + priority + ", modifiedAt: " + modifiedAt + ", fieldMappings: " + fieldMappings + ", remoteData: " + remoteData + ", remoteFields: " + remoteFields + "}"; } public static Builder builder() { return new Builder(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { private Optional id = Optional.empty(); private Optional remoteId = Optional.empty(); private Optional name = Optional.empty(); private Optional>> assignees = Optional.empty(); private Optional creator = Optional.empty(); private Optional dueDate = Optional.empty(); private Optional status = Optional.empty(); private Optional description = Optional.empty(); private Optional>> collections = Optional.empty(); private Optional ticketType = Optional.empty(); private Optional account = Optional.empty(); private Optional contact = Optional.empty(); private Optional parentTicket = Optional.empty(); private Optional>> attachments = Optional.empty(); private Optional>> tags = Optional.empty(); private Optional remoteCreatedAt = Optional.empty(); private Optional remoteUpdatedAt = Optional.empty(); private Optional completedAt = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); private Optional ticketUrl = Optional.empty(); private Optional priority = Optional.empty(); private Optional modifiedAt = Optional.empty(); private Optional> fieldMappings = Optional.empty(); private Optional> remoteData = Optional.empty(); private Optional> remoteFields = Optional.empty(); private Builder() {} public Builder from(Ticket other) { id(other.getId()); remoteId(other.getRemoteId()); name(other.getName()); assignees(other.getAssignees()); creator(other.getCreator()); dueDate(other.getDueDate()); status(other.getStatus()); description(other.getDescription()); collections(other.getCollections()); ticketType(other.getTicketType()); account(other.getAccount()); contact(other.getContact()); parentTicket(other.getParentTicket()); attachments(other.getAttachments()); tags(other.getTags()); remoteCreatedAt(other.getRemoteCreatedAt()); remoteUpdatedAt(other.getRemoteUpdatedAt()); completedAt(other.getCompletedAt()); remoteWasDeleted(other.getRemoteWasDeleted()); ticketUrl(other.getTicketUrl()); priority(other.getPriority()); modifiedAt(other.getModifiedAt()); fieldMappings(other.getFieldMappings()); remoteData(other.getRemoteData()); remoteFields(other.getRemoteFields()); return this; } @JsonSetter(value = "id", nulls = Nulls.SKIP) public Builder id(Optional id) { this.id = id; return this; } public Builder id(String id) { this.id = Optional.of(id); return this; } @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) public Builder remoteId(Optional remoteId) { this.remoteId = remoteId; return this; } public Builder remoteId(String remoteId) { this.remoteId = Optional.of(remoteId); return this; } @JsonSetter(value = "name", nulls = Nulls.SKIP) public Builder name(Optional name) { this.name = name; return this; } public Builder name(String name) { this.name = Optional.of(name); return this; } @JsonSetter(value = "assignees", nulls = Nulls.SKIP) public Builder assignees(Optional>> assignees) { this.assignees = assignees; return this; } public Builder assignees(List> assignees) { this.assignees = Optional.of(assignees); return this; } @JsonSetter(value = "creator", nulls = Nulls.SKIP) public Builder creator(Optional creator) { this.creator = creator; return this; } public Builder creator(String creator) { this.creator = Optional.of(creator); return this; } @JsonSetter(value = "due_date", nulls = Nulls.SKIP) public Builder dueDate(Optional dueDate) { this.dueDate = dueDate; return this; } public Builder dueDate(String dueDate) { this.dueDate = Optional.of(dueDate); return this; } @JsonSetter(value = "status", nulls = Nulls.SKIP) public Builder status(Optional status) { this.status = status; return this; } public Builder status(TicketStatus status) { this.status = Optional.of(status); return this; } @JsonSetter(value = "description", nulls = Nulls.SKIP) public Builder description(Optional description) { this.description = description; return this; } public Builder description(String description) { this.description = Optional.of(description); return this; } @JsonSetter(value = "collections", nulls = Nulls.SKIP) public Builder collections(Optional>> collections) { this.collections = collections; return this; } public Builder collections(List> collections) { this.collections = Optional.of(collections); return this; } @JsonSetter(value = "ticket_type", nulls = Nulls.SKIP) public Builder ticketType(Optional ticketType) { this.ticketType = ticketType; return this; } public Builder ticketType(String ticketType) { this.ticketType = Optional.of(ticketType); return this; } @JsonSetter(value = "account", nulls = Nulls.SKIP) public Builder account(Optional account) { this.account = account; return this; } public Builder account(String account) { this.account = Optional.of(account); return this; } @JsonSetter(value = "contact", nulls = Nulls.SKIP) public Builder contact(Optional contact) { this.contact = contact; return this; } public Builder contact(String contact) { this.contact = Optional.of(contact); return this; } @JsonSetter(value = "parent_ticket", nulls = Nulls.SKIP) public Builder parentTicket(Optional parentTicket) { this.parentTicket = parentTicket; return this; } public Builder parentTicket(String parentTicket) { this.parentTicket = Optional.of(parentTicket); return this; } @JsonSetter(value = "attachments", nulls = Nulls.SKIP) public Builder attachments(Optional>> attachments) { this.attachments = attachments; return this; } public Builder attachments(List> attachments) { this.attachments = Optional.of(attachments); return this; } @JsonSetter(value = "tags", nulls = Nulls.SKIP) public Builder tags(Optional>> tags) { this.tags = tags; return this; } public Builder tags(List> tags) { this.tags = Optional.of(tags); return this; } @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) public Builder remoteCreatedAt(Optional remoteCreatedAt) { this.remoteCreatedAt = remoteCreatedAt; return this; } public Builder remoteCreatedAt(String remoteCreatedAt) { this.remoteCreatedAt = Optional.of(remoteCreatedAt); return this; } @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { this.remoteUpdatedAt = remoteUpdatedAt; return this; } public Builder remoteUpdatedAt(String remoteUpdatedAt) { this.remoteUpdatedAt = Optional.of(remoteUpdatedAt); return this; } @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) public Builder completedAt(Optional completedAt) { this.completedAt = completedAt; return this; } public Builder completedAt(String completedAt) { this.completedAt = Optional.of(completedAt); return this; } @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) public Builder remoteWasDeleted(Optional remoteWasDeleted) { this.remoteWasDeleted = remoteWasDeleted; return this; } public Builder remoteWasDeleted(Boolean remoteWasDeleted) { this.remoteWasDeleted = Optional.of(remoteWasDeleted); return this; } @JsonSetter(value = "ticket_url", nulls = Nulls.SKIP) public Builder ticketUrl(Optional ticketUrl) { this.ticketUrl = ticketUrl; return this; } public Builder ticketUrl(String ticketUrl) { this.ticketUrl = Optional.of(ticketUrl); return this; } @JsonSetter(value = "priority", nulls = Nulls.SKIP) public Builder priority(Optional priority) { this.priority = priority; return this; } public Builder priority(TicketPriority priority) { this.priority = Optional.of(priority); return this; } @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) public Builder modifiedAt(Optional modifiedAt) { this.modifiedAt = modifiedAt; return this; } public Builder modifiedAt(String modifiedAt) { this.modifiedAt = Optional.of(modifiedAt); return this; } @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) public Builder fieldMappings(Optional> fieldMappings) { this.fieldMappings = fieldMappings; return this; } public Builder fieldMappings(Map fieldMappings) { this.fieldMappings = Optional.of(fieldMappings); return this; } @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; return this; } public Builder remoteData(List remoteData) { this.remoteData = Optional.of(remoteData); return this; } @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; return this; } public Builder remoteFields(List remoteFields) { this.remoteFields = Optional.of(remoteFields); return this; } public Ticket build() { return new Ticket( id, remoteId, name, assignees, creator, dueDate, status, description, collections, ticketType, account, contact, parentTicket, attachments, tags, remoteCreatedAt, remoteUpdatedAt, completedAt, remoteWasDeleted, ticketUrl, priority, modifiedAt, fieldMappings, remoteData, remoteFields); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy