|
| 1 | +/*- |
| 2 | + * -\-\- |
| 3 | + * github-api |
| 4 | + * -- |
| 5 | + * Copyright (C) 2016 - 2020 Spotify AB |
| 6 | + * -- |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + * -/-/- |
| 19 | + */ |
| 20 | + |
| 21 | +package com.spotify.github.v3.actions.workflowruns; |
| 22 | + |
| 23 | +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
| 24 | +import com.spotify.github.GithubStyle; |
| 25 | +import com.spotify.github.v3.User; |
| 26 | +import com.spotify.github.v3.prs.PullRequestItem; |
| 27 | +import com.spotify.github.v3.repos.PushCommit; |
| 28 | +import org.immutables.value.Value; |
| 29 | + |
| 30 | +import javax.annotation.Nullable; |
| 31 | +import java.time.ZonedDateTime; |
| 32 | +import java.util.List; |
| 33 | + |
| 34 | +@Value.Immutable |
| 35 | +@GithubStyle |
| 36 | +@JsonDeserialize(as = ImmutableWorkflowRunResponse.class) |
| 37 | +public interface WorkflowRunResponse { |
| 38 | + |
| 39 | + /** |
| 40 | + * The ID of the Workflow Run. |
| 41 | + * (Required) |
| 42 | + */ |
| 43 | + long id(); |
| 44 | + |
| 45 | + /** |
| 46 | + * The name of the Workflow Run. |
| 47 | + * Not required as per schema. |
| 48 | + */ |
| 49 | + @Nullable |
| 50 | + String name(); |
| 51 | + |
| 52 | + /** |
| 53 | + * Github api node id. See <a href="https://docs.github.com/en/graphql/guides/using-global-node-ids">Using Global Node ids</a> |
| 54 | + * (Required) |
| 55 | + */ |
| 56 | + String nodeId(); |
| 57 | + |
| 58 | + /** |
| 59 | + * The ID of the associated check suite. |
| 60 | + * Not required as per schema. |
| 61 | + */ |
| 62 | + @Nullable |
| 63 | + Long checkSuiteId(); |
| 64 | + |
| 65 | + /** |
| 66 | + * The node ID of the associated check suite. |
| 67 | + * Not required as per schema. |
| 68 | + */ |
| 69 | + @Nullable |
| 70 | + String checkSuiteNodeId(); |
| 71 | + |
| 72 | + /** |
| 73 | + * The branch of the head commit that points to the version of the workflow being run. |
| 74 | + * (Required) |
| 75 | + */ |
| 76 | + String headBranch(); |
| 77 | + |
| 78 | + /** |
| 79 | + * The SHA of the head commit that points to the version of the workflow being run. |
| 80 | + * (Required) |
| 81 | + */ |
| 82 | + String headSha(); |
| 83 | + |
| 84 | + /** |
| 85 | + * The full path of the workflow |
| 86 | + * (Required) |
| 87 | + */ |
| 88 | + String path(); |
| 89 | + |
| 90 | + /** |
| 91 | + * The auto incrementing run number for the Workflow Run. |
| 92 | + * (Required) |
| 93 | + */ |
| 94 | + Integer runNumber(); |
| 95 | + |
| 96 | + /** |
| 97 | + * Attempt number of the run, 1 for first attempt and higher if the workflow was re-run. |
| 98 | + * Not required as per schema. |
| 99 | + */ |
| 100 | + @Nullable |
| 101 | + Integer runAttempt(); |
| 102 | + |
| 103 | + /** |
| 104 | + * The event that lead to the trigger of this Workflow Run |
| 105 | + * (Required) |
| 106 | + */ |
| 107 | + String event(); |
| 108 | + |
| 109 | + /** |
| 110 | + * The status of this Workflow Run. |
| 111 | + * (Required) |
| 112 | + */ |
| 113 | + WorkflowRunStatus status(); |
| 114 | + |
| 115 | + /** |
| 116 | + * The result of the run. |
| 117 | + */ |
| 118 | + @Nullable |
| 119 | + String conclusion(); |
| 120 | + |
| 121 | + /** |
| 122 | + * The ID of the parent workflow. |
| 123 | + * (Required) |
| 124 | + */ |
| 125 | + Integer workflowId(); |
| 126 | + |
| 127 | + /** |
| 128 | + * The URL to the Workflow Run. |
| 129 | + * (Required) |
| 130 | + */ |
| 131 | + String url(); |
| 132 | + |
| 133 | + /** |
| 134 | + * URL for viewing the Workflow run on a browser |
| 135 | + * (Required) |
| 136 | + */ |
| 137 | + String htmlUrl(); |
| 138 | + |
| 139 | + /** |
| 140 | + * When the Workflow Run was created |
| 141 | + * (Required) |
| 142 | + */ |
| 143 | + ZonedDateTime createdAt(); |
| 144 | + |
| 145 | + /** |
| 146 | + * When the Workflow Run was last updated |
| 147 | + * (Required) |
| 148 | + */ |
| 149 | + ZonedDateTime updatedAt(); |
| 150 | + |
| 151 | + /** |
| 152 | + * The start time of the latest run. Resets on re-run. |
| 153 | + * Not required as per schema. |
| 154 | + */ |
| 155 | + @Nullable |
| 156 | + ZonedDateTime runStartedAt(); |
| 157 | + |
| 158 | + /** |
| 159 | + * The URL to the jobs for the Workflow Run. |
| 160 | + * (Required) |
| 161 | + */ |
| 162 | + String jobsUrl(); |
| 163 | + |
| 164 | + /** |
| 165 | + * The URL to download the logs for the Workflow Run. |
| 166 | + * (Required) |
| 167 | + */ |
| 168 | + String logsUrl(); |
| 169 | + |
| 170 | + /** |
| 171 | + * The URL to the associated check suite. |
| 172 | + * (Required) |
| 173 | + */ |
| 174 | + String checkSuiteUrl(); |
| 175 | + |
| 176 | + /** |
| 177 | + * The URL to the artifacts for the Workflow Run. |
| 178 | + * (Required) |
| 179 | + */ |
| 180 | + String artifactsUrl(); |
| 181 | + |
| 182 | + /** |
| 183 | + * The URL to cancel the Workflow Run. |
| 184 | + * (Required) |
| 185 | + */ |
| 186 | + String cancelUrl(); |
| 187 | + |
| 188 | + /** |
| 189 | + * The URL to rerun the Workflow Run. |
| 190 | + * (Required) |
| 191 | + */ |
| 192 | + String rerunUrl(); |
| 193 | + |
| 194 | + /** |
| 195 | + * The URL to the previous attempted run of this workflow, if one exists. |
| 196 | + * Not required as per schema. |
| 197 | + */ |
| 198 | + @Nullable |
| 199 | + String previousAttemptUrl(); |
| 200 | + |
| 201 | + /** |
| 202 | + * The URL to the workflow. |
| 203 | + * (Required) |
| 204 | + */ |
| 205 | + String workflowUrl(); |
| 206 | + |
| 207 | + /** |
| 208 | + * The event-specific title associated with the run or the run-name if set, or the value of `run-name` if it is set in the workflow. |
| 209 | + * (Required) |
| 210 | + */ |
| 211 | + String displayTitle(); |
| 212 | + |
| 213 | + /** |
| 214 | + * Pull requests that are open with a `head_sha` or `head_branch` that matches the Workflow Run. The returned pull requests do not necessarily indicate pull requests that triggered the run. |
| 215 | + * (Required) |
| 216 | + */ |
| 217 | + List<PullRequestItem> pullRequests(); |
| 218 | + |
| 219 | + /** |
| 220 | + * The GitHub user that triggered the initial Workflow Run. If the Workflow Run is a re-run, this value may differ from triggeringActor. Any workflow re-runs will use the privileges of actor, even if the actor initiating the re-run (triggeringActor) has different privileges. |
| 221 | + * Not required as per schema. |
| 222 | + */ |
| 223 | + @Nullable |
| 224 | + User actor(); |
| 225 | + |
| 226 | + /** |
| 227 | + * The GitHub user that initiated the Workflow Run. If the Workflow Run is a re-run, this value may differ from actor. Any workflow re-runs will use the privileges of actor, even if the actor initiating the re-run (triggeringActor) has different privileges. |
| 228 | + * Not required as per schema. |
| 229 | + */ |
| 230 | + @Nullable |
| 231 | + User triggeringActor(); |
| 232 | + |
| 233 | + /** |
| 234 | + * The head commit that points to the version of code the workflow being run on. |
| 235 | + * <p> |
| 236 | + * (Required) |
| 237 | + */ |
| 238 | + PushCommit headCommit(); |
| 239 | +} |
| 240 | + |
0 commit comments