Skip to content

Commit 752622f

Browse files
committed
Added constants for the SearchApi (#425).
1 parent be795a9 commit 752622f

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

src/main/java/org/gitlab4j/api/Constants.java

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,4 +614,80 @@ public String toString() {
614614
return (enumHelper.toString(this));
615615
}
616616
}
617+
618+
/**
619+
* Enum for the search scope when doing a globalSearch() with the SearchApi.
620+
*/
621+
public enum SearchScope {
622+
623+
PROJECTS, ISSUES, MERGE_REQUESTS, MILESTONES, SNIPPET_TITLES, SNIPPET_BLOBS, USERS,
624+
BLOBS, COMMITS, WIKI_BLOBS;
625+
626+
private static JacksonJsonEnumHelper<SearchScope> enumHelper = new JacksonJsonEnumHelper<>(SearchScope.class);
627+
628+
@JsonCreator
629+
public static SearchScope forValue(String value) {
630+
return enumHelper.forValue(value);
631+
}
632+
633+
@JsonValue
634+
public String toValue() {
635+
return (enumHelper.toString(this));
636+
}
637+
638+
@Override
639+
public String toString() {
640+
return (enumHelper.toString(this));
641+
}
642+
}
643+
644+
/**
645+
* Enum for the search scope when doing a groupSearch() with the SearchApi.
646+
*/
647+
public enum GroupSearchScope {
648+
649+
PROJECTS, ISSUES, MERGE_REQUESTS, MILESTONES, USERS;
650+
651+
private static JacksonJsonEnumHelper<GroupSearchScope> enumHelper = new JacksonJsonEnumHelper<>(GroupSearchScope.class);
652+
653+
@JsonCreator
654+
public static GroupSearchScope forValue(String value) {
655+
return enumHelper.forValue(value);
656+
}
657+
658+
@JsonValue
659+
public String toValue() {
660+
return (enumHelper.toString(this));
661+
}
662+
663+
@Override
664+
public String toString() {
665+
return (enumHelper.toString(this));
666+
}
667+
}
668+
669+
/**
670+
* Enum for the search scope when doing a projectSearch() with the SearchApi.
671+
*/
672+
public enum ProjectSearchScope {
673+
674+
BLOBS, COMMITS, ISSUES, MERGE_REQUESTS, MILESTONES, NOTES, WIKI_BLOBS, USERS;
675+
676+
private static JacksonJsonEnumHelper<ProjectSearchScope> enumHelper = new JacksonJsonEnumHelper<>(ProjectSearchScope.class);
677+
678+
@JsonCreator
679+
public static ProjectSearchScope forValue(String value) {
680+
return enumHelper.forValue(value);
681+
}
682+
683+
@JsonValue
684+
public String toValue() {
685+
return (enumHelper.toString(this));
686+
}
687+
688+
@Override
689+
public String toString() {
690+
return (enumHelper.toString(this));
691+
}
692+
}
617693
}

0 commit comments

Comments
 (0)