![JAR search and dependency download from the Maven repository](/logo.png)
org.jboss.pnc.rest.api.endpoints.UserEndpoint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest-api Show documentation
Show all versions of rest-api Show documentation
Module with REST API bidings.
/**
* JBoss, Home of Professional Open Source.
* Copyright 2014-2022 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* 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 org.jboss.pnc.rest.api.endpoints;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.jboss.pnc.dto.Build;
import org.jboss.pnc.dto.User;
import org.jboss.pnc.dto.response.ErrorResponse;
import org.jboss.pnc.dto.response.Page;
import org.jboss.pnc.processor.annotation.Client;
import org.jboss.pnc.rest.api.parameters.BuildsFilterParameters;
import org.jboss.pnc.rest.api.parameters.PageParameters;
import org.jboss.pnc.rest.api.swagger.response.SwaggerPages.BuildPage;
import javax.validation.Valid;
import javax.ws.rs.BeanParam;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import static org.jboss.pnc.rest.configuration.SwaggerConstants.INVALID_CODE;
import static org.jboss.pnc.rest.configuration.SwaggerConstants.INVALID_DESCRIPTION;
import static org.jboss.pnc.rest.configuration.SwaggerConstants.SERVER_ERROR_CODE;
import static org.jboss.pnc.rest.configuration.SwaggerConstants.SERVER_ERROR_DESCRIPTION;
import static org.jboss.pnc.rest.configuration.SwaggerConstants.SUCCESS_CODE;
import static org.jboss.pnc.rest.configuration.SwaggerConstants.SUCCESS_DESCRIPTION;
@Tag(name = "Users")
@Path("/users")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Client
public interface UserEndpoint {
static final String U_ID = "ID of the user";
static final String GET_CURRENT_USER_DESC = "Gets logged user.";
/**
* {@value GET_CURRENT_USER_DESC}
*
* @return
*/
@Operation(
summary = GET_CURRENT_USER_DESC,
responses = {
@ApiResponse(
responseCode = SUCCESS_CODE,
description = SUCCESS_DESCRIPTION,
content = @Content(schema = @Schema(implementation = User.class))),
@ApiResponse(
responseCode = SERVER_ERROR_CODE,
description = SERVER_ERROR_DESCRIPTION,
content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@GET
@Path("/current")
User getCurrentUser();
static final String GET_BUILDS = "Gets all builds triggered by specific user.";
/**
* {@value GET_BUILDS}
*
* @param id {@value U_ID}
* @param pageParameters
* @param buildsFilter
* @return
*/
@Operation(
summary = GET_BUILDS,
responses = {
@ApiResponse(
responseCode = SUCCESS_CODE,
description = SUCCESS_DESCRIPTION,
content = @Content(schema = @Schema(implementation = BuildPage.class))),
@ApiResponse(
responseCode = INVALID_CODE,
description = INVALID_DESCRIPTION,
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = SERVER_ERROR_CODE,
description = SERVER_ERROR_DESCRIPTION,
content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@GET
@Path("/{id}/builds")
Page getBuilds(
@Parameter(description = U_ID) @PathParam("id") String id,
@Valid @BeanParam PageParameters pageParameters,
@BeanParam BuildsFilterParameters buildsFilter);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy