|
| 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.prs; |
| 22 | + |
| 23 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 24 | +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
| 25 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| 26 | +import com.spotify.github.GithubStyle; |
| 27 | +import java.util.Optional; |
| 28 | +import org.immutables.value.Value; |
| 29 | + |
| 30 | +/** |
| 31 | + * The parameters for creating a review for a Pull Request. |
| 32 | + * |
| 33 | + * @see "https://developer.github.com/v3/pulls/reviews/#input" |
| 34 | + */ |
| 35 | +@Value.Immutable |
| 36 | +@GithubStyle |
| 37 | +@JsonSerialize(as = ImmutableReviewParameters.class) |
| 38 | +@JsonDeserialize(as = ImmutableReviewParameters.class) |
| 39 | +@JsonInclude(JsonInclude.Include.NON_ABSENT) |
| 40 | +public abstract class ReviewParameters { |
| 41 | + /** |
| 42 | + * SHA of the commit that needs a review. If not the latest, the review may be outdated. |
| 43 | + * Defaults to the most recent commit in the PR when you do not specify a value. |
| 44 | + * |
| 45 | + * @return the optional commitId. |
| 46 | + */ |
| 47 | + public abstract Optional<String> commitId(); |
| 48 | + |
| 49 | + /** |
| 50 | + * **required** when using REQUEST_CHANGES or COMMENT for the event. |
| 51 | + * |
| 52 | + * @return the optional body for REQUEST_CHANGES or COMMENT events. |
| 53 | + */ |
| 54 | + public abstract Optional<String> body(); |
| 55 | + |
| 56 | + /** |
| 57 | + * Review action you want to perform. Should be one of: APPROVE, REQUEST_CHANGES or COMMENT. |
| 58 | + * |
| 59 | + * @return the review action to perform. |
| 60 | + */ |
| 61 | + public abstract String event(); |
| 62 | + |
| 63 | + // FIXME: add the missing input for reviews: array of comment objects. |
| 64 | +} |
0 commit comments