Class GHPermission
java.lang.Object
io.github.coho04.githubapi.bases.GHBase
io.github.coho04.githubapi.entities.GHPermission
- All Implemented Interfaces:
HttpRequestInterface
,JSONHelper
Represents the permissions for a GitHub repository.
This class provides methods to access the permissions associated with a repository.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
JSONHelper.JSONToObject<T>
-
Constructor Summary
ConstructorsConstructorDescriptionGHPermission
(org.json.JSONObject jsonObject) Constructs a new GHPermission instance with the provided JSON object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isAdmin()
Returns whether the admin permission is granted.boolean
Returns whether the maintain permission is granted.boolean
isPull()
Returns whether the pull permission is granted.boolean
isPush()
Returns whether the push permission is granted.boolean
isTriage()
Returns whether the triage permission is granted.Methods inherited from class io.github.coho04.githubapi.bases.GHBase
fetchArrayData, fetchArrayData, fetchPaginatedData, fetchPaginatedData, fetchPaginatedData, getBaseUrl, toJSONObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.coho04.githubapi.interfaces.HttpRequestInterface
extractNextPageUrl, sendDeleteRequest, sendDeleteRequestWithResponseCode, sendGetRequest, sendGetRequestWithLinkHeader, sendGetRequestWithResponseCode, sendPatchRequest, sendPostRequest, sendPutRequest
Methods inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
getArrayOrNull, getBooleanOrNull, getIntOrNull, getJSONArrayToStringList, getJSONObjectOrNull, getLocalDateOrNull, getLongOrNull, getStringOrNull
-
Constructor Details
-
GHPermission
public GHPermission(org.json.JSONObject jsonObject) Constructs a new GHPermission instance with the provided JSON object.- Parameters:
jsonObject
- the JSON object containing the permission data
-
-
Method Details
-
isPull
public boolean isPull()Returns whether the pull permission is granted.- Returns:
- true if the pull permission is granted, false otherwise
-
isMaintain
public boolean isMaintain()Returns whether the maintain permission is granted.- Returns:
- true if the maintain permission is granted, false otherwise
-
isAdmin
public boolean isAdmin()Returns whether the admin permission is granted.- Returns:
- true if the admin permission is granted, false otherwise
-
isTriage
public boolean isTriage()Returns whether the triage permission is granted.- Returns:
- true if the triage permission is granted, false otherwise
-
isPush
public boolean isPush()Returns whether the push permission is granted.- Returns:
- true if the push permission is granted, false otherwise
-