@@ -25,14 +25,13 @@ public class GHApp extends GHObject {
2525 private String description ;
2626 @ JsonProperty ("external_url" )
2727 private String externalUrl ;
28- private Map <String ,String > permissions ;
28+ private Map <String , String > permissions ;
2929 private List <GHEvent > events ;
3030 @ JsonProperty ("installations_count" )
3131 private long installationsCount ;
3232 @ JsonProperty ("html_url" )
3333 private String htmlUrl ;
3434
35-
3635 public GHUser getOwner () {
3736 return owner ;
3837 }
@@ -93,80 +92,105 @@ public void setPermissions(Map<String, String> permissions) {
9392 this .permissions = permissions ;
9493 }
9594
96- /*package*/ GHApp wrapUp (GitHub root ) {
95+ GHApp wrapUp (GitHub root ) {
9796 this .root = root ;
9897 return this ;
9998 }
10099
101100 /**
102101 * Obtains all the installations associated with this app.
103- *
102+ * <p>
104103 * You must use a JWT to access this endpoint.
105104 *
106- * @see <a href="https://developer.github.com/v3/apps/#list-installations">List installations</a>
107105 * @return a list of App installations
106+ * @see <a href="https://developer.github.com/v3/apps/#list-installations">List installations</a>
108107 */
109- @ Preview @ Deprecated
108+ @ Preview
109+ @ Deprecated
110110 public PagedIterable <GHAppInstallation > listInstallations () {
111- return root .retrieve ().withPreview (MACHINE_MAN )
112- .asPagedIterable (
113- "/app/installations" ,
114- GHAppInstallation [].class ,
115- item -> item .wrapUp (root ) );
111+ return root .retrieve ().withPreview (MACHINE_MAN ).asPagedIterable ("/app/installations" , GHAppInstallation [].class ,
112+ item -> item .wrapUp (root ));
116113 }
117114
118115 /**
119- * Obtain an installation associated with this app
120- * @param id - Installation Id
121- *
116+ * Obtain an installation associated with this app.
117+ * <p>
122118 * You must use a JWT to access this endpoint.
123119 *
120+ * @param id
121+ * Installation Id
122+ * @return a GHAppInstallation
123+ * @throws IOException
124+ * on error
124125 * @see <a href="https://developer.github.com/v3/apps/#get-an-installation">Get an installation</a>
125126 */
126- @ Preview @ Deprecated
127+ @ Preview
128+ @ Deprecated
127129 public GHAppInstallation getInstallationById (long id ) throws IOException {
128- return root .retrieve ().withPreview (MACHINE_MAN ).to (String .format ("/app/installations/%d" , id ), GHAppInstallation .class ).wrapUp (root );
130+ return root .retrieve ().withPreview (MACHINE_MAN )
131+ .to (String .format ("/app/installations/%d" , id ), GHAppInstallation .class ).wrapUp (root );
129132 }
130133
131134 /**
132- * Obtain an organization installation associated with this app
133- * @param name - Organization name
134- *
135+ * Obtain an organization installation associated with this app.
136+ * <p>
135137 * You must use a JWT to access this endpoint.
136138 *
137- * @see <a href="https://developer.github.com/v3/apps/#get-an-organization-installation">Get an organization installation</a>
139+ * @param name
140+ * Organization name
141+ * @return a GHAppInstallation
142+ * @throws IOException
143+ * on error
144+ * @see <a href="https://developer.github.com/v3/apps/#get-an-organization-installation">Get an organization
145+ * installation</a>
138146 */
139- @ Preview @ Deprecated
147+ @ Preview
148+ @ Deprecated
140149 public GHAppInstallation getInstallationByOrganization (String name ) throws IOException {
141- return root .retrieve ().withPreview (MACHINE_MAN ).to (String .format ("/orgs/%s/installation" , name ), GHAppInstallation .class ).wrapUp (root );
150+ return root .retrieve ().withPreview (MACHINE_MAN )
151+ .to (String .format ("/orgs/%s/installation" , name ), GHAppInstallation .class ).wrapUp (root );
142152 }
143153
144154 /**
145- * Obtain an repository installation associated with this app
146- * @param ownerName - Organization or user name
147- * @param repositoryName - Repository name
148- *
155+ * Obtain an repository installation associated with this app.
156+ * <p>
149157 * You must use a JWT to access this endpoint.
150158 *
151- * @see <a href="https://developer.github.com/v3/apps/#get-a-repository-installation">Get a repository installation</a>
159+ * @param ownerName
160+ * Organization or user name
161+ * @param repositoryName
162+ * Repository name
163+ * @return a GHAppInstallation
164+ * @throws IOException
165+ * on error
166+ * @see <a href="https://developer.github.com/v3/apps/#get-a-repository-installation">Get a repository
167+ * installation</a>
152168 */
153- @ Preview @ Deprecated
169+ @ Preview
170+ @ Deprecated
154171 public GHAppInstallation getInstallationByRepository (String ownerName , String repositoryName ) throws IOException {
155- return root .retrieve ().withPreview (MACHINE_MAN ).to (String .format ("/repos/%s/%s/installation" , ownerName , repositoryName ), GHAppInstallation .class ).wrapUp (root );
172+ return root .retrieve ().withPreview (MACHINE_MAN )
173+ .to (String .format ("/repos/%s/%s/installation" , ownerName , repositoryName ), GHAppInstallation .class )
174+ .wrapUp (root );
156175 }
157176
158177 /**
159- * Obtain a user installation associated with this app
160- * @param name - user name
161- *
178+ * Obtain a user installation associated with this app.
179+ * <p>
162180 * You must use a JWT to access this endpoint.
163181 *
182+ * @param name
183+ * user name
184+ * @return a GHAppInstallation
185+ * @throws IOException
186+ * on error
164187 * @see <a href="https://developer.github.com/v3/apps/#get-a-user-installation">Get a user installation</a>
165188 */
166- @ Preview @ Deprecated
189+ @ Preview
190+ @ Deprecated
167191 public GHAppInstallation getInstallationByUser (String name ) throws IOException {
168- return root .retrieve ().withPreview (MACHINE_MAN ).to (String .format ("/users/%s/installation" , name ), GHAppInstallation .class ).wrapUp (root );
192+ return root .retrieve ().withPreview (MACHINE_MAN )
193+ .to (String .format ("/users/%s/installation" , name ), GHAppInstallation .class ).wrapUp (root );
169194 }
170195
171196}
172-
0 commit comments