Accounts API: Add methods to create an account

Change-Id: I798f98384fc513987c00aa1a6102c9967813b542
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2016-07-06 16:57:04 +02:00
parent 0d4ef2ddba
commit a62673ca77
6 changed files with 90 additions and 19 deletions

View File

@@ -0,0 +1,29 @@
// Copyright (C) 2016 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.DefaultInput;
import java.util.List;
public class AccountInput {
@DefaultInput
public String username;
public String name;
public String email;
public String sshKey;
public String httpPassword;
public List<String> groups;
}

View File

@@ -52,6 +52,12 @@ public interface Accounts {
*/
AccountApi self() throws RestApiException;
/** Create a new account with the given username and default options. */
AccountApi create(String username) throws RestApiException;
/** Create a new account. */
AccountApi create(AccountInput input) throws RestApiException;
/**
* Suggest users for a given query.
* <p>
@@ -232,6 +238,16 @@ public interface Accounts {
throw new NotImplementedException();
}
@Override
public AccountApi create(String username) throws RestApiException {
throw new NotImplementedException();
}
@Override
public AccountApi create(AccountInput input) throws RestApiException {
throw new NotImplementedException();
}
@Override
public SuggestAccountsRequest suggestAccounts() throws RestApiException {
throw new NotImplementedException();