Class OrganizationLinkerService
java.lang.Object
edu.ucsb.cs156.frontiers.services.OrganizationLinkerService
-
Constructor Summary
ConstructorsConstructorDescriptionOrganizationLinkerService(org.springframework.boot.web.client.RestTemplateBuilder restTemplateBuilder) -
Method Summary
Modifier and TypeMethodDescriptioncheckCourseWarnings(Course course) getDefaultRepositoryPermission(Course course) Retrieves the default repository permission for the GitHub organization linked to a course.getOrgName(String installation_id) Provides the name of the organization attached to a particular installation IDReturns the URL for a redirect to install FrontiersvoidunenrollOrganization(Course course) Removes the Frontiers installation from the linked GitHub org
-
Constructor Details
-
OrganizationLinkerService
public OrganizationLinkerService(org.springframework.boot.web.client.RestTemplateBuilder restTemplateBuilder)
-
-
Method Details
-
getRedirectUrl
public String getRedirectUrl() throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingExceptionReturns the URL for a redirect to install Frontiers- Returns:
- URL to install Frontiers to an organization
- Throws:
NoSuchAlgorithmExceptionInvalidKeySpecExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
getOrgName
public String getOrgName(String installation_id) throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingException Provides the name of the organization attached to a particular installation ID- Parameters:
installation_id- ID of the app installation- Returns:
- name of the organization attached to the installation
- Throws:
NoSuchAlgorithmExceptionInvalidKeySpecExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
checkCourseWarnings
public CourseWarning checkCourseWarnings(Course course) throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingException, NoLinkedOrganizationException - Throws:
NoSuchAlgorithmExceptionInvalidKeySpecExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionNoLinkedOrganizationException
-
getDefaultRepositoryPermission
public String getDefaultRepositoryPermission(Course course) throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingException, NoLinkedOrganizationException Retrieves the default repository permission for the GitHub organization linked to a course.- Parameters:
course- The course whose linked organization is queried.- Returns:
- The organization's default repository permission (e.g.
none,read). - Throws:
NoSuchAlgorithmExceptionInvalidKeySpecExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionNoLinkedOrganizationException
-
unenrollOrganization
public void unenrollOrganization(Course course) throws NoSuchAlgorithmException, InvalidKeySpecException Removes the Frontiers installation from the linked GitHub org- Parameters:
course- The entity for the course about to be deleted- Throws:
NoSuchAlgorithmExceptionInvalidKeySpecException
-