Class ManageMilestoneGitHubAction
java.lang.Object
me.julb.applications.github.actions.ManageMilestoneGitHubAction
- All Implemented Interfaces:
me.julb.sdk.github.actions.spi.GitHubActionProvider
public class ManageMilestoneGitHubAction
extends Object
implements me.julb.sdk.github.actions.spi.GitHubActionProvider
The action to manage milestones.
- Author:
- Julb.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidConnects to GitHub API.(package private) org.kohsuke.github.GHMilestonecreateGHMilestone(@NonNull String title, @NonNull org.kohsuke.github.GHMilestoneState state, @NonNull Optional<String> description, @NonNull Optional<Date> dueOn, @NonNull Optional<org.kohsuke.github.GHMilestone> existingMilestone) Creates or updates theGHMilestoneif any.(package private) voiddeleteGHMilestone(@NonNull Optional<org.kohsuke.github.GHMilestone> milestoneToDelete) Deletes theGHMilestoneif any.voidexecute()(package private) Optional<org.kohsuke.github.GHMilestone>getGHMilestone(@NonNull String title) Gets theGHMilestonemilestone matching the given title.Gets the "description" input.Gets the "due_on" input.(package private) InputMilestoneStateGets the "state" input.(package private) StringGets the "title" input.
-
Constructor Details
-
ManageMilestoneGitHubAction
public ManageMilestoneGitHubAction()
-
-
Method Details
-
execute
public void execute()- Specified by:
executein interfaceme.julb.sdk.github.actions.spi.GitHubActionProvider
-
getInputTitle
String getInputTitle()Gets the "title" input.- Returns:
- the "title" input.
-
getInputState
InputMilestoneState getInputState()Gets the "state" input.- Returns:
- the "state" input.
-
getInputDescription
Gets the "description" input.- Returns:
- the "description" input.
-
getInputDueOn
Gets the "due_on" input.- Returns:
- the "due_on" input.
-
connectApi
Connects to GitHub API.- Throws:
IOException- if an error occurs.
-
getGHMilestone
Optional<org.kohsuke.github.GHMilestone> getGHMilestone(@NonNull @NonNull String title) throws IOException Gets theGHMilestonemilestone matching the given title.- Parameters:
title- the milestone title to look for.- Returns:
- the
GHMilestonefor the given title if exists,falseotherwise. - Throws:
IOException- if an error occurs.
-
createGHMilestone
org.kohsuke.github.GHMilestone createGHMilestone(@NonNull @NonNull String title, @NonNull @NonNull org.kohsuke.github.GHMilestoneState state, @NonNull @NonNull Optional<String> description, @NonNull @NonNull Optional<Date> dueOn, @NonNull @NonNull Optional<org.kohsuke.github.GHMilestone> existingMilestone) throws IOException Creates or updates theGHMilestoneif any.- Parameters:
title- the milestone title.state- the milestone state.description- the milestone description, orOptional.empty()if the description is empty.dueOn- the milestone due on date, orOptional.empty()if there is no due date.existingMilestone- the existing milestone, orOptional.empty()if there is no existing milestone.- Returns:
- the
GHMilestonecreated or updated. - Throws:
IOException- if an error occurs.
-
deleteGHMilestone
void deleteGHMilestone(@NonNull @NonNull Optional<org.kohsuke.github.GHMilestone> milestoneToDelete) throws IOException Deletes theGHMilestoneif any.- Parameters:
milestoneToDelete- theGHMilestoneto delete, orOptional.empty().- Throws:
IOException- if an error occurs.
-