Skip to content

Commit

Permalink
Add No content status code (#21655)
Browse files Browse the repository at this point in the history
* Add No content status code

* Format
  • Loading branch information
benmoriceau authored Jan 23, 2023
1 parent e844d73 commit b7d5be9
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
import io.airbyte.server.handlers.SchedulerHandler;
import io.micronaut.context.annotation.Context;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Body;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand Down Expand Up @@ -89,6 +91,7 @@ public ConnectionRead getConnection(@Body final ConnectionIdRequestBody connecti

@Override
@Post(uri = "/delete")
@Status(HttpStatus.NO_CONTENT)
@Secured({EDITOR})
public void deleteConnection(@Body final ConnectionIdRequestBody connectionIdRequestBody) {
ApiHelper.execute(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import io.airbyte.server.handlers.DestinationHandler;
import io.airbyte.server.handlers.SchedulerHandler;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Body;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand Down Expand Up @@ -70,6 +72,7 @@ public DestinationRead createDestination(@Body final DestinationCreate destinati
@Post(uri = "/delete")
@Secured({EDITOR})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteDestination(@Body final DestinationIdRequestBody destinationIdRequestBody) {
ApiHelper.execute(() -> {
destinationHandler.deleteDestination(destinationIdRequestBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
import io.airbyte.server.handlers.DestinationDefinitionsHandler;
import io.micronaut.context.annotation.Context;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand All @@ -50,6 +52,7 @@ public DestinationDefinitionRead createCustomDestinationDefinition(final CustomD
@Post(uri = "/delete")
@Secured({ADMIN})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteDestinationDefinition(final DestinationDefinitionIdRequestBody destinationDefinitionIdRequestBody) {
ApiHelper.execute(() -> {
destinationDefinitionsHandler.deleteDestinationDefinition(destinationDefinitionIdRequestBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import io.airbyte.api.model.generated.OperatorConfiguration;
import io.airbyte.server.handlers.OperationsHandler;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Body;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand Down Expand Up @@ -54,6 +56,7 @@ public OperationRead createOperation(@Body final OperationCreate operationCreate
@Post("/delete")
@Secured({EDITOR})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteOperation(@Body final OperationIdRequestBody operationIdRequestBody) {
ApiHelper.execute(() -> {
operationsHandler.deleteOperation(operationIdRequestBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
import io.airbyte.server.handlers.SchedulerHandler;
import io.airbyte.server.handlers.SourceHandler;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand Down Expand Up @@ -72,6 +74,7 @@ public SourceRead createSource(final SourceCreate sourceCreate) {
@Post("/delete")
@Secured({EDITOR})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteSource(final SourceIdRequestBody sourceIdRequestBody) {
ApiHelper.execute(() -> {
sourceHandler.deleteSource(sourceIdRequestBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
import io.airbyte.server.handlers.SourceDefinitionsHandler;
import io.micronaut.context.annotation.Context;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand All @@ -50,6 +52,7 @@ public SourceDefinitionRead createCustomSourceDefinition(final CustomSourceDefin
@Post("/delete")
@Secured({ADMIN})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteSourceDefinition(final SourceDefinitionIdRequestBody sourceDefinitionIdRequestBody) {
ApiHelper.execute(() -> {
sourceDefinitionsHandler.deleteSourceDefinition(sourceDefinitionIdRequestBody);
Expand Down Expand Up @@ -109,6 +112,7 @@ public SourceDefinitionReadList listSourceDefinitionsForWorkspace(final Workspac
@Post("/revoke_definition")
@Secured({ADMIN})
@Override
@Status(HttpStatus.NO_CONTENT)
public void revokeSourceDefinitionFromWorkspace(final SourceDefinitionIdWithWorkspaceId sourceDefinitionIdWithWorkspaceId) {
ApiHelper.execute(() -> {
sourceDefinitionsHandler.revokeSourceDefinitionFromWorkspace(sourceDefinitionIdWithWorkspaceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import io.airbyte.api.model.generated.WorkspaceUpdateName;
import io.airbyte.server.handlers.WorkspacesHandler;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Body;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand All @@ -48,6 +50,7 @@ public WorkspaceRead createWorkspace(@Body final WorkspaceCreate workspaceCreate
@Post("/delete")
@Secured({OWNER})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteWorkspace(@Body final WorkspaceIdRequestBody workspaceIdRequestBody) {
ApiHelper.execute(() -> {
workspacesHandler.deleteWorkspace(workspaceIdRequestBody);
Expand Down

0 comments on commit b7d5be9

Please sign in to comment.