forked from wso2/carbon-apimgt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Prasanna Dangalla
committed
Feb 10, 2024
1 parent
4825e50
commit b222704
Showing
13 changed files
with
24,008 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
...imgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/ApisApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package org.wso2.carbon.apimgt.rest.api.admin.v1; | ||
|
||
import org.wso2.carbon.apimgt.rest.api.admin.v1.dto.ErrorDTO; | ||
import org.wso2.carbon.apimgt.rest.api.admin.v1.dto.SearchResultListDTO; | ||
import org.wso2.carbon.apimgt.rest.api.admin.v1.ApisApiService; | ||
import org.wso2.carbon.apimgt.rest.api.admin.v1.impl.ApisApiServiceImpl; | ||
import org.wso2.carbon.apimgt.api.APIManagementException; | ||
|
||
import javax.ws.rs.*; | ||
import javax.ws.rs.core.Context; | ||
import javax.ws.rs.core.Response; | ||
import javax.ws.rs.core.SecurityContext; | ||
import javax.inject.Inject; | ||
|
||
import io.swagger.annotations.*; | ||
import java.io.InputStream; | ||
|
||
import org.apache.cxf.jaxrs.ext.MessageContext; | ||
import org.apache.cxf.jaxrs.ext.multipart.Attachment; | ||
import org.apache.cxf.jaxrs.ext.multipart.Multipart; | ||
|
||
import java.util.Map; | ||
import java.util.List; | ||
import javax.validation.constraints.*; | ||
@Path("/apis") | ||
|
||
@Api(description = "the apis API") | ||
|
||
|
||
|
||
|
||
public class ApisApi { | ||
|
||
@Context MessageContext securityContext; | ||
|
||
ApisApiService delegate = new ApisApiServiceImpl(); | ||
|
||
|
||
@GET | ||
|
||
|
||
@Produces({ "application/json" }) | ||
@ApiOperation(value = "Retrieve/Search APIs ", notes = "This operation provides you a list of available APIs qualifying under a given search condition. Each retrieved API is represented with a minimal amount of attributes. If you want to get complete details of an API, you need to use **Get details of an API** operation. ", response = SearchResultListDTO.class, authorizations = { | ||
@Authorization(value = "OAuth2Security", scopes = { | ||
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"), | ||
@AuthorizationScope(scope = "apim:api_provider_change", description = "Retrieve and manage applications") | ||
}) | ||
}, tags={ "APIs", }) | ||
@ApiResponses(value = { | ||
@ApiResponse(code = 200, message = "OK. List of qualifying APIs is returned. ", response = SearchResultListDTO.class), | ||
@ApiResponse(code = 304, message = "Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). ", response = Void.class), | ||
@ApiResponse(code = 406, message = "Not Acceptable. The requested media type is not supported.", response = ErrorDTO.class) }) | ||
public Response getAllAPIs( @ApiParam(value = "Maximum size of resource array to return. ", defaultValue="25") @DefaultValue("25") @QueryParam("limit") Integer limit, @ApiParam(value = "Starting point within the complete list of items qualified. ", defaultValue="0") @DefaultValue("0") @QueryParam("offset") Integer offset, @ApiParam(value = "**Search and get all apis in admin portal**. You can search by proving a keyword. ") @QueryParam("query") String query, @ApiParam(value = "Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource. " )@HeaderParam("If-None-Match") String ifNoneMatch) throws APIManagementException{ | ||
return delegate.getAllAPIs(limit, offset, query, ifNoneMatch, securityContext); | ||
} | ||
|
||
@POST | ||
@Path("/{apiId}/change-provider") | ||
|
||
@Produces({ "application/json" }) | ||
@ApiOperation(value = "Update the api provider", notes = "Update the api provider ", response = Void.class, authorizations = { | ||
@Authorization(value = "OAuth2Security", scopes = { | ||
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"), | ||
@AuthorizationScope(scope = "apim:api_provider_change", description = "Retrieve and manage applications") | ||
}) | ||
}, tags={ "Api Provider Change" }) | ||
@ApiResponses(value = { | ||
@ApiResponse(code = 200, message = "OK. Api Provider updated. ", response = Void.class), | ||
@ApiResponse(code = 400, message = "Bad Request. Invalid request or validation error.", response = ErrorDTO.class), | ||
@ApiResponse(code = 404, message = "Not Found. The specified resource does not exist.", response = ErrorDTO.class) }) | ||
public Response providerNamePost( @NotNull @ApiParam(value = "",required=true) @QueryParam("provider") String provider, @ApiParam(value = "**API ID** consisting of the **UUID** of the API. ",required=true) @PathParam("apiId") String apiId) throws APIManagementException{ | ||
return delegate.providerNamePost(provider, apiId, securityContext); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...st.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/ApisApiService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.wso2.carbon.apimgt.rest.api.admin.v1; | ||
|
||
import org.wso2.carbon.apimgt.rest.api.admin.v1.*; | ||
import org.wso2.carbon.apimgt.rest.api.admin.v1.dto.*; | ||
|
||
import org.apache.cxf.jaxrs.ext.MessageContext; | ||
import org.apache.cxf.jaxrs.ext.multipart.Attachment; | ||
import org.apache.cxf.jaxrs.ext.multipart.Multipart; | ||
|
||
import org.wso2.carbon.apimgt.api.APIManagementException; | ||
|
||
import org.wso2.carbon.apimgt.rest.api.admin.v1.dto.ErrorDTO; | ||
import org.wso2.carbon.apimgt.rest.api.admin.v1.dto.SearchResultListDTO; | ||
|
||
import java.util.List; | ||
|
||
import java.io.InputStream; | ||
|
||
import javax.ws.rs.core.Response; | ||
import javax.ws.rs.core.SecurityContext; | ||
|
||
|
||
public interface ApisApiService { | ||
public Response getAllAPIs(Integer limit, Integer offset, String query, String ifNoneMatch, MessageContext messageContext) throws APIManagementException; | ||
public Response providerNamePost(String provider, String apiId, MessageContext messageContext) throws APIManagementException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
141 changes: 141 additions & 0 deletions
141
....api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/ApiResultDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
package org.wso2.carbon.apimgt.rest.api.admin.v1.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import javax.validation.constraints.*; | ||
|
||
|
||
import io.swagger.annotations.*; | ||
import java.util.Objects; | ||
|
||
import javax.xml.bind.annotation.*; | ||
import org.wso2.carbon.apimgt.rest.api.common.annotations.Scope; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
|
||
import javax.validation.Valid; | ||
|
||
|
||
|
||
public class ApiResultDTO { | ||
|
||
private String provider = null; | ||
private String name = null; | ||
private String version = null; | ||
private String id = null; | ||
|
||
/** | ||
**/ | ||
public ApiResultDTO provider(String provider) { | ||
this.provider = provider; | ||
return this; | ||
} | ||
|
||
|
||
@ApiModelProperty(value = "") | ||
@JsonProperty("provider") | ||
public String getProvider() { | ||
return provider; | ||
} | ||
public void setProvider(String provider) { | ||
this.provider = provider; | ||
} | ||
|
||
/** | ||
**/ | ||
public ApiResultDTO name(String name) { | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
|
||
@ApiModelProperty(value = "") | ||
@JsonProperty("name") | ||
public String getName() { | ||
return name; | ||
} | ||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
/** | ||
**/ | ||
public ApiResultDTO version(String version) { | ||
this.version = version; | ||
return this; | ||
} | ||
|
||
|
||
@ApiModelProperty(value = "") | ||
@JsonProperty("version") | ||
public String getVersion() { | ||
return version; | ||
} | ||
public void setVersion(String version) { | ||
this.version = version; | ||
} | ||
|
||
/** | ||
**/ | ||
public ApiResultDTO id(String id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
|
||
@ApiModelProperty(value = "") | ||
@JsonProperty("id") | ||
public String getId() { | ||
return id; | ||
} | ||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
|
||
@Override | ||
public boolean equals(java.lang.Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
ApiResultDTO apiResult = (ApiResultDTO) o; | ||
return Objects.equals(provider, apiResult.provider) && | ||
Objects.equals(name, apiResult.name) && | ||
Objects.equals(version, apiResult.version) && | ||
Objects.equals(id, apiResult.id); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(provider, name, version, id); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("class ApiResultDTO {\n"); | ||
|
||
sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); | ||
sb.append(" name: ").append(toIndentedString(name)).append("\n"); | ||
sb.append(" version: ").append(toIndentedString(version)).append("\n"); | ||
sb.append(" id: ").append(toIndentedString(id)).append("\n"); | ||
sb.append("}"); | ||
return sb.toString(); | ||
} | ||
|
||
/** | ||
* Convert the given object to string with each line indented by 4 spaces | ||
* (except the first line). | ||
*/ | ||
private String toIndentedString(java.lang.Object o) { | ||
if (o == null) { | ||
return "null"; | ||
} | ||
return o.toString().replace("\n", "\n "); | ||
} | ||
} | ||
|
Oops, something went wrong.