Commit 94851cfc authored by Konstantin Tskhovrebov's avatar Konstantin Tskhovrebov 🤖

Apply code style.

parent 92ab3a07
......@@ -6,12 +6,18 @@ import com.google.gson.annotations.SerializedName
* @author Konstantin Tskhovrebov (aka terrakok). Date: 30.03.17
*/
enum class OrderBy(private val jsonName: String) {
@SerializedName("id") ID("id"),
@SerializedName("name") NAME("name"),
@SerializedName("path") PATH("path"),
@SerializedName("created_at") CREATED_AT("created_at"),
@SerializedName("updated_at") UPDATED_AT("updated_at"),
@SerializedName("last_activity_at") LAST_ACTIVITY_AT("last_activity_at");
@SerializedName("id")
ID("id"),
@SerializedName("name")
NAME("name"),
@SerializedName("path")
PATH("path"),
@SerializedName("created_at")
CREATED_AT("created_at"),
@SerializedName("updated_at")
UPDATED_AT("updated_at"),
@SerializedName("last_activity_at")
LAST_ACTIVITY_AT("last_activity_at");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -3,7 +3,7 @@ package ru.terrakok.gitlabclient.entity
import com.google.gson.annotations.SerializedName
import org.threeten.bp.LocalDateTime
data class Owner (
data class Owner(
@SerializedName("id") val id: Long,
@SerializedName("name") val name: String,
@SerializedName("username") val username: String,
......
......@@ -6,9 +6,12 @@ import com.google.gson.annotations.SerializedName
* Created by Eugene Shapovalov (@CraggyHaggy) on 19.11.17.
*/
enum class PushDataAction(private val jsonName: String) {
@SerializedName("pushed") PUSHED("pushed"),
@SerializedName("removed") REMOVED("removed"),
@SerializedName("created") CREATED("created");
@SerializedName("pushed")
PUSHED("pushed"),
@SerializedName("removed")
REMOVED("removed"),
@SerializedName("created")
CREATED("created");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,8 +6,10 @@ import com.google.gson.annotations.SerializedName
* Created by Eugene Shapovalov (@CraggyHaggy) on 05.12.17.
*/
enum class PushDataRefType(private val jsonName: String) {
@SerializedName("branch") BRANCH("branch"),
@SerializedName("tag") TAG("tag");
@SerializedName("branch")
BRANCH("branch"),
@SerializedName("tag")
TAG("tag");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,8 +6,10 @@ import com.google.gson.annotations.SerializedName
* Created by Eugene Shapovalov (@CraggyHaggy) on 08.02.18.
*/
enum class RepositoryTreeNodeType(private val jsonName: String) {
@SerializedName("tree") TREE("tree"),
@SerializedName("blob") BLOB("blob");
@SerializedName("tree")
TREE("tree"),
@SerializedName("blob")
BLOB("blob");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,8 +6,10 @@ import com.google.gson.annotations.SerializedName
* @author Konstantin Tskhovrebov (aka terrakok). Date: 30.03.17
*/
enum class Sort(private val jsonName: String) {
@SerializedName("asc") ASC("asc"),
@SerializedName("desc") DESC("desc");
@SerializedName("asc")
ASC("asc"),
@SerializedName("desc")
DESC("desc");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,9 +6,12 @@ import com.google.gson.annotations.SerializedName
* @author Konstantin Tskhovrebov (aka terrakok). Date: 30.03.17
*/
enum class Visibility(private val jsonName: String) {
@SerializedName("public") PUBLIC("public"),
@SerializedName("internal") INTERNAL("internal"),
@SerializedName("private") PRIVATE("private");
@SerializedName("public")
PUBLIC("public"),
@SerializedName("internal")
INTERNAL("internal"),
@SerializedName("private")
PRIVATE("private");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,23 +6,40 @@ import com.google.gson.annotations.SerializedName
* Created by Konstantin Tskhovrebov (aka @terrakok) on 22.07.17.
*/
enum class EventAction(private val jsonName: String) {
@SerializedName("closed") CLOSED("closed"),
@SerializedName("commented on") COMMENTED_ON("commented on"),
@SerializedName("created") CREATED("created"),
@SerializedName("pushed to") PUSHED_TO("pushed to"),
@SerializedName("pushed new") PUSHED_NEW("pushed new"),
@SerializedName("deleted") DELETED("deleted"),
@SerializedName("accepted") ACCEPTED("accepted"),
@SerializedName("joined") JOINED("joined"),
@SerializedName("updated") UPDATED("updated"),
@SerializedName("reopened") REOPENED("reopened"),
@SerializedName("pushed") PUSHED("pushed"),
@SerializedName("commented") COMMENTED("commented"),
@SerializedName("merged") MERGED("merged"),
@SerializedName("left") LEFT("left"),
@SerializedName("destroyed") DESTROYED("destroyed"),
@SerializedName("expired") EXPIRED("expired"),
@SerializedName("opened") OPENED("opened");
@SerializedName("closed")
CLOSED("closed"),
@SerializedName("commented on")
COMMENTED_ON("commented on"),
@SerializedName("created")
CREATED("created"),
@SerializedName("pushed to")
PUSHED_TO("pushed to"),
@SerializedName("pushed new")
PUSHED_NEW("pushed new"),
@SerializedName("deleted")
DELETED("deleted"),
@SerializedName("accepted")
ACCEPTED("accepted"),
@SerializedName("joined")
JOINED("joined"),
@SerializedName("updated")
UPDATED("updated"),
@SerializedName("reopened")
REOPENED("reopened"),
@SerializedName("pushed")
PUSHED("pushed"),
@SerializedName("commented")
COMMENTED("commented"),
@SerializedName("merged")
MERGED("merged"),
@SerializedName("left")
LEFT("left"),
@SerializedName("destroyed")
DESTROYED("destroyed"),
@SerializedName("expired")
EXPIRED("expired"),
@SerializedName("opened")
OPENED("opened");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,13 +6,20 @@ import com.google.gson.annotations.SerializedName
* Created by Konstantin Tskhovrebov (aka @terrakok) on 22.07.17.
*/
enum class EventTarget(private val jsonName: String) {
@SerializedName("issue") ISSUE("issue"),
@SerializedName("milestone") MILESTONE("milestone"),
@SerializedName("merge_request") MERGE_REQUEST("merge_request"),
@SerializedName("note") NOTE("note"),
@SerializedName("project") PROJECT("project"),
@SerializedName("snippet") SNIPPET("snippet"),
@SerializedName("user") USER("user");
@SerializedName("issue")
ISSUE("issue"),
@SerializedName("milestone")
MILESTONE("milestone"),
@SerializedName("merge_request")
MERGE_REQUEST("merge_request"),
@SerializedName("note")
NOTE("note"),
@SerializedName("project")
PROJECT("project"),
@SerializedName("snippet")
SNIPPET("snippet"),
@SerializedName("user")
USER("user");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,12 +6,18 @@ import com.google.gson.annotations.SerializedName
* Created by Konstantin Tskhovrebov (aka @terrakok) on 22.07.17.
*/
enum class EventTargetType(private val jsonName: String) {
@SerializedName("Issue") ISSUE("Issue"),
@SerializedName("Note") NOTE("Note"),
@SerializedName("DiffNote") DIFF_NOTE("DiffNote"),
@SerializedName("Milestone") MILESTONE("Milestone"),
@SerializedName("MergeRequest") MERGE_REQUEST("MergeRequest"),
@SerializedName("Snippet") SNIPPET("Snippet");
@SerializedName("Issue")
ISSUE("Issue"),
@SerializedName("Note")
NOTE("Note"),
@SerializedName("DiffNote")
DIFF_NOTE("DiffNote"),
@SerializedName("Milestone")
MILESTONE("Milestone"),
@SerializedName("MergeRequest")
MERGE_REQUEST("MergeRequest"),
@SerializedName("Snippet")
SNIPPET("Snippet");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,9 +6,12 @@ import com.google.gson.annotations.SerializedName
* Created by Konstantin Tskhovrebov (aka @terrakok) on 15.07.17.
*/
enum class IssueScope(private val jsonName: String) {
@SerializedName("all") ALL("all"),
@SerializedName("created-by-me") CREATED_BY_ME("created-by-me"),
@SerializedName("assigned-to-me") ASSIGNED_BY_ME("assigned-to-me");
@SerializedName("all")
ALL("all"),
@SerializedName("created-by-me")
CREATED_BY_ME("created-by-me"),
@SerializedName("assigned-to-me")
ASSIGNED_BY_ME("assigned-to-me");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,8 +6,10 @@ import com.google.gson.annotations.SerializedName
* Created by Konstantin Tskhovrebov (aka @terrakok) on 15.07.17.
*/
enum class IssueState(private val jsonName: String) {
@SerializedName("opened") OPENED("opened"),
@SerializedName("closed") CLOSED("closed");
@SerializedName("opened")
OPENED("opened"),
@SerializedName("closed")
CLOSED("closed");
override fun toString() = jsonName
}
......@@ -3,9 +3,12 @@ package ru.terrakok.gitlabclient.entity.mergerequest
import com.google.gson.annotations.SerializedName
enum class MergeRequestMergeStatus(val jsonName: String) {
@SerializedName("can_be_merged") CAN_BE_MERGED("can_be_merged"),
@SerializedName("cannot_be_merged") CANNOT_BE_MERGED("cannot_be_merged"),
@SerializedName("unchecked") UNCHECKED("unchecked");
@SerializedName("can_be_merged")
CAN_BE_MERGED("can_be_merged"),
@SerializedName("cannot_be_merged")
CANNOT_BE_MERGED("cannot_be_merged"),
@SerializedName("unchecked")
UNCHECKED("unchecked");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -3,9 +3,12 @@ package ru.terrakok.gitlabclient.entity.mergerequest
import com.google.gson.annotations.SerializedName
enum class MergeRequestScope(val jsonName: String) {
@SerializedName("created-by-me") CREATED_BY_ME("created-by-me"),
@SerializedName("assigned-to-me") ASSIGNED_TO_ME("assigned-to-me"),
@SerializedName("all") ALL("all");
@SerializedName("created-by-me")
CREATED_BY_ME("created-by-me"),
@SerializedName("assigned-to-me")
ASSIGNED_TO_ME("assigned-to-me"),
@SerializedName("all")
ALL("all");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -3,9 +3,12 @@ package ru.terrakok.gitlabclient.entity.mergerequest
import com.google.gson.annotations.SerializedName
enum class MergeRequestState(val jsonName: String) {
@SerializedName("opened") OPENED("opened"),
@SerializedName("closed") CLOSED("closed"),
@SerializedName("merged") MERGED("merged");
@SerializedName("opened")
OPENED("opened"),
@SerializedName("closed")
CLOSED("closed"),
@SerializedName("merged")
MERGED("merged");
override fun toString() = jsonName
}
......@@ -3,7 +3,8 @@ package ru.terrakok.gitlabclient.entity.mergerequest
import com.google.gson.annotations.SerializedName
enum class MergeRequestViewType(val jsonName: String) {
@SerializedName("simple") SIMPLE("simple");
@SerializedName("simple")
SIMPLE("simple");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -10,24 +10,42 @@ import ru.terrakok.gitlabclient.entity.Milestone
* @author Eugene Shapovalov (CraggyHaggy). Date: 13.09.17
*/
abstract class Target {
@SerializedName("id") private val _id: Long? = null
@SerializedName("iid") private val _iid: Long? = null
@SerializedName("project_id") private val _projectId: Long? = null
@SerializedName("title") private val _title: String? = null
@SerializedName("state") private val _state: TargetState? = null
@SerializedName("updated_at") val updatedAt: LocalDateTime? = null
@SerializedName("created_at") val createdAt: LocalDateTime? = null
@SerializedName("labels") private val _labels: List<String>? = null
@SerializedName("milestone") val milestone: Milestone? = null
@SerializedName("assignees") private val _assignees: List<Assignee>? = null
@SerializedName("author") val _author: Author? = null
@SerializedName("assignee") val assignee: Assignee? = null
@SerializedName("user_notes_count") private val _userNotesCount: Int? = null
@SerializedName("upvotes") private val _upVotes: Int? = null
@SerializedName("downvotes") private val _downVotes: Int? = null
@SerializedName("web_url") val webUrl: String? = null
@SerializedName("subscribed") private val _subscribed: Boolean? = null
@SerializedName("time_stats") val timeStats: TimeStats? = null
@SerializedName("id")
private val _id: Long? = null
@SerializedName("iid")
private val _iid: Long? = null
@SerializedName("project_id")
private val _projectId: Long? = null
@SerializedName("title")
private val _title: String? = null
@SerializedName("state")
private val _state: TargetState? = null
@SerializedName("updated_at")
val updatedAt: LocalDateTime? = null
@SerializedName("created_at")
val createdAt: LocalDateTime? = null
@SerializedName("labels")
private val _labels: List<String>? = null
@SerializedName("milestone")
val milestone: Milestone? = null
@SerializedName("assignees")
private val _assignees: List<Assignee>? = null
@SerializedName("author")
val _author: Author? = null
@SerializedName("assignee")
val assignee: Assignee? = null
@SerializedName("user_notes_count")
private val _userNotesCount: Int? = null
@SerializedName("upvotes")
private val _upVotes: Int? = null
@SerializedName("downvotes")
private val _downVotes: Int? = null
@SerializedName("web_url")
val webUrl: String? = null
@SerializedName("subscribed")
private val _subscribed: Boolean? = null
@SerializedName("time_stats")
val timeStats: TimeStats? = null
val id get() = _id!!
val iid get() = _iid!!
......
......@@ -6,9 +6,12 @@ import com.google.gson.annotations.SerializedName
* @author Eugene Shapovalov (CraggyHaggy). Date: 18.09.17
*/
enum class TargetScope(private val jsonName: String) {
@SerializedName("created-by-me") CREATED_BY_ME("created-by-me"),
@SerializedName("assigned-to-me") ASSIGNED_TO_ME("assigned-to-me"),
@SerializedName("all") ALL("all");
@SerializedName("created-by-me")
CREATED_BY_ME("created-by-me"),
@SerializedName("assigned-to-me")
ASSIGNED_TO_ME("assigned-to-me"),
@SerializedName("all")
ALL("all");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,9 +6,12 @@ import com.google.gson.annotations.SerializedName
* @author Eugene Shapovalov (CraggyHaggy). Date: 18.09.17
*/
enum class TargetState(private val jsonName: String) {
@SerializedName("opened") OPENED("opened"),
@SerializedName("closed") CLOSED("closed"),
@SerializedName("merged") MERGED("merged");
@SerializedName("opened")
OPENED("opened"),
@SerializedName("closed")
CLOSED("closed"),
@SerializedName("merged")
MERGED("merged");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,8 +6,10 @@ import com.google.gson.annotations.SerializedName
* @author Eugene Shapovalov (CraggyHaggy). Date: 11.09.17
*/
enum class TargetType(private val jsonName: String) {
@SerializedName("Issue") ISSUE("Issue"),
@SerializedName("MergeRequest") MERGE_REQUEST("MergeRequest");
@SerializedName("Issue")
ISSUE("Issue"),
@SerializedName("MergeRequest")
MERGE_REQUEST("MergeRequest");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -8,10 +8,14 @@ import ru.terrakok.gitlabclient.entity.target.Target
* @author Eugene Shapovalov (CraggyHaggy). Date: 13.09.17
*/
class Issue : Target() {
@SerializedName("due_date") val dueDate: String? = null
@SerializedName("confidential") private val _confidential: Boolean? = null
@SerializedName("weight") val weight: Long? = null
@SerializedName("_links") val links: Links? = null
@SerializedName("due_date")
val dueDate: String? = null
@SerializedName("confidential")
private val _confidential: Boolean? = null
@SerializedName("weight")
val weight: Long? = null
@SerializedName("_links")
val links: Links? = null
val confidential get() = _confidential!!
}
......@@ -7,18 +7,30 @@ import ru.terrakok.gitlabclient.entity.target.Target
* @author Eugene Shapovalov (CraggyHaggy). Date: 13.09.17
*/
class MergeRequest : Target() {
@SerializedName("source_project_id") private val _sourceProjectId: Long? = null
@SerializedName("target_project_id") private val _targetProjectId: Long? = null
@SerializedName("target_branch") private val _targetBranch: String? = null
@SerializedName("source_branch") private val _sourceBranch: String? = null
@SerializedName("work_in_progress") val _workInProgress: Boolean? = null
@SerializedName("merge_when_pipeline_succeeds") private val _mergeWhenPipelineSucceeds: Boolean? = null
@SerializedName("merge_status") private val _mergeStatus: MergeRequestMergeStatus? = null
@SerializedName("sha") private val _sha: String? = null
@SerializedName("merge_commit_sha") val mergeCommitSha: String? = null
@SerializedName("approvals_before_merge") val approvalsBeforeMerge: Boolean? = null
@SerializedName("force_remove_source_branch") val forceRemoveSourceBranch: Boolean? = null
@SerializedName("squash") private val _squash: Boolean? = null
@SerializedName("source_project_id")
private val _sourceProjectId: Long? = null
@SerializedName("target_project_id")
private val _targetProjectId: Long? = null
@SerializedName("target_branch")
private val _targetBranch: String? = null
@SerializedName("source_branch")
private val _sourceBranch: String? = null
@SerializedName("work_in_progress")
val _workInProgress: Boolean? = null
@SerializedName("merge_when_pipeline_succeeds")
private val _mergeWhenPipelineSucceeds: Boolean? = null
@SerializedName("merge_status")
private val _mergeStatus: MergeRequestMergeStatus? = null
@SerializedName("sha")
private val _sha: String? = null
@SerializedName("merge_commit_sha")
val mergeCommitSha: String? = null
@SerializedName("approvals_before_merge")
val approvalsBeforeMerge: Boolean? = null
@SerializedName("force_remove_source_branch")
val forceRemoveSourceBranch: Boolean? = null
@SerializedName("squash")
private val _squash: Boolean? = null
val sourceProjectId get() = _sourceProjectId!!
val targetProjectId get() = _targetProjectId!!
......
......@@ -6,9 +6,12 @@ import com.google.gson.annotations.SerializedName
* @author Eugene Shapovalov (CraggyHaggy). Date: 18.09.17
*/
enum class MergeRequestMergeStatus(private val jsonName: String) {
@SerializedName("can_be_merged") CAN_BE_MERGED("can_be_merged"),
@SerializedName("cannot_be_merged") CANNOT_BE_MERGED("cannot_be_merged"),
@SerializedName("unchecked") UNCHECKED("unchecked");
@SerializedName("can_be_merged")
CAN_BE_MERGED("can_be_merged"),
@SerializedName("cannot_be_merged")
CANNOT_BE_MERGED("cannot_be_merged"),
@SerializedName("unchecked")
UNCHECKED("unchecked");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,12 +6,18 @@ import com.google.gson.annotations.SerializedName
* @author Eugene Shapovalov (CraggyHaggy). Date: 11.09.17
*/
enum class TodoAction(private val jsonName: String) {
@SerializedName("assigned") ASSIGNED("assigned"),
@SerializedName("mentioned") MENTIONED("mentioned"),
@SerializedName("build_failed") BUILD_FAILED("build_failed"),
@SerializedName("marked") MARKED("marked"),
@SerializedName("approval_required") APPROVAL_REQUIRED("approval_required"),
@SerializedName("directly_addressed") DIRECTLY_ADDRESSED("directly_addressed");
@SerializedName("assigned")
ASSIGNED("assigned"),
@SerializedName("mentioned")
MENTIONED("mentioned"),
@SerializedName("build_failed")
BUILD_FAILED("build_failed"),
@SerializedName("marked")
MARKED("marked"),
@SerializedName("approval_required")
APPROVAL_REQUIRED("approval_required"),
@SerializedName("directly_addressed")
DIRECTLY_ADDRESSED("directly_addressed");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -6,8 +6,10 @@ import com.google.gson.annotations.SerializedName
* @author Eugene Shapovalov (CraggyHaggy). Date: 11.09.17
*/
enum class TodoState(private val jsonName: String) {
@SerializedName("pending") PENDING("pending"),
@SerializedName("done") DONE("done");
@SerializedName("pending")
PENDING("pending"),
@SerializedName("done")
DONE("done");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -120,7 +120,9 @@ fun TargetHeaderTitle.getHumanName(resources: Resources) = when (this) {
when (action) {
TodoAction.ASSIGNED -> {
"$author $actionName $targetName ${resources.getString(R.string.at)} $projectName ${resources.getString(R.string.to)} $assignee"
"$author $actionName $targetName ${resources.getString(R.string.at)} $projectName ${resources.getString(
R.string.to
)} $assignee"