Class CreateEmail
- java.lang.Object
-
- com.google.gerrit.server.restapi.account.CreateEmail
-
- All Implemented Interfaces:
RestCollectionCreateView<AccountResource,AccountResource.Email,EmailInput>
,RestCollectionView<AccountResource,AccountResource.Email,EmailInput>
,RestView<AccountResource.Email>
public class CreateEmail extends Object implements RestCollectionCreateView<AccountResource,AccountResource.Email,EmailInput>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Response<EmailInfo>
apply(AccountResource rsrc, IdString id, EmailInput input)
Process the view operation by creating the resource.EmailInfo
apply(IdentifiedUser user, IdString id, EmailInput input)
To be used from plugins that want to create emails without permission checks.
-
-
-
Method Detail
-
apply
public Response<EmailInfo> apply(AccountResource rsrc, IdString id, EmailInput input) throws RestApiException, com.google.gerrit.exceptions.EmailException, MethodNotAllowedException, IOException, org.eclipse.jgit.errors.ConfigInvalidException, PermissionBackendException
Description copied from interface:RestCollectionCreateView
Process the view operation by creating the resource.The returned response defines the status code that is returned to the client. For RestCollectionCreateViews this is usually
201 Created
because a resource is created, but other 2XX or 3XX status codes are also possible (e.g.Response.Redirect
can be returned for302 Found
).The value of the returned response is automatically converted to JSON unless it is a
BinaryResult
.Throwing a subclass of
RestApiException
results in a 4XX response to the client. For any other exception the client will get a500 Internal Server Error
response.- Specified by:
apply
in interfaceRestCollectionCreateView<AccountResource,AccountResource.Email,EmailInput>
- Parameters:
rsrc
- parent resource of the resource that should be createdid
- the ID of the child resource that should be createdinput
- input after parsing from request.- Returns:
- response to return to the client
- Throws:
RestApiException
- if the resource creation is rejectedcom.google.gerrit.exceptions.EmailException
MethodNotAllowedException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
PermissionBackendException
-
apply
public EmailInfo apply(IdentifiedUser user, IdString id, EmailInput input) throws RestApiException, com.google.gerrit.exceptions.EmailException, MethodNotAllowedException, IOException, org.eclipse.jgit.errors.ConfigInvalidException, PermissionBackendException
To be used from plugins that want to create emails without permission checks.- Throws:
RestApiException
com.google.gerrit.exceptions.EmailException
MethodNotAllowedException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
PermissionBackendException
-
-