|
| 1 | +/* |
| 2 | + * Copyright (c) 2025 Metaform Systems, Inc. |
| 3 | + * |
| 4 | + * This program and the accompanying materials are made available under the |
| 5 | + * terms of the Apache License, Version 2.0 which is available at |
| 6 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 7 | + * |
| 8 | + * SPDX-License-Identifier: Apache-2.0 |
| 9 | + * |
| 10 | + * Contributors: |
| 11 | + * Metaform Systems, Inc. - initial API and implementation |
| 12 | + * |
| 13 | + */ |
| 14 | + |
| 15 | +package org.eclipse.edc.virtualized.connector.controlplane.api.management.participantcontext.config.v4; |
| 16 | + |
| 17 | +import io.swagger.v3.oas.annotations.OpenAPIDefinition; |
| 18 | +import io.swagger.v3.oas.annotations.Operation; |
| 19 | +import io.swagger.v3.oas.annotations.info.Info; |
| 20 | +import io.swagger.v3.oas.annotations.media.ArraySchema; |
| 21 | +import io.swagger.v3.oas.annotations.media.Content; |
| 22 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 23 | +import io.swagger.v3.oas.annotations.parameters.RequestBody; |
| 24 | +import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| 25 | +import io.swagger.v3.oas.annotations.tags.Tag; |
| 26 | +import jakarta.json.JsonObject; |
| 27 | +import jakarta.ws.rs.core.SecurityContext; |
| 28 | +import org.eclipse.edc.api.management.schema.ManagementApiJsonSchema; |
| 29 | + |
| 30 | +@OpenAPIDefinition(info = @Info(title = "ParticipantContext config Management API", version = "v4alpha")) |
| 31 | +@Tag(name = "Participant Context config v4alpha") |
| 32 | +public interface ParticipantContextConfigApiV4 { |
| 33 | + |
| 34 | + @Operation(description = "Set ParticipantContext config.", |
| 35 | + requestBody = @RequestBody(content = @Content(schema = @Schema(ref = ManagementApiJsonSchema.V4.PARTICIPANT_CONTEXT_CONFIG), mediaType = "application/json")), |
| 36 | + responses = { |
| 37 | + @ApiResponse(responseCode = "204", description = "The Config was set successfully"), |
| 38 | + @ApiResponse(responseCode = "400", description = "Request body was malformed, or the request could not be processed", |
| 39 | + content = @Content(array = @ArraySchema(schema = @Schema(ref = ManagementApiJsonSchema.V4.API_ERROR)), mediaType = "application/json")), |
| 40 | + @ApiResponse(responseCode = "401", description = "The request could not be completed, because either the authentication was missing or was not valid.", |
| 41 | + content = @Content(array = @ArraySchema(schema = @Schema(ref = ManagementApiJsonSchema.V4.API_ERROR)), mediaType = "application/json")), |
| 42 | + @ApiResponse(responseCode = "409", description = "Can't create the ParticipantContext, because a object with the same ID already exists", |
| 43 | + content = @Content(array = @ArraySchema(schema = @Schema(ref = ManagementApiJsonSchema.V4.API_ERROR)), mediaType = "application/json")) |
| 44 | + } |
| 45 | + ) |
| 46 | + void setConfigV4(String participantContextId, JsonObject participantContext); |
| 47 | + |
| 48 | + @Operation(description = "Gets ParticipantContexts config by ID.", |
| 49 | + responses = { |
| 50 | + @ApiResponse(responseCode = "200", description = "The config of the ParticipantContext", |
| 51 | + content = @Content(schema = @Schema(ref = ManagementApiJsonSchema.V4.PARTICIPANT_CONTEXT_CONFIG))), |
| 52 | + @ApiResponse(responseCode = "400", description = "Request body was malformed, or the request could not be processed", |
| 53 | + content = @Content(array = @ArraySchema(schema = @Schema(ref = ManagementApiJsonSchema.V4.API_ERROR)), mediaType = "application/json")), |
| 54 | + @ApiResponse(responseCode = "401", description = "The request could not be completed, because either the authentication was missing or was not valid.", |
| 55 | + content = @Content(array = @ArraySchema(schema = @Schema(ref = ManagementApiJsonSchema.V4.API_ERROR)), mediaType = "application/json")), |
| 56 | + @ApiResponse(responseCode = "404", description = "A ParticipantContext with the given ID does not exist.", |
| 57 | + content = @Content(array = @ArraySchema(schema = @Schema(ref = ManagementApiJsonSchema.V4.API_ERROR)), mediaType = "application/json")) |
| 58 | + } |
| 59 | + ) |
| 60 | + JsonObject getConfigV4(String participantContextId, SecurityContext securityContext); |
| 61 | + |
| 62 | +} |
0 commit comments