use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.
the class AccountApi method enterAgreement.
/** Enter a contributor agreement */
public static void enterAgreement(String account, String name, AsyncCallback<NativeString> cb) {
AgreementInput in = AgreementInput.create();
in.name(name);
new RestApi("/accounts/").id(account).view("agreements").put(in, cb);
}
use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.
the class ProjectGlue method onAction.
public static void onAction(Project.NameKey project, BranchInfo branch, ActionInfo action, ActionButton button) {
RestApi api = ProjectApi.project(project).view("branches").id(branch.ref()).view(action.id());
JavaScriptObject f = branchAction(action.id());
if (f != null) {
ActionContext c = ActionContext.create(api);
c.set(action);
c.set(project);
c.set(branch);
c.button(button);
ApiGlue.invoke(f, c);
} else {
DefaultActions.invoke(project, action, api);
}
}
use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.
the class ProjectGlue method onAction.
public static void onAction(Project.NameKey project, ActionInfo action, ActionButton button) {
RestApi api = ProjectApi.project(project).view(action.id());
JavaScriptObject f = projectAction(action.id());
if (f != null) {
ActionContext c = ActionContext.create(api);
c.set(action);
c.set(project);
c.button(button);
ApiGlue.invoke(f, c);
} else {
DefaultActions.invoke(project, action, api);
}
}
use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.
the class RevisionGlue method onAction.
public static void onAction(ChangeInfo change, RevisionInfo revision, ActionInfo action, ActionButton button) {
RestApi api = ChangeApi.revision(change.legacyId().get(), revision.name()).view(action.id());
JavaScriptObject f = get(action.id());
if (f != null) {
ActionContext c = ActionContext.create(api);
c.set(action);
c.set(change);
c.set(revision);
c.button(button);
ApiGlue.invoke(f, c);
} else {
DefaultActions.invoke(change, action, api);
}
}
use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.
the class ChangeScreen method loadRevisionInfo.
void loadRevisionInfo() {
RestApi call = ChangeApi.actions(changeId.get(), revision);
call.background();
call.get(new GerritCallback<NativeMap<ActionInfo>>() {
@Override
public void onSuccess(NativeMap<ActionInfo> actionMap) {
actionMap.copyKeysIntoChildren("id");
renderRevisionInfo(changeInfo, actionMap);
}
});
}
Aggregations