Skip to content

Commit 881ef33

Browse files
committed
feat: Add auto_merge field to the PR class
1 parent bcd052d commit 881ef33

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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.databind.annotation.JsonDeserialize;
24+
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
25+
import com.spotify.github.GithubStyle;
26+
import com.spotify.github.v3.User;
27+
import org.immutables.value.Value;
28+
29+
import javax.annotation.Nullable;
30+
31+
@Value.Immutable
32+
@GithubStyle
33+
@JsonSerialize(as = ImmutableAutoMerge.class)
34+
@JsonDeserialize(as = ImmutableAutoMerge.class)
35+
public interface AutoMerge {
36+
// Who enabled the auto merge
37+
User enabledBy();
38+
39+
// Merge Method chosen for the auto merge
40+
String mergeMethod();
41+
42+
// The commit title to use when merging the pull request
43+
@Nullable
44+
String commitTitle();
45+
46+
// The commit message to use when merging the pull request
47+
@Nullable
48+
String commitMessage();
49+
}

src/main/java/com/spotify/github/v3/prs/PullRequest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -87,4 +87,7 @@ public interface PullRequest extends PullRequestItem {
8787

8888
@Nullable
8989
List<Label> labels();
90+
91+
@Nullable
92+
AutoMerge autoMerge();
9093
}

0 commit comments

Comments
 (0)