|
| 1 | +package org.gitlab.api.query; |
| 2 | + |
| 3 | +import org.gitlab.api.models.GitlabAccessLevel; |
| 4 | + |
| 5 | +import java.io.UnsupportedEncodingException; |
| 6 | + |
| 7 | +public class ProjectsQuery extends PaginationQuery { |
| 8 | + |
| 9 | + public static final String PARAM_ARCHIVED = "archived"; |
| 10 | + public static final String PARAM_VISIBILITY = "visibility"; |
| 11 | + public static final String PARAM_ORDER_BY = "order_by"; |
| 12 | + public static final String PARAM_SORT = "sort"; |
| 13 | + public static final String PARAM_SEARCH = "search"; |
| 14 | + public static final String PARAM_SIMPLE = "simple"; |
| 15 | + public static final String PARAM_OWNED = "owned"; |
| 16 | + public static final String PARAM_MEMBERSHIP = "membership"; |
| 17 | + public static final String PARAM_STARRED = "starred"; |
| 18 | + public static final String PARAM_STATISTICS = "statistics"; |
| 19 | + public static final String PARAM_WITH_CUSTOM_ATTRIBUTES = "with_custom_attributes"; |
| 20 | + public static final String PARAM_WITH_ISSUES_ENABLED = "with_issues_enabled"; |
| 21 | + public static final String PARAM_WITH_MERGE_REQUESTS_ENABLED = "with_merge_requests_enabled"; |
| 22 | + public static final String PARAM_WITH_PROGRAMMING_LANGUAGE = "with_programming_language"; |
| 23 | + public static final String PARAM_WIKI_CHECKSUM_FAILED = "wiki_checksum_failed"; |
| 24 | + public static final String PARAM_REPOSITORY_CHECKSUM_FAILED = "repository_checksum_failed"; |
| 25 | + public static final String PARAM_MIN_ACCESS_LEVEL = "min_access_level"; |
| 26 | + |
| 27 | + public void setArchived(Boolean archived) throws UnsupportedEncodingException { |
| 28 | + appendIf(PARAM_ARCHIVED, archived); |
| 29 | + } |
| 30 | + |
| 31 | + public ProjectsQuery withArchived(Boolean archived) throws UnsupportedEncodingException { |
| 32 | + setArchived(archived); |
| 33 | + return this; |
| 34 | + } |
| 35 | + |
| 36 | + public void setVisibility(String visibility) throws UnsupportedEncodingException { |
| 37 | + appendIf(PARAM_VISIBILITY, visibility); |
| 38 | + } |
| 39 | + |
| 40 | + public ProjectsQuery withVisibility(String visibility) throws UnsupportedEncodingException { |
| 41 | + setVisibility(visibility); |
| 42 | + return this; |
| 43 | + } |
| 44 | + |
| 45 | + public void setOrderBy(String orderBy) throws UnsupportedEncodingException { |
| 46 | + appendIf(PARAM_ORDER_BY, orderBy); |
| 47 | + } |
| 48 | + |
| 49 | + public ProjectsQuery withOrderBy(String orderBy) throws UnsupportedEncodingException { |
| 50 | + setOrderBy(orderBy); |
| 51 | + return this; |
| 52 | + } |
| 53 | + |
| 54 | + public void setSort(String sort) throws UnsupportedEncodingException { |
| 55 | + appendIf(PARAM_SORT, sort); |
| 56 | + } |
| 57 | + |
| 58 | + public ProjectsQuery withSort(String sort) throws UnsupportedEncodingException { |
| 59 | + setSort(sort); |
| 60 | + return this; |
| 61 | + } |
| 62 | + |
| 63 | + public void setSearch(String search) throws UnsupportedEncodingException { |
| 64 | + appendIf(PARAM_SEARCH, search); |
| 65 | + } |
| 66 | + |
| 67 | + public ProjectsQuery withSearch(String search) throws UnsupportedEncodingException { |
| 68 | + setSearch(search); |
| 69 | + return this; |
| 70 | + } |
| 71 | + |
| 72 | + public void setSimple(Boolean simple) throws UnsupportedEncodingException { |
| 73 | + appendIf(PARAM_SIMPLE, simple); |
| 74 | + } |
| 75 | + |
| 76 | + public ProjectsQuery withSimple(Boolean simple) throws UnsupportedEncodingException { |
| 77 | + setSimple(simple); |
| 78 | + return this; |
| 79 | + } |
| 80 | + |
| 81 | + public void setOwned(Boolean owned) throws UnsupportedEncodingException { |
| 82 | + appendIf(PARAM_OWNED, owned); |
| 83 | + } |
| 84 | + |
| 85 | + public ProjectsQuery withOwned(Boolean owned) throws UnsupportedEncodingException { |
| 86 | + setOwned(owned); |
| 87 | + return this; |
| 88 | + } |
| 89 | + |
| 90 | + public void setMembership(Boolean membership) throws UnsupportedEncodingException { |
| 91 | + appendIf(PARAM_MEMBERSHIP, membership); |
| 92 | + } |
| 93 | + |
| 94 | + public ProjectsQuery withMembership(Boolean membership) throws UnsupportedEncodingException { |
| 95 | + setMembership(membership); |
| 96 | + return this; |
| 97 | + } |
| 98 | + |
| 99 | + public void setStarred(Boolean starred) throws UnsupportedEncodingException { |
| 100 | + appendIf(PARAM_STARRED, starred); |
| 101 | + } |
| 102 | + |
| 103 | + public ProjectsQuery withStarred(Boolean starred) throws UnsupportedEncodingException { |
| 104 | + setStarred(starred); |
| 105 | + return this; |
| 106 | + } |
| 107 | + |
| 108 | + public void setStatistics(Boolean statistics) throws UnsupportedEncodingException { |
| 109 | + appendIf(PARAM_STATISTICS, statistics); |
| 110 | + } |
| 111 | + |
| 112 | + public ProjectsQuery withStatistics(Boolean statistics) throws UnsupportedEncodingException { |
| 113 | + setStatistics(statistics); |
| 114 | + return this; |
| 115 | + } |
| 116 | + |
| 117 | + public void setWithCustomAttributes(Boolean withCustomAttributes) throws UnsupportedEncodingException { |
| 118 | + appendIf(PARAM_WITH_CUSTOM_ATTRIBUTES, withCustomAttributes); |
| 119 | + } |
| 120 | + |
| 121 | + public ProjectsQuery withWithCustomAttributes(Boolean withCustomAttributes) throws UnsupportedEncodingException { |
| 122 | + setWithCustomAttributes(withCustomAttributes); |
| 123 | + return this; |
| 124 | + } |
| 125 | + |
| 126 | + public void setWithIssuesEnabled(Boolean withIssuesEnabled) throws UnsupportedEncodingException { |
| 127 | + appendIf(PARAM_WITH_ISSUES_ENABLED, withIssuesEnabled); |
| 128 | + } |
| 129 | + |
| 130 | + public ProjectsQuery withWithIssuesEnabled(Boolean withIssuesEnabled) throws UnsupportedEncodingException { |
| 131 | + setWithIssuesEnabled(withIssuesEnabled); |
| 132 | + return this; |
| 133 | + } |
| 134 | + |
| 135 | + public void setWithMergeRequestsEnabled(Boolean withMergeRequestsEnabled) throws UnsupportedEncodingException { |
| 136 | + appendIf(PARAM_WITH_MERGE_REQUESTS_ENABLED, withMergeRequestsEnabled); |
| 137 | + } |
| 138 | + |
| 139 | + public ProjectsQuery withWithMergeRequestsEnabled(Boolean withMergeRequestsEnabled) throws UnsupportedEncodingException { |
| 140 | + setWithMergeRequestsEnabled(withMergeRequestsEnabled); |
| 141 | + return this; |
| 142 | + } |
| 143 | + |
| 144 | + public void setWithProgrammingLanguage(String withProgrammingLanguage) throws UnsupportedEncodingException { |
| 145 | + appendIf(PARAM_WITH_PROGRAMMING_LANGUAGE, withProgrammingLanguage); |
| 146 | + } |
| 147 | + |
| 148 | + public ProjectsQuery withWithProgrammingLanguage(String withProgrammingLanguage) throws UnsupportedEncodingException { |
| 149 | + setWithProgrammingLanguage(withProgrammingLanguage); |
| 150 | + return this; |
| 151 | + } |
| 152 | + |
| 153 | + public void setWikiChecksumFailed(Boolean wikiChecksumFailed) throws UnsupportedEncodingException { |
| 154 | + appendIf(PARAM_WIKI_CHECKSUM_FAILED, wikiChecksumFailed); |
| 155 | + } |
| 156 | + |
| 157 | + public ProjectsQuery withWikiChecksumFailed(Boolean wikiChecksumFailed) throws UnsupportedEncodingException { |
| 158 | + setWikiChecksumFailed(wikiChecksumFailed); |
| 159 | + return this; |
| 160 | + } |
| 161 | + |
| 162 | + public void setRepositoryChecksumFailed(Boolean repositoryChecksumFailed) throws UnsupportedEncodingException { |
| 163 | + appendIf(PARAM_REPOSITORY_CHECKSUM_FAILED, repositoryChecksumFailed); |
| 164 | + } |
| 165 | + |
| 166 | + public ProjectsQuery withRepositoryChecksumFailed(Boolean repositoryChecksumFailed) throws UnsupportedEncodingException { |
| 167 | + setRepositoryChecksumFailed(repositoryChecksumFailed); |
| 168 | + return this; |
| 169 | + } |
| 170 | + |
| 171 | + public void setMinAccessLevel(GitlabAccessLevel minAccessLevel) throws UnsupportedEncodingException { |
| 172 | + appendIf(PARAM_MIN_ACCESS_LEVEL, minAccessLevel); |
| 173 | + } |
| 174 | + |
| 175 | + public ProjectsQuery withMinAccessLevel(GitlabAccessLevel minAccessLevel) throws UnsupportedEncodingException { |
| 176 | + setMinAccessLevel(minAccessLevel); |
| 177 | + return this; |
| 178 | + } |
| 179 | + |
| 180 | + @Override |
| 181 | + public ProjectsQuery withPage(int page) { |
| 182 | + super.withPage(page); |
| 183 | + return this; |
| 184 | + } |
| 185 | + |
| 186 | + @Override |
| 187 | + public ProjectsQuery withPerPage(int perPage) { |
| 188 | + super.withPerPage(perPage); |
| 189 | + return this; |
| 190 | + } |
| 191 | + |
| 192 | +} |
0 commit comments