Add extensions-api for accounts
It's an initial skeleton only at the moment. Methods for getting an account and starChange / unstarChange are available which will also be implemented in the upcoming REST client. Change-Id: I1a8d0cbe9106a1bccdad29cbb1c9a313a844909a
This commit is contained in:
@@ -14,11 +14,13 @@
|
|||||||
|
|
||||||
package com.google.gerrit.extensions.api;
|
package com.google.gerrit.extensions.api;
|
||||||
|
|
||||||
|
import com.google.gerrit.extensions.api.accounts.Accounts;
|
||||||
import com.google.gerrit.extensions.api.changes.Changes;
|
import com.google.gerrit.extensions.api.changes.Changes;
|
||||||
import com.google.gerrit.extensions.api.projects.Projects;
|
import com.google.gerrit.extensions.api.projects.Projects;
|
||||||
import com.google.gerrit.extensions.restapi.NotImplementedException;
|
import com.google.gerrit.extensions.restapi.NotImplementedException;
|
||||||
|
|
||||||
public interface GerritApi {
|
public interface GerritApi {
|
||||||
|
public Accounts accounts();
|
||||||
public Changes changes();
|
public Changes changes();
|
||||||
public Projects projects();
|
public Projects projects();
|
||||||
|
|
||||||
@@ -27,6 +29,11 @@ public interface GerritApi {
|
|||||||
* when adding new methods to the interface.
|
* when adding new methods to the interface.
|
||||||
**/
|
**/
|
||||||
public class NotImplemented implements GerritApi {
|
public class NotImplemented implements GerritApi {
|
||||||
|
@Override
|
||||||
|
public Accounts accounts() {
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Changes changes() {
|
public Changes changes() {
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
// Copyright (C) 2014 The Android Open Source Project
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
package com.google.gerrit.extensions.api.accounts;
|
||||||
|
|
||||||
|
import com.google.gerrit.extensions.common.AccountInfo;
|
||||||
|
import com.google.gerrit.extensions.restapi.NotImplementedException;
|
||||||
|
import com.google.gerrit.extensions.restapi.RestApiException;
|
||||||
|
|
||||||
|
public interface AccountApi {
|
||||||
|
AccountInfo get() throws RestApiException;
|
||||||
|
|
||||||
|
void starChange(String id) throws RestApiException;
|
||||||
|
void unstarChange(String id) throws RestApiException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A default implementation which allows source compatibility
|
||||||
|
* when adding new methods to the interface.
|
||||||
|
**/
|
||||||
|
public class NotImplemented implements AccountApi {
|
||||||
|
@Override
|
||||||
|
public AccountInfo get() throws RestApiException {
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void starChange(String id) throws RestApiException {
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void unstarChange(String id) throws RestApiException {
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
// Copyright (C) 2014 The Android Open Source Project
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
package com.google.gerrit.extensions.api.accounts;
|
||||||
|
|
||||||
|
import com.google.gerrit.extensions.restapi.NotImplementedException;
|
||||||
|
import com.google.gerrit.extensions.restapi.RestApiException;
|
||||||
|
|
||||||
|
public interface Accounts {
|
||||||
|
AccountApi id(String id) throws RestApiException;
|
||||||
|
AccountApi self() throws RestApiException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A default implementation which allows source compatibility
|
||||||
|
* when adding new methods to the interface.
|
||||||
|
**/
|
||||||
|
public class NotImplemented implements Accounts {
|
||||||
|
@Override
|
||||||
|
public AccountApi id(String id) throws RestApiException {
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AccountApi self() throws RestApiException {
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user