Events of this type are not visible in timelines. These events are only used to trigger hooks. 34 | */ 35 | @Value.Immutable 36 | @GithubStyle 37 | @JsonSerialize(as = ImmutableDeploymentEvent.class) 38 | @JsonDeserialize(as = ImmutableDeploymentEvent.class) 39 | public interface DeploymentEvent extends BaseEvent { 40 | 41 | /** Deployment */ 42 | @Nullable 43 | Deployment deployment(); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/spotify/github/v3/activity/events/DeploymentStatusEvent.java: -------------------------------------------------------------------------------- 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.activity.events; 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.repos.Deployment; 27 | import com.spotify.github.v3.repos.Status; 28 | import javax.annotation.Nullable; 29 | import org.immutables.value.Value; 30 | 31 | /** 32 | * Represents a deployment status. 33 | * 34 | *
Events of this type are not visible in timelines. These events are only used to trigger hooks.
35 | */
36 | @Value.Immutable
37 | @GithubStyle
38 | @JsonSerialize(as = ImmutableDeploymentStatusEvent.class)
39 | @JsonDeserialize(as = ImmutableDeploymentStatusEvent.class)
40 | public interface DeploymentStatusEvent extends BaseEvent {
41 |
42 | /** The deployment status. */
43 | @Nullable
44 | Status deploymentStatus();
45 |
46 | /** Deployment */
47 | @Nullable
48 | Deployment deployment();
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/com/spotify/github/v3/activity/events/EventInstallation.java:
--------------------------------------------------------------------------------
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.activity.events;
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 org.immutables.value.Value;
27 |
28 | /**
29 | * The Event installation resource. Contained in events payloads, in case they come from a Github
30 | * App.
31 | */
32 | @Value.Immutable
33 | @GithubStyle
34 | @JsonSerialize(as = ImmutableEventInstallation.class)
35 | @JsonDeserialize(as = ImmutableEventInstallation.class)
36 | public interface EventInstallation {
37 | /**
38 | * The Installation ID.
39 | *
40 | * @return the ID
41 | */
42 | Integer id();
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/com/spotify/github/v3/activity/events/ForkEvent.java:
--------------------------------------------------------------------------------
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.activity.events;
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.repos.Repository;
27 | import javax.annotation.Nullable;
28 | import org.immutables.value.Value;
29 |
30 | /** Triggered when a user forks a repository. */
31 | @Value.Immutable
32 | @GithubStyle
33 | @JsonSerialize(as = ImmutableForkEvent.class)
34 | @JsonDeserialize(as = ImmutableForkEvent.class)
35 | public interface ForkEvent extends BaseEvent {
36 |
37 | /** The {@link Repository} that was created. */
38 | @Nullable
39 | Repository forkee();
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/com/spotify/github/v3/activity/events/IssuesEvent.java:
--------------------------------------------------------------------------------
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.activity.events;
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.issues.Issue;
27 | import javax.annotation.Nullable;
28 | import org.immutables.value.Value;
29 |
30 | /**
31 | * Triggered when an issue is assigned, unassigned, labeled, unlabeled, opened, edited, closed, or
32 | * reopened.
33 | */
34 | @Value.Immutable
35 | @GithubStyle
36 | @JsonSerialize(as = ImmutableIssuesEvent.class)
37 | @JsonDeserialize(as = ImmutableIssuesEvent.class)
38 | public interface IssuesEvent extends BaseEvent {
39 |
40 | /**
41 | * The action that was performed. Can be one of "assigned", "unassigned", "labeled", "unlabeled",
42 | * "opened", "edited", "closed", or "reopened".
43 | */
44 | @Nullable
45 | String action();
46 |
47 | /** Issue */
48 | @Nullable
49 | Issue issue();
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/com/spotify/github/v3/activity/events/PullRequestReviewEvent.java:
--------------------------------------------------------------------------------
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.activity.events;
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.prs.PullRequestItem;
27 | import com.spotify.github.v3.prs.Review;
28 | import javax.annotation.Nullable;
29 | import org.immutables.value.Value;
30 |
31 | /** Triggered when a pull request review happens. */
32 | @Value.Immutable
33 | @GithubStyle
34 | @JsonSerialize(as = ImmutablePullRequestReviewEvent.class)
35 | @JsonDeserialize(as = ImmutablePullRequestReviewEvent.class)
36 | public interface PullRequestReviewEvent extends BaseEvent {
37 |
38 | /** State of the action. */
39 | @Nullable
40 | String action();
41 |
42 | /** Review. */
43 | @Nullable
44 | Review review();
45 |
46 | /** Pull Request. */
47 | @Nullable
48 | PullRequestItem pullRequest();
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/com/spotify/github/v3/activity/events/ReviewActionState.java:
--------------------------------------------------------------------------------
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.activity.events;
22 |
23 | /** Helpful constants for common Review Action states. */
24 | public class ReviewActionState {
25 |
26 | public static final String SUBMITTED = "submitted";
27 | public static final String EDITED = "edited";
28 | public static final String DISMISSED = "dismissed";
29 |
30 | private ReviewActionState() {}
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/com/spotify/github/v3/activity/events/ReviewLinks.java:
--------------------------------------------------------------------------------
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.activity.events;
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 java.net.URI;
27 | import javax.annotation.Nullable;
28 | import org.immutables.value.Value;
29 |
30 | /** Reference links for the Review entity */
31 | @Value.Immutable
32 | @GithubStyle
33 | @JsonSerialize(as = ImmutableReviewLinks.class)
34 | @JsonDeserialize(as = ImmutableReviewLinks.class)
35 | public interface ReviewLinks {
36 |
37 | /** Html. */
38 | @Nullable
39 | Href See About
34 | * GitHub Issue Comment reactions
35 | */
36 | @Value.Immutable
37 | @GithubStyle
38 | @JsonSerialize(as = ImmutableCommentReaction.class)
39 | @JsonDeserialize(as = ImmutableCommentReaction.class)
40 | public interface CommentReaction extends UpdateTracking {
41 |
42 | /** Reaction ID. */
43 | long id();
44 |
45 | /** Reaction user. */
46 | User user();
47 |
48 | /** Reaction content. */
49 | CommentReactionContent content();
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/com/spotify/github/v3/exceptions/DeserializationException.java:
--------------------------------------------------------------------------------
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.exceptions;
22 |
23 | /** Marks deserialization issues */
24 | public class DeserializationException extends GithubException {
25 |
26 | /**
27 | * Constructor for setting data and message
28 | *
29 | * @param data usually json data
30 | * @param msg error message
31 | */
32 | public DeserializationException(final String data, final String msg) {
33 | super("Failed deserializing: " + data + ":\n" + msg);
34 | }
35 |
36 | /**
37 | * Constructor for setting data
38 | *
39 | * @param data usually json date
40 | */
41 | public DeserializationException(final String data) {
42 | super("Failed deserializing: " + data);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/com/spotify/github/v3/exceptions/GithubException.java:
--------------------------------------------------------------------------------
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.exceptions;
22 |
23 | /** Common github exception */
24 | public class GithubException extends RuntimeException {
25 | private static final long serialVersionUID = 1L;
26 |
27 |
28 | /**
29 | * C'tor for setting a message
30 | *
31 | * @param message exception message
32 | */
33 | public GithubException(final String message) {
34 | super(message);
35 | }
36 |
37 | /**
38 | * C'tor for setting a message
39 | *
40 | * @param message exception message
41 | */
42 | public GithubException(final String message, final Throwable cause) {
43 | super(message, cause);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/com/spotify/github/v3/exceptions/ReadOnlyRepositoryException.java:
--------------------------------------------------------------------------------
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.exceptions;
22 |
23 | import java.util.List;
24 | import java.util.Map;
25 |
26 | /** The Read only repository exception. */
27 | public class ReadOnlyRepositoryException extends RequestNotOkException {
28 | private static final long serialVersionUID = 1L;
29 |
30 | /**
31 | * Instantiates a new Read only repository exception.
32 | *
33 | * @param method HTTP method
34 | * @param path the path
35 | * @param statusCode the status code
36 | * @param msg the msg
37 | */
38 | public ReadOnlyRepositoryException(
39 | final String method, final String path, final int statusCode, final String msg, final Map