mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fixed conflicts and merged
This commit is contained in:
commit
2b4a3cde61
@ -22,13 +22,13 @@
|
||||
<parent>
|
||||
<artifactId>apimgt-extensions</artifactId>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<version>2.0.8-SNAPSHOT</version>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>org.wso2.carbon.apimgt.annotations</artifactId>
|
||||
<version>2.0.8-SNAPSHOT</version>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<packaging>bundle</packaging>
|
||||
<name>WSO2 Carbon - API Management Annotations</name>
|
||||
<description>WSO2 Carbon - API Management Custom Annotation Module</description>
|
||||
|
||||
@ -21,12 +21,12 @@
|
||||
<parent>
|
||||
<artifactId>apimgt-extensions</artifactId>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<version>2.0.8-SNAPSHOT</version>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>2.0.8-SNAPSHOT</version>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<artifactId>org.wso2.carbon.apimgt.application.extension.api</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>WSO2 Carbon - API Application Management API</name>
|
||||
|
||||
@ -60,7 +60,6 @@ public class ApiApplicationRegistrationServiceImpl implements ApiApplicationRegi
|
||||
}
|
||||
String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm()
|
||||
.getRealmConfiguration().getAdminUserName();
|
||||
username = username + "@" + APIUtil.getTenantDomainOftheUser();
|
||||
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(username);
|
||||
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
|
||||
ApiApplicationKey apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
|
||||
@ -96,7 +95,7 @@ public class ApiApplicationRegistrationServiceImpl implements ApiApplicationRegi
|
||||
return Response.status(Response.Status.NOT_ACCEPTABLE).entity("APIs(Tags) are not allowed to this user."
|
||||
).build();
|
||||
}
|
||||
String username = APIUtil.getAuthenticatedUser() + "@" + APIUtil.getTenantDomainOftheUser();
|
||||
String username = APIUtil.getAuthenticatedUser();
|
||||
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
|
||||
String validityPeriod;
|
||||
if (registrationProfile.getValidityPeriod() == null) {
|
||||
@ -104,27 +103,11 @@ public class ApiApplicationRegistrationServiceImpl implements ApiApplicationRegi
|
||||
} else {
|
||||
validityPeriod = registrationProfile.getValidityPeriod();
|
||||
}
|
||||
if (registrationProfile.isMappingAnExistingOAuthApp()) {
|
||||
JSONObject jsonStringObject = new JSONObject();
|
||||
jsonStringObject.put(ApiApplicationConstants.JSONSTRING_USERNAME_TAG, username);
|
||||
jsonStringObject.put(ApiApplicationConstants.JSONSTRING_KEY_TYPE_TAG,
|
||||
ApiApplicationConstants.DEFAULT_TOKEN_TYPE);
|
||||
jsonStringObject.put(ApiApplicationConstants.OAUTH_CLIENT_ID, registrationProfile.getConsumerKey());
|
||||
jsonStringObject.put(ApiApplicationConstants.OAUTH_CLIENT_SECRET,
|
||||
registrationProfile.getConsumerSecret());
|
||||
jsonStringObject.put(ApiApplicationConstants.JSONSTRING_VALIDITY_PERIOD_TAG, validityPeriod);
|
||||
apiManagementProviderService.registerExistingOAuthApplicationToAPIApplication(
|
||||
jsonStringObject.toJSONString(), registrationProfile.getApplicationName(),
|
||||
registrationProfile.getConsumerKey(), username, registrationProfile.isAllowedToAllDomains(),
|
||||
ApiApplicationConstants.DEFAULT_TOKEN_TYPE, registrationProfile.getTags());
|
||||
return Response.status(Response.Status.ACCEPTED).entity("true").build();
|
||||
} else {
|
||||
ApiApplicationKey apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
|
||||
registrationProfile.getApplicationName(), registrationProfile.getTags(),
|
||||
ApiApplicationConstants.DEFAULT_TOKEN_TYPE, username,
|
||||
registrationProfile.isAllowedToAllDomains(), validityPeriod);
|
||||
return Response.status(Response.Status.CREATED).entity(apiApplicationKey.toString()).build();
|
||||
}
|
||||
} catch (APIManagerException e) {
|
||||
String msg = "Error occurred while registering an application '"
|
||||
+ registrationProfile.getApplicationName() + "'";
|
||||
|
||||
@ -37,10 +37,6 @@ public class RegistrationProfile {
|
||||
private String tags[];
|
||||
@XmlElement(required = true)
|
||||
private boolean isAllowedToAllDomains;
|
||||
@XmlElement(required = true)
|
||||
private boolean isMappingAnExistingOAuthApp;
|
||||
private String consumerKey;
|
||||
private String consumerSecret;
|
||||
@XmlElement(required = false)
|
||||
private String validityPeriod;
|
||||
|
||||
@ -68,30 +64,6 @@ public class RegistrationProfile {
|
||||
this.isAllowedToAllDomains = isAllowedToAllDomains;
|
||||
}
|
||||
|
||||
public boolean isMappingAnExistingOAuthApp() {
|
||||
return isMappingAnExistingOAuthApp;
|
||||
}
|
||||
|
||||
public void setIsMappingAnExistingOAuthApp(boolean isMappingAnExistingOAuthApp) {
|
||||
this.isMappingAnExistingOAuthApp = isMappingAnExistingOAuthApp;
|
||||
}
|
||||
|
||||
public String getConsumerKey() {
|
||||
return consumerKey;
|
||||
}
|
||||
|
||||
public void setConsumerKey(String consumerKey) {
|
||||
this.consumerKey = consumerKey;
|
||||
}
|
||||
|
||||
public String getConsumerSecret() {
|
||||
return consumerSecret;
|
||||
}
|
||||
|
||||
public void setConsumerSecret(String consumerSecret) {
|
||||
this.consumerSecret = consumerSecret;
|
||||
}
|
||||
|
||||
public String getValidityPeriod() {
|
||||
return validityPeriod;
|
||||
}
|
||||
|
||||
@ -22,12 +22,12 @@
|
||||
<parent>
|
||||
<artifactId>apimgt-extensions</artifactId>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<version>2.0.8-SNAPSHOT</version>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>2.0.8-SNAPSHOT</version>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<artifactId>org.wso2.carbon.apimgt.application.extension</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>WSO2 Carbon - API Application Management</name>
|
||||
@ -52,12 +52,8 @@
|
||||
<artifactId>org.wso2.carbon.logging</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.apimgt</groupId>
|
||||
<artifactId>org.wso2.carbon.apimgt.impl</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.apimgt</groupId>
|
||||
<artifactId>org.wso2.carbon.apimgt.api</artifactId>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple.wso2</groupId>
|
||||
@ -100,16 +96,14 @@
|
||||
org.osgi.service.component,
|
||||
org.apache.commons.logging.*,
|
||||
org.wso2.carbon.user.core.*,
|
||||
org.wso2.carbon.apimgt.api;version="${carbon.api.mgt.version.range}",
|
||||
org.wso2.carbon.apimgt.api.model;version="${carbon.api.mgt.version.range}",
|
||||
org.wso2.carbon.apimgt.impl;version="${carbon.api.mgt.version.range}",
|
||||
org.wso2.carbon.user.api,
|
||||
org.wso2.carbon.utils.multitenancy,
|
||||
org.json.simple,
|
||||
org.wso2.carbon.context,
|
||||
org.wso2.carbon.base,
|
||||
org.wso2.carbon.registry.core.*;resolution:=optional,
|
||||
org.wso2.carbon.registry.indexing.*; version="${carbon.registry.imp.pkg.version.range}"
|
||||
org.wso2.carbon.registry.indexing.*; version="${carbon.registry.imp.pkg.version.range}",
|
||||
org.wso2.carbon.apimgt.integration.client.*
|
||||
</Import-Package>
|
||||
<Export-Package>
|
||||
!org.wso2.carbon.apimgt.application.extension.internal,
|
||||
|
||||
@ -41,15 +41,7 @@ public interface APIManagementProviderService {
|
||||
*/
|
||||
ApiApplicationKey generateAndRetrieveApplicationKeys(String apiApplicationName, String tags[],
|
||||
String keyType, String username, boolean isAllowedAllDomains,
|
||||
String validityTime)
|
||||
throws APIManagerException;
|
||||
|
||||
/**
|
||||
* Register existing Oauth application as apim application.
|
||||
*/
|
||||
void registerExistingOAuthApplicationToAPIApplication(String jsonString, String applicationName, String clientId,
|
||||
String username, boolean isAllowedAllDomains, String keyType,
|
||||
String tags[]) throws APIManagerException;
|
||||
String validityTime) throws APIManagerException;
|
||||
|
||||
/**
|
||||
* Remove APIM Application.
|
||||
|
||||
@ -20,23 +20,18 @@ package org.wso2.carbon.apimgt.application.extension;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.wso2.carbon.apimgt.api.APIConsumer;
|
||||
import org.wso2.carbon.apimgt.api.APIManagementException;
|
||||
import org.wso2.carbon.apimgt.api.model.*;
|
||||
import org.wso2.carbon.apimgt.application.extension.constants.ApiApplicationConstants;
|
||||
import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey;
|
||||
import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException;
|
||||
import org.wso2.carbon.apimgt.application.extension.internal.APIApplicationManagerExtensionDataHolder;
|
||||
import org.wso2.carbon.apimgt.application.extension.util.APIManagerUtil;
|
||||
import org.wso2.carbon.apimgt.impl.APIConstants;
|
||||
import org.wso2.carbon.apimgt.impl.APIManagerFactory;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.*;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.*;
|
||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
import org.wso2.carbon.user.api.UserStoreException;
|
||||
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
|
||||
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This class represents an implementation of APIManagementProviderService.
|
||||
@ -44,302 +39,125 @@ import java.util.Set;
|
||||
public class APIManagementProviderServiceImpl implements APIManagementProviderService {
|
||||
|
||||
private static final Log log = LogFactory.getLog(APIManagementProviderServiceImpl.class);
|
||||
private static final String CONTENT_TYPE = "application/json";
|
||||
private static final int MAX_API_PER_TAG = 200;
|
||||
|
||||
@Override
|
||||
public void removeAPIApplication(String applicationName, String username) throws APIManagerException {
|
||||
|
||||
StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService()
|
||||
.getStoreClient();
|
||||
ApplicationList applicationList = storeClient.getApplications()
|
||||
.applicationsGet("", applicationName, 1, 0, CONTENT_TYPE, null);
|
||||
if (applicationList.getList() != null && applicationList.getList().size() > 0) {
|
||||
ApplicationInfo applicationInfo = applicationList.getList().get(0);
|
||||
storeClient.getIndividualApplication().applicationsApplicationIdDelete(applicationInfo.getApplicationId(),
|
||||
null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void registerExistingOAuthApplicationToAPIApplication(String jsonString, String applicationName,
|
||||
String clientId, String username,
|
||||
boolean isAllowedAllDomains, String keyType,
|
||||
String tags[]) throws APIManagerException {
|
||||
try {
|
||||
APIManagerUtil.loadTenantRegistry();
|
||||
APIConsumer apiConsumer = APIManagerFactory.getInstance().getAPIConsumer(username);
|
||||
if (apiConsumer != null) {
|
||||
String groupId = getLoggedInUserGroupId(username, APIManagerUtil.getTenantDomain());
|
||||
int applicationId = createApplication(apiConsumer, applicationName, username, groupId);
|
||||
Subscriber subscriber = apiConsumer.getSubscriber(username);
|
||||
if (subscriber == null) {
|
||||
String tenantDomain = MultitenantUtils.getTenantDomain(username);
|
||||
addSubscriber(username, "", groupId, APIManagerUtil.getTenantId(tenantDomain));
|
||||
subscriber = apiConsumer.getSubscriber(username);
|
||||
}
|
||||
Application[] applications = apiConsumer.getApplications(subscriber, groupId);
|
||||
Application application = null;
|
||||
for (Application app : applications) {
|
||||
if (app.getId() == applicationId) {
|
||||
application = app;
|
||||
}
|
||||
public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String applicationName, String tags[],
|
||||
String keyType, String username,
|
||||
boolean isAllowedAllDomains, String validityTime)
|
||||
throws APIManagerException {
|
||||
StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService()
|
||||
.getStoreClient();
|
||||
ApplicationList applicationList = storeClient.getApplications()
|
||||
.applicationsGet("", applicationName, 1, 0, CONTENT_TYPE, null);
|
||||
Application application;
|
||||
if (applicationList == null || applicationList.getList() == null || applicationList.getList().size() == 0) {
|
||||
//create application;
|
||||
application = new Application();
|
||||
application.setName(applicationName);
|
||||
application.setSubscriber(username);
|
||||
application.setDescription("");
|
||||
application.setThrottlingTier(ApiApplicationConstants.DEFAULT_TIER);
|
||||
application.setGroupId("");
|
||||
application = storeClient.getIndividualApplication().applicationsPost(application, CONTENT_TYPE);
|
||||
} else {
|
||||
ApplicationInfo applicationInfo = applicationList.getList().get(0);
|
||||
application = storeClient.getIndividualApplication()
|
||||
.applicationsApplicationIdGet(applicationInfo.getApplicationId(), CONTENT_TYPE, null, null);
|
||||
}
|
||||
if (application == null) {
|
||||
throw new APIManagerException(
|
||||
throw new APIManagerException (
|
||||
"Api application creation failed for " + applicationName + " to the user " + username);
|
||||
}
|
||||
|
||||
OAuthApplicationInfo oAuthApp = application.getOAuthApp(keyType);
|
||||
if (oAuthApp != null) {
|
||||
if (oAuthApp.getClientId().equals(clientId)) {
|
||||
// subscribe to apis.
|
||||
if (tags != null && tags.length > 0) {
|
||||
createApplicationAndSubscribeToAPIs(applicationName, tags, username);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
throw new APIManagerException("Api application already mapped to another OAuth App");
|
||||
}
|
||||
for (String tag: tags) {
|
||||
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
|
||||
APIList apiList = storeClient.getApis().apisGet(MAX_API_PER_TAG, 0, tenantDomain, "tag:" + tag
|
||||
, CONTENT_TYPE, null);
|
||||
if (apiList.getList() != null && apiList.getList().size() == 0) {
|
||||
apiList = storeClient.getApis().apisGet(MAX_API_PER_TAG, 0
|
||||
, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, "tag:" + tag, CONTENT_TYPE, null);
|
||||
}
|
||||
|
||||
apiConsumer.mapExistingOAuthClient(jsonString, username, clientId, applicationName,
|
||||
ApiApplicationConstants.DEFAULT_TOKEN_TYPE);
|
||||
if (tags != null && tags.length > 0) {
|
||||
createApplicationAndSubscribeToAPIs(applicationName, tags, username);
|
||||
}
|
||||
}
|
||||
} catch (APIManagementException e) {
|
||||
throw new APIManagerException(
|
||||
"Failed registering the OAuth app [ clientId " + clientId + " ] with api manager application", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAPIApplication(String applicationName, String username) throws APIManagerException {
|
||||
try {
|
||||
APIManagerUtil.loadTenantRegistry();
|
||||
APIConsumer apiConsumer = APIManagerFactory.getInstance().getAPIConsumer(username);
|
||||
if (apiConsumer != null) {
|
||||
String groupId = getLoggedInUserGroupId(username, APIManagerUtil.getTenantDomain());
|
||||
Application[] applications = apiConsumer.getApplications(new Subscriber(username), groupId);
|
||||
for (Application application : applications) {
|
||||
if (application.getName().equals(applicationName)) {
|
||||
apiConsumer.removeApplication(application);
|
||||
if (apiList.getList() != null && apiList.getList().size() > 0) {
|
||||
for (APIInfo apiInfo : apiList.getList()) {
|
||||
Subscription subscription = new Subscription();
|
||||
//fix for APIMANAGER-5566 admin-AT-tenant1.com-Tenant1API1-1.0.0
|
||||
String id = apiInfo.getProvider().replace("@", "-AT-")
|
||||
+ "-" + apiInfo.getName()+ "-" + apiInfo.getVersion();
|
||||
subscription.setApiIdentifier(id);
|
||||
subscription.setApplicationId(application.getApplicationId());
|
||||
subscription.tier(ApiApplicationConstants.DEFAULT_TIER);
|
||||
SubscriptionList subscriptionList = storeClient.getSubscriptions().subscriptionsGet
|
||||
(id, application.getApplicationId(), "", 0, 100, CONTENT_TYPE, null);
|
||||
boolean subscriptionExist = false;
|
||||
if (subscriptionList.getList() != null && subscriptionList.getList().size() > 0) {
|
||||
for (Subscription subs : subscriptionList.getList()) {
|
||||
if (subs.getApiIdentifier().equals(id) && subs.getApplicationId().equals(
|
||||
application.getApplicationId())) {
|
||||
subscriptionExist = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (APIManagementException e) {
|
||||
throw new APIManagerException(
|
||||
"Failed to remove the application [ application name " + applicationName + " ]", e);
|
||||
if (!subscriptionExist) {
|
||||
storeClient.getIndividualSubscription().subscriptionsPost(subscription, CONTENT_TYPE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//end of subscription
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String apiApplicationName, String tags[],
|
||||
String keyType, String username,
|
||||
boolean isAllowedAllDomains, String validityTime)
|
||||
throws APIManagerException {
|
||||
try {
|
||||
APIManagerUtil.loadTenantRegistry();
|
||||
APIConsumer apiConsumer = APIManagerFactory.getInstance().getAPIConsumer(username);
|
||||
String groupId = getLoggedInUserGroupId(username, APIManagerUtil.getTenantDomain());
|
||||
int applicationId = createApplicationAndSubscribeToAPIs(apiApplicationName, tags, username);
|
||||
Application[] applications = apiConsumer.getApplications(apiConsumer.getSubscriber(username), groupId);
|
||||
Application application = null;
|
||||
for (Application app : applications) {
|
||||
if (app.getId() == applicationId) {
|
||||
application = app;
|
||||
}
|
||||
}
|
||||
if (application == null) {
|
||||
throw new APIManagerException(
|
||||
"Api application creation failed for " + apiApplicationName + " to the user " + username);
|
||||
}
|
||||
|
||||
OAuthApplicationInfo oAuthApp = application.getOAuthApp(keyType);
|
||||
if (oAuthApp != null) {
|
||||
List<ApplicationKey> applicationKeys = application.getKeys();
|
||||
if (applicationKeys != null) {
|
||||
for (ApplicationKey applicationKey : applicationKeys) {
|
||||
if (keyType.equals(applicationKey.getKeyType().toString())) {
|
||||
ApiApplicationKey apiApplicationKey = new ApiApplicationKey();
|
||||
apiApplicationKey.setConsumerKey(oAuthApp.getClientId());
|
||||
apiApplicationKey.setConsumerSecret(oAuthApp.getClientSecret());
|
||||
apiApplicationKey.setConsumerKey(applicationKey.getConsumerKey());
|
||||
apiApplicationKey.setConsumerSecret(applicationKey.getConsumerSecret());
|
||||
return apiApplicationKey;
|
||||
}
|
||||
String[] allowedDomains = new String[1];
|
||||
}
|
||||
}
|
||||
|
||||
ApplicationKeyGenerateRequest applicationKeyGenerateRequest = new ApplicationKeyGenerateRequest();
|
||||
List<String> allowedDomains = new ArrayList<>();
|
||||
if (isAllowedAllDomains) {
|
||||
allowedDomains[0] = ApiApplicationConstants.ALLOWED_DOMAINS;
|
||||
allowedDomains.add(ApiApplicationConstants.ALLOWED_DOMAINS);
|
||||
} else {
|
||||
allowedDomains[0] = APIManagerUtil.getTenantDomain();
|
||||
allowedDomains.add(APIManagerUtil.getTenantDomain());
|
||||
}
|
||||
String ownerJsonString = "{\"username\":\"" + username + "\"}";
|
||||
Map<String, Object> keyDetails = apiConsumer.requestApprovalForApplicationRegistration(username,
|
||||
apiApplicationName,
|
||||
keyType, "",
|
||||
allowedDomains,
|
||||
validityTime,
|
||||
"null",
|
||||
groupId,
|
||||
ownerJsonString);
|
||||
applicationKeyGenerateRequest.setAccessAllowDomains(allowedDomains);
|
||||
applicationKeyGenerateRequest.setCallbackUrl("");
|
||||
applicationKeyGenerateRequest.setKeyType(ApplicationKeyGenerateRequest.KeyTypeEnum.PRODUCTION);
|
||||
applicationKeyGenerateRequest.setValidityTime(validityTime);
|
||||
|
||||
ApplicationKey applicationKey = storeClient.getIndividualApplication().applicationsGenerateKeysPost(
|
||||
application.getApplicationId(), applicationKeyGenerateRequest, CONTENT_TYPE, null, null);
|
||||
ApiApplicationKey apiApplicationKey = new ApiApplicationKey();
|
||||
apiApplicationKey.setConsumerKey((String) keyDetails.get(APIConstants.FrontEndParameterNames
|
||||
.CONSUMER_KEY));
|
||||
apiApplicationKey.setConsumerSecret((String) keyDetails.get(
|
||||
APIConstants.FrontEndParameterNames.CONSUMER_SECRET));
|
||||
apiApplicationKey.setConsumerKey(applicationKey.getConsumerKey());
|
||||
apiApplicationKey.setConsumerSecret(applicationKey.getConsumerSecret());
|
||||
return apiApplicationKey;
|
||||
} catch (APIManagementException e) {
|
||||
throw new APIManagerException("Failed to register a api application : " + apiApplicationName, e);
|
||||
}
|
||||
}
|
||||
|
||||
private int createApplication(APIConsumer apiConsumer, String applicationName, String username, String groupId)
|
||||
throws APIManagerException {
|
||||
try {
|
||||
if (apiConsumer != null) {
|
||||
if (apiConsumer.getSubscriber(username) == null) {
|
||||
String tenantDomain = MultitenantUtils.getTenantDomain(username);
|
||||
addSubscriber(username, "", groupId, APIManagerUtil.getTenantId(tenantDomain));
|
||||
}
|
||||
Application application = apiConsumer.getApplicationsByName(username, applicationName, groupId);
|
||||
if (application == null) {
|
||||
Subscriber subscriber = apiConsumer.getSubscriber(username);
|
||||
application = new Application(applicationName, subscriber);
|
||||
application.setTier(ApiApplicationConstants.DEFAULT_TIER);
|
||||
application.setGroupId(groupId);
|
||||
return apiConsumer.addApplication(application, username);
|
||||
} else {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Application [" + applicationName + "] already exists for Subscriber [" + username +
|
||||
"]");
|
||||
}
|
||||
return application.getId();
|
||||
}
|
||||
} else {
|
||||
throw new APIManagerException("Failed to retrieve the api consumer for username" + username);
|
||||
}
|
||||
} catch (APIManagementException e) {
|
||||
throw new APIManagerException("Failed to create application [name:" + applicationName + " , username:"
|
||||
+ username + ", " + "groupId:" + groupId, e);
|
||||
}
|
||||
}
|
||||
|
||||
private void addSubscription(APIConsumer apiConsumer, APIIdentifier apiId, int applicationId, String username)
|
||||
throws APIManagerException {
|
||||
try {
|
||||
if (apiConsumer != null) {
|
||||
APIIdentifier apiIdentifier = new APIIdentifier(apiId.getProviderName(), apiId.getApiName(),
|
||||
apiId.getVersion());
|
||||
apiIdentifier.setTier(ApiApplicationConstants.DEFAULT_TIER);
|
||||
apiConsumer.addSubscription(apiIdentifier, username, applicationId);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Successfully created subscription for API : " + apiId + " from application : " +
|
||||
applicationId);
|
||||
}
|
||||
} else {
|
||||
throw new APIManagerException("API provider configured for the given API configuration is null. " +
|
||||
"Thus, the API is not published");
|
||||
}
|
||||
} catch (APIManagementException e) {
|
||||
throw new APIManagerException("Failed to create subscription for api name : " + apiId.getApiName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void addSubscriber(String subscriberName, String subscriberEmail, String groupId, int tenantId)
|
||||
throws APIManagerException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Creating subscriber with name " + subscriberName);
|
||||
}
|
||||
try {
|
||||
APIConsumer consumer = APIManagerFactory.getInstance().getAPIConsumer(subscriberName);
|
||||
if (consumer != null) {
|
||||
synchronized (consumer) {
|
||||
if (consumer.getSubscriber(subscriberName) == null) {
|
||||
consumer.addSubscriber(subscriberName, groupId);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Successfully created subscriber with name : " + subscriberName +
|
||||
" with groupID : " + groupId);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new APIManagerException("API provider configured for the given API configuration is null. " +
|
||||
"Thus, the API is not published");
|
||||
}
|
||||
} catch (APIManagementException e) {
|
||||
throw new APIManagerException("API provider configured for the given API configuration is null. " +
|
||||
"Thus, the API is not published", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method registers an api application and then subscribe the application to the api.
|
||||
*
|
||||
* @param apiApplicationName name of the application.
|
||||
* @param tags are used subscribe the apis with the tag.
|
||||
* @param username subscription is created for the user.
|
||||
* @throws APIManagerException
|
||||
*/
|
||||
private int createApplicationAndSubscribeToAPIs(String apiApplicationName, String tags[], String username)
|
||||
throws APIManagerException {
|
||||
try {
|
||||
APIConsumer apiConsumer = APIManagerFactory.getInstance().getAPIConsumer(username);
|
||||
String groupId = getLoggedInUserGroupId(username, APIManagerUtil.getTenantDomain());
|
||||
int applicationId = createApplication(apiConsumer, apiApplicationName, username, groupId);
|
||||
Subscriber subscriber = apiConsumer.getSubscriber(username);
|
||||
Set<API> userVisibleAPIs = null;
|
||||
for (String tag : tags) {
|
||||
Set<API> tagAPIs = apiConsumer.getAPIsWithTag(tag, APIManagerUtil.getTenantDomain());
|
||||
if (tagAPIs == null || tagAPIs.size() == 0) {
|
||||
try {
|
||||
PrivilegedCarbonContext.startTenantFlow();
|
||||
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(
|
||||
MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true);
|
||||
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(
|
||||
PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm()
|
||||
.getRealmConfiguration().getAdminUserName());
|
||||
APIConsumer anonymousConsumer = APIManagerFactory.getInstance().getAPIConsumer(username);
|
||||
tagAPIs = anonymousConsumer.getAPIsWithTag(tag, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
|
||||
|
||||
} catch (UserStoreException e) {
|
||||
log.error("failed to initialized super tenant flow", e);
|
||||
} finally {
|
||||
PrivilegedCarbonContext.endTenantFlow();
|
||||
}
|
||||
}
|
||||
if (userVisibleAPIs == null) {
|
||||
userVisibleAPIs = tagAPIs;
|
||||
} else {
|
||||
userVisibleAPIs.addAll(tagAPIs);
|
||||
}
|
||||
}
|
||||
if (userVisibleAPIs != null) {
|
||||
Set<SubscribedAPI> subscribedAPIs = apiConsumer.getSubscribedAPIs(subscriber, apiApplicationName,
|
||||
groupId);
|
||||
for (API userVisibleAPI : userVisibleAPIs) {
|
||||
APIIdentifier apiIdentifier = userVisibleAPI.getId();
|
||||
boolean isSubscribed = false;
|
||||
if (subscribedAPIs != null) {
|
||||
for (SubscribedAPI subscribedAPI : subscribedAPIs) {
|
||||
if (subscribedAPI.getApiId().equals(apiIdentifier)) {
|
||||
isSubscribed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isSubscribed) {
|
||||
addSubscription(apiConsumer, apiIdentifier, applicationId, username);
|
||||
}
|
||||
}
|
||||
}
|
||||
return applicationId;
|
||||
} catch (APIManagementException e) {
|
||||
throw new APIManagerException("Failed to fetch device apis information for the user " + username, e);
|
||||
}
|
||||
}
|
||||
|
||||
private String getLoggedInUserGroupId(String username, String tenantDomain) throws APIManagerException {
|
||||
JSONObject loginInfoJsonObj = new JSONObject();
|
||||
try {
|
||||
APIConsumer apiConsumer = APIManagerFactory.getInstance().getAPIConsumer(username);
|
||||
loginInfoJsonObj.put("user", username);
|
||||
if (MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
|
||||
loginInfoJsonObj.put("isSuperTenant", true);
|
||||
} else {
|
||||
loginInfoJsonObj.put("isSuperTenant", false);
|
||||
}
|
||||
String loginInfoString = loginInfoJsonObj.toString();
|
||||
return apiConsumer.getGroupIds(loginInfoString);
|
||||
} catch (APIManagementException e) {
|
||||
throw new APIManagerException("Unable to get groupIds of user " + username, e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
package org.wso2.carbon.apimgt.application.extension.internal;
|
||||
|
||||
import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService;
|
||||
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
|
||||
import org.wso2.carbon.registry.core.service.TenantRegistryLoader;
|
||||
import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader;
|
||||
import org.wso2.carbon.user.core.service.RealmService;
|
||||
@ -30,6 +31,7 @@ public class APIApplicationManagerExtensionDataHolder {
|
||||
private TenantManager tenantManager;
|
||||
private TenantRegistryLoader tenantRegistryLoader;
|
||||
private TenantIndexingLoader indexLoader;
|
||||
private IntegrationClientService integrationClientService;
|
||||
|
||||
private APIApplicationManagerExtensionDataHolder() {
|
||||
}
|
||||
@ -86,4 +88,13 @@ public class APIApplicationManagerExtensionDataHolder {
|
||||
public TenantIndexingLoader getIndexLoaderService(){
|
||||
return indexLoader;
|
||||
}
|
||||
|
||||
public IntegrationClientService getIntegrationClientService() {
|
||||
return integrationClientService;
|
||||
}
|
||||
|
||||
public void setIntegrationClientService(
|
||||
IntegrationClientService integrationClientService) {
|
||||
this.integrationClientService = integrationClientService;
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ import org.osgi.framework.BundleContext;
|
||||
import org.osgi.service.component.ComponentContext;;
|
||||
import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService;
|
||||
import org.wso2.carbon.apimgt.application.extension.APIManagementProviderServiceImpl;
|
||||
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
|
||||
import org.wso2.carbon.registry.core.service.TenantRegistryLoader;
|
||||
import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader;
|
||||
import org.wso2.carbon.user.core.service.RealmService;
|
||||
@ -48,6 +49,11 @@ import org.wso2.carbon.user.core.service.RealmService;
|
||||
* policy="dynamic"
|
||||
* bind="setRealmService"
|
||||
* unbind="unsetRealmService"
|
||||
* interface="org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService"
|
||||
* cardinality="1..1"
|
||||
* policy="dynamic"
|
||||
* bind="setIntegrationClientService"
|
||||
* unbind="unsetIntegrationClientService"
|
||||
*/
|
||||
public class APIApplicationManagerExtensionServiceComponent {
|
||||
|
||||
@ -86,6 +92,17 @@ public class APIApplicationManagerExtensionServiceComponent {
|
||||
APIApplicationManagerExtensionDataHolder.getInstance().setIndexLoaderService(null);
|
||||
}
|
||||
|
||||
protected void setIntegrationClientService(IntegrationClientService integrationClientService) {
|
||||
if (integrationClientService != null && log.isDebugEnabled()) {
|
||||
log.debug("integrationClientService initialized");
|
||||
}
|
||||
APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(integrationClientService);
|
||||
}
|
||||
|
||||
protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) {
|
||||
APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Realm Service.
|
||||
*
|
||||
|
||||
@ -21,13 +21,13 @@
|
||||
<parent>
|
||||
<artifactId>apimgt-extensions</artifactId>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<version>2.0.8-SNAPSHOT</version>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>org.wso2.carbon.apimgt.handlers</artifactId>
|
||||
<version>2.0.8-SNAPSHOT</version>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<packaging>bundle</packaging>
|
||||
<name>WSO2 Carbon - API Security Handler Component</name>
|
||||
<description>WSO2 Carbon - API Management Security Handler Module</description>
|
||||
|
||||
@ -0,0 +1,141 @@
|
||||
<!-- ~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~ ~ WSO2 Inc. licenses this file to you 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. -->
|
||||
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<parent>
|
||||
<artifactId>apimgt-extensions</artifactId>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<packaging>bundle</packaging>
|
||||
<name>WSO2 Carbon - API Management Integration Client</name>
|
||||
<description>WSO2 Carbon - API Management Integration Client</description>
|
||||
<url>http://wso2.org</url>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-scr-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
|
||||
<Bundle-Name>${project.artifactId}</Bundle-Name>
|
||||
<Bundle-Version>${project.version}</Bundle-Version>
|
||||
<Bundle-Description>APIM Integration</Bundle-Description>
|
||||
<Private-Package>org.wso2.carbon.apimgt.integration.client.internal</Private-Package>
|
||||
<Export-Package>
|
||||
org.wso2.carbon.apimgt.integration.client.*,
|
||||
!org.wso2.carbon.apimgt.integration.client.internal
|
||||
</Export-Package>
|
||||
<Import-Package>
|
||||
org.osgi.framework,
|
||||
org.osgi.service.component,
|
||||
feign,
|
||||
feign.codec,
|
||||
feign.auth,
|
||||
feign.gson,
|
||||
javax.ws.rs,
|
||||
javax.xml.bind,
|
||||
javax.xml.bind.annotation,
|
||||
javax.xml.parsers;resolution:=optional,
|
||||
org.apache.commons.logging,
|
||||
org.w3c.dom,
|
||||
org.wso2.carbon.context,
|
||||
org.wso2.carbon.identity.jwt.client.*,
|
||||
org.wso2.carbon.user.api,
|
||||
org.wso2.carbon.utils,
|
||||
com.fasterxml.jackson.annotation,
|
||||
io.swagger.annotations,
|
||||
org.wso2.carbon.core.util,
|
||||
javax.xml,
|
||||
org.wso2.carbon.base
|
||||
</Import-Package>
|
||||
<Embed-Dependency>
|
||||
jsr311-api,
|
||||
feign-jaxrs
|
||||
</Embed-Dependency>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon</groupId>
|
||||
<artifactId>org.wso2.carbon.logging</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi.services</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>jsr311-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-jaxrs</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-gson</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.testng</groupId>
|
||||
<artifactId>testng</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<artifactId>org.wso2.carbon.identity.jwt.client.extension</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient;
|
||||
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.StoreClient;
|
||||
|
||||
public class IntegrationClientServiceImpl implements IntegrationClientService {
|
||||
|
||||
private static StoreClient storeClient;
|
||||
private static PublisherClient publisherClient;
|
||||
|
||||
public IntegrationClientServiceImpl() {
|
||||
RequestInterceptor oAuthRequestInterceptor = new OAuthRequestInterceptor();
|
||||
storeClient = new StoreClient(oAuthRequestInterceptor);
|
||||
publisherClient = new PublisherClient(oAuthRequestInterceptor);
|
||||
}
|
||||
@Override
|
||||
public StoreClient getStoreClient() {
|
||||
return storeClient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PublisherClient getPublisherClient() {
|
||||
return publisherClient;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client;
|
||||
|
||||
import feign.Feign;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
import feign.auth.BasicAuthRequestInterceptor;
|
||||
import feign.gson.GsonDecoder;
|
||||
import feign.gson.GsonEncoder;
|
||||
import feign.jaxrs.JAXRSContract;
|
||||
import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader;
|
||||
import org.wso2.carbon.apimgt.integration.client.exception.APIMClientOAuthException;
|
||||
import org.wso2.carbon.apimgt.integration.client.internal.APIIntegrationClientDataHolder;
|
||||
import org.wso2.carbon.apimgt.integration.client.model.ClientProfile;
|
||||
import org.wso2.carbon.apimgt.integration.client.model.DCRClient;
|
||||
import org.wso2.carbon.apimgt.integration.client.model.OAuthApplication;
|
||||
import org.wso2.carbon.apimgt.integration.client.util.PropertyUtils;
|
||||
import org.wso2.carbon.base.MultitenantConstants;
|
||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
import org.wso2.carbon.identity.jwt.client.extension.JWTClient;
|
||||
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
|
||||
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
|
||||
import org.wso2.carbon.user.api.UserStoreException;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This is a request interceptor to add oauth token header.
|
||||
*/
|
||||
public class OAuthRequestInterceptor implements RequestInterceptor {
|
||||
|
||||
private static final String APPLICATION_NAME = "api_integration_client";
|
||||
private static final String GRANT_TYPES = "password refresh_token urn:ietf:params:oauth:grant-type:jwt-bearer";
|
||||
private static final String REQUIRED_SCOPE =
|
||||
"apim:api_create apim:api_view apim:api_publish apim:subscribe apim:tier_view apim:tier_manage " +
|
||||
"apim:subscription_view apim:subscription_block";
|
||||
private static final long DEFAULT_REFRESH_TIME_OFFSET_IN_MILLIS = 100000;
|
||||
private DCRClient dcrClient;
|
||||
private static OAuthApplication oAuthApplication;
|
||||
private static Map<String, AccessTokenInfo> tenantUserTokenMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Creates an interceptor that authenticates all requests.
|
||||
*/
|
||||
public OAuthRequestInterceptor() {
|
||||
String username = APIMConfigReader.getInstance().getConfig().getUsername();
|
||||
String password = APIMConfigReader.getInstance().getConfig().getPassword();
|
||||
dcrClient = Feign.builder().requestInterceptor(
|
||||
new BasicAuthRequestInterceptor(username, password))
|
||||
.contract(new JAXRSContract()).encoder(new GsonEncoder()).decoder(new GsonDecoder())
|
||||
.target(DCRClient.class, PropertyUtils.replaceProperties(
|
||||
APIMConfigReader.getInstance().getConfig().getDcrEndpoint()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(RequestTemplate template) {
|
||||
if (oAuthApplication == null) {
|
||||
//had to do on demand initialization due to start up error.
|
||||
ClientProfile clientProfile = new ClientProfile();
|
||||
clientProfile.setClientName(APPLICATION_NAME);
|
||||
clientProfile.setCallbackUrl("");
|
||||
clientProfile.setGrantType(GRANT_TYPES);
|
||||
clientProfile.setOwner(APIMConfigReader.getInstance().getConfig().getUsername());
|
||||
clientProfile.setSaasApp(true);
|
||||
oAuthApplication = dcrClient.register(clientProfile);
|
||||
}
|
||||
try {
|
||||
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
|
||||
String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
|
||||
if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
|
||||
username = username + "@" + tenantDomain;
|
||||
}
|
||||
AccessTokenInfo tenantBasedAccessTokenInfo = tenantUserTokenMap.get(username);
|
||||
if ((tenantBasedAccessTokenInfo == null ||
|
||||
((System.currentTimeMillis() + DEFAULT_REFRESH_TIME_OFFSET_IN_MILLIS) >
|
||||
tenantBasedAccessTokenInfo.getExpiresIn()))) {
|
||||
|
||||
JWTClient jwtClient = APIIntegrationClientDataHolder.getInstance().getJwtClientManagerService()
|
||||
.getJWTClient();
|
||||
tenantBasedAccessTokenInfo = jwtClient.getAccessToken(oAuthApplication.getClientId(),
|
||||
oAuthApplication.getClientSecret(), username,
|
||||
REQUIRED_SCOPE);
|
||||
tenantBasedAccessTokenInfo.setExpiresIn(
|
||||
System.currentTimeMillis() + (tenantBasedAccessTokenInfo.getExpiresIn() * 1000));
|
||||
tenantUserTokenMap.put(username, tenantBasedAccessTokenInfo);
|
||||
|
||||
}
|
||||
if (tenantBasedAccessTokenInfo.getAccessToken() != null) {
|
||||
String headerValue = "Bearer " + tenantBasedAccessTokenInfo.getAccessToken();
|
||||
template.header("Authorization", headerValue);
|
||||
}
|
||||
} catch (JWTClientException e) {
|
||||
throw new APIMClientOAuthException("failed to retrieve oauth token using jwt", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.configs;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* This holds the configuration api manager integration.
|
||||
*/
|
||||
@XmlRootElement(name = "APIMConfiguration")
|
||||
public class APIMConfig {
|
||||
|
||||
String dcrEndpoint;
|
||||
String tokenEndpoint;
|
||||
String publisherEndpoint;
|
||||
String storeEndpoint;
|
||||
String username;
|
||||
String password;
|
||||
|
||||
@XmlElement(name = "DCREndpoint", required = true)
|
||||
public String getDcrEndpoint() {
|
||||
return dcrEndpoint;
|
||||
}
|
||||
|
||||
public void setDcrEndpoint(String dcrEndpoint) {
|
||||
this.dcrEndpoint = dcrEndpoint;
|
||||
}
|
||||
|
||||
@XmlElement(name = "TokenEndpoint", required = true)
|
||||
public String getTokenEndpoint() {
|
||||
return tokenEndpoint;
|
||||
}
|
||||
|
||||
public void setTokenEndpoint(String tokenEndpoint) {
|
||||
this.tokenEndpoint = tokenEndpoint;
|
||||
}
|
||||
|
||||
@XmlElement(name = "PublisherEndpoint", required = true)
|
||||
public String getPublisherEndpoint() {
|
||||
return publisherEndpoint;
|
||||
}
|
||||
|
||||
public void setPublisherEndpoint(String publisherEndpoint) {
|
||||
this.publisherEndpoint = publisherEndpoint;
|
||||
}
|
||||
|
||||
@XmlElement(name = "StoreEndpoint", required = true)
|
||||
public String getStoreEndpoint() {
|
||||
return storeEndpoint;
|
||||
}
|
||||
|
||||
public void setStoreEndpoint(String storeEndpoint) {
|
||||
this.storeEndpoint = storeEndpoint;
|
||||
}
|
||||
|
||||
@XmlElement(name = "Username", required = true)
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
@XmlElement(name = "Password", required = true)
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.configs;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.wso2.carbon.apimgt.integration.client.exception.APIMClientException;
|
||||
import org.wso2.carbon.apimgt.integration.client.exception.InvalidConfigurationStateException;
|
||||
import org.wso2.carbon.utils.CarbonUtils;
|
||||
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* This holds the configuration parser for api integration.xml
|
||||
*/
|
||||
public class APIMConfigReader {
|
||||
|
||||
private static APIMConfig config;
|
||||
private static APIMConfigReader configReader= new APIMConfigReader();
|
||||
private static boolean isInitialized = false;
|
||||
private static final String API_INTEGRATION_CONFIG_PATH =
|
||||
CarbonUtils.getCarbonConfigDirPath() + File.separator + "apim-integration.xml";
|
||||
|
||||
private APIMConfigReader() {
|
||||
|
||||
}
|
||||
|
||||
private static String apimIntegrationXmlFilePath = "";
|
||||
|
||||
//TOD file may be a part of another file
|
||||
public static APIMConfigReader getInstance() {
|
||||
if (!isInitialized) {
|
||||
try {
|
||||
init();
|
||||
} catch (APIMClientException e) {
|
||||
throw new InvalidConfigurationStateException("Webapp Authenticator Configuration is not " +
|
||||
"initialized properly");
|
||||
}
|
||||
}
|
||||
return configReader;
|
||||
}
|
||||
|
||||
public static void init() throws APIMClientException {
|
||||
try {
|
||||
File apimConfigFile = new File(API_INTEGRATION_CONFIG_PATH);
|
||||
Document doc = convertToDocument(apimConfigFile);
|
||||
|
||||
JAXBContext ctx = JAXBContext.newInstance(APIMConfig.class);
|
||||
Unmarshaller unmarshaller = ctx.createUnmarshaller();
|
||||
config = (APIMConfig) unmarshaller.unmarshal(doc);
|
||||
isInitialized = true;
|
||||
} catch (JAXBException e) {
|
||||
throw new APIMClientException("Error occurred while un-marshalling APIMConfig", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static Document convertToDocument(File file) throws APIMClientException {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
factory.setNamespaceAware(true);
|
||||
try {
|
||||
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
||||
DocumentBuilder docBuilder = factory.newDocumentBuilder();
|
||||
return docBuilder.parse(file);
|
||||
} catch (Exception e) {
|
||||
throw new APIMClientException("Error occurred while parsing file 'apim-integration.xml' to a org.w3c.dom.Document", e);
|
||||
}
|
||||
}
|
||||
|
||||
public APIMConfig getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.exception;
|
||||
|
||||
/**
|
||||
* This holds api client exception.
|
||||
*/
|
||||
public class APIMClientException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = -3976392476319079281L;
|
||||
private String responseReason;
|
||||
private int responseStatus;
|
||||
private String methodKey;
|
||||
|
||||
APIMClientException(String methodKey, String reason, int status) {
|
||||
super("Exception occured while invoking " + methodKey + " status = " + status + " reason = " + reason);
|
||||
this.methodKey = methodKey;
|
||||
this.responseReason = reason;
|
||||
this.responseStatus = status;
|
||||
}
|
||||
|
||||
APIMClientException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public APIMClientException(String message, Exception e) {
|
||||
super(message, e);
|
||||
}
|
||||
|
||||
public String getResponseReason() {
|
||||
return responseReason;
|
||||
}
|
||||
|
||||
public int getResponseStatus() {
|
||||
return responseStatus;
|
||||
}
|
||||
|
||||
public String getMethodKey() {
|
||||
return methodKey;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.exception;
|
||||
|
||||
/**
|
||||
* This holds api client exception.
|
||||
*/
|
||||
public class APIMClientOAuthException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = -3976392476319079281L;
|
||||
private String responseReason;
|
||||
private int responseStatus;
|
||||
private String methodKey;
|
||||
|
||||
APIMClientOAuthException(String methodKey, String reason, int status) {
|
||||
super("Exception occured while invoking " + methodKey + " status = " + status + " reason = " + reason);
|
||||
this.methodKey = methodKey;
|
||||
this.responseReason = reason;
|
||||
this.responseStatus = status;
|
||||
}
|
||||
|
||||
APIMClientOAuthException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public APIMClientOAuthException(String message, Exception e) {
|
||||
super(message, e);
|
||||
}
|
||||
|
||||
public String getResponseReason() {
|
||||
return responseReason;
|
||||
}
|
||||
|
||||
public int getResponseStatus() {
|
||||
return responseStatus;
|
||||
}
|
||||
|
||||
public String getMethodKey() {
|
||||
return methodKey;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.exception;
|
||||
|
||||
/**
|
||||
* This error is thrown when there is an issue with the client.
|
||||
*/
|
||||
public class InvalidConfigurationStateException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = -3151279311329070397L;
|
||||
|
||||
private String errorMessage;
|
||||
private int errorCode;
|
||||
|
||||
public InvalidConfigurationStateException(int errorCode, String message) {
|
||||
super(message);
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public InvalidConfigurationStateException(int errorCode, String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public int getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
public void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public InvalidConfigurationStateException(String msg, Exception nestedEx) {
|
||||
super(msg, nestedEx);
|
||||
setErrorMessage(msg);
|
||||
}
|
||||
|
||||
public InvalidConfigurationStateException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
setErrorMessage(message);
|
||||
}
|
||||
|
||||
public InvalidConfigurationStateException(String msg) {
|
||||
super(msg);
|
||||
setErrorMessage(msg);
|
||||
}
|
||||
|
||||
public InvalidConfigurationStateException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public InvalidConfigurationStateException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.internal;
|
||||
|
||||
|
||||
import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService;
|
||||
|
||||
/**
|
||||
* This holds the required service for this component
|
||||
*/
|
||||
public class APIIntegrationClientDataHolder {
|
||||
private static APIIntegrationClientDataHolder thisInstance = new APIIntegrationClientDataHolder();
|
||||
private JWTClientManagerService jwtClientManagerService;
|
||||
private APIIntegrationClientDataHolder() {
|
||||
}
|
||||
|
||||
|
||||
public static APIIntegrationClientDataHolder getInstance() {
|
||||
return thisInstance;
|
||||
}
|
||||
|
||||
public void setJwtClientManagerService(JWTClientManagerService jwtClientManagerService) {
|
||||
this.jwtClientManagerService = jwtClientManagerService;
|
||||
}
|
||||
|
||||
public JWTClientManagerService getJwtClientManagerService() {
|
||||
return jwtClientManagerService;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.internal;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.wso2.carbon.apimgt.integration.client.IntegrationClientServiceImpl;
|
||||
import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader;
|
||||
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
|
||||
import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService;
|
||||
|
||||
/**
|
||||
* @scr.component name="org.wso2.carbon.api.integration.client" immediate="true"
|
||||
* @scr.reference name="api.integration.client.service"
|
||||
* interface="org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService"
|
||||
* cardinality="1..1"
|
||||
* policy="dynamic"
|
||||
* bind="setJWTClientManagerService"
|
||||
* unbind="unsetJWTClientManagerService"
|
||||
*/
|
||||
public class APIIntegrationClientServiceComponent {
|
||||
|
||||
private static Log log = LogFactory.getLog(APIIntegrationClientServiceComponent.class);
|
||||
|
||||
protected void activate(ComponentContext componentContext) {
|
||||
try {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Initializing apimgt client bundle");
|
||||
}
|
||||
|
||||
/* Initializing webapp publisher configuration */
|
||||
APIMConfigReader.init();
|
||||
BundleContext bundleContext = componentContext.getBundleContext();
|
||||
bundleContext.registerService(IntegrationClientService.class.getName(), new IntegrationClientServiceImpl(), null);
|
||||
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("apimgt client bundle has been successfully initialized");
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
log.error("Error occurred while initializing apimgt client bundle", e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void deactivate(ComponentContext componentContext) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
protected void setJWTClientManagerService(JWTClientManagerService jwtClientManagerService) {
|
||||
if (jwtClientManagerService != null) {
|
||||
log.debug("jwtClientManagerService service is initialized");
|
||||
}
|
||||
APIIntegrationClientDataHolder.getInstance().setJwtClientManagerService(jwtClientManagerService);
|
||||
}
|
||||
|
||||
protected void unsetJWTClientManagerService(JWTClientManagerService jwtClientManagerService) {
|
||||
APIIntegrationClientDataHolder.getInstance().setJwtClientManagerService(null);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.model;
|
||||
|
||||
/**
|
||||
* DTO fo DCR request.
|
||||
*/
|
||||
public class ClientProfile {
|
||||
|
||||
private String clientName;
|
||||
private String callbackUrl;
|
||||
private String tokenScope;
|
||||
private String owner;
|
||||
private String grantType;
|
||||
private boolean saasApp;
|
||||
|
||||
public String getClientName() {
|
||||
return clientName;
|
||||
}
|
||||
|
||||
public void setClientName(String clientName) {
|
||||
this.clientName = clientName;
|
||||
}
|
||||
|
||||
public String getCallbackUrl() {
|
||||
return callbackUrl;
|
||||
}
|
||||
|
||||
public void setCallbackUrl(String callbackUrl) {
|
||||
this.callbackUrl = callbackUrl;
|
||||
}
|
||||
|
||||
public String getTokenScope() {
|
||||
return tokenScope;
|
||||
}
|
||||
|
||||
public void setTokenScope(String tokenScope) {
|
||||
this.tokenScope = tokenScope;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public String getGrantType() {
|
||||
return grantType;
|
||||
}
|
||||
|
||||
public void setGrantType(String grantTypem) {
|
||||
this.grantType = grantTypem;
|
||||
}
|
||||
|
||||
public boolean isSaasApp() {
|
||||
return saasApp;
|
||||
}
|
||||
|
||||
public void setSaasApp(boolean saasApp) {
|
||||
this.saasApp = saasApp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("{\n");
|
||||
|
||||
sb.append(" clientName: ").append(clientName).append("\n");
|
||||
sb.append(" callbackUrl: ").append("callbackUrl").append("\n");
|
||||
sb.append(" grantType: ").append(grantType).append("\n");
|
||||
sb.append(" tokenScope: ").append(tokenScope).append("\n");
|
||||
sb.append(" owner: ").append(owner).append("\n");
|
||||
sb.append(" saasApp: ").append(saasApp).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@ -16,17 +16,21 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant;
|
||||
package org.wso2.carbon.apimgt.integration.client.model;
|
||||
|
||||
import org.wso2.carbon.device.mgt.oauth.extensions.OAuthExtUtils;
|
||||
import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ExtendedPasswordGrantHandler extends org.wso2.carbon.apimgt.keymgt.handlers.ExtendedPasswordGrantHandler {
|
||||
/**
|
||||
* DCR Rest resource.
|
||||
*/
|
||||
@Path("/")
|
||||
public interface DCRClient {
|
||||
|
||||
@Override
|
||||
public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) {
|
||||
return OAuthExtUtils.setScopes(tokReqMsgCtx);
|
||||
}
|
||||
// DCR APIs
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
OAuthApplication register(ClientProfile registrationProfile);
|
||||
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.model;
|
||||
|
||||
public class OAuthApplication {
|
||||
|
||||
private String jsonString;
|
||||
private String appOwner;
|
||||
private String clientName;
|
||||
private String callBackURL;
|
||||
private String isSaasApplication;
|
||||
private String clientId;
|
||||
private String clientSecret;
|
||||
|
||||
public String getJsonString() {
|
||||
return jsonString;
|
||||
}
|
||||
|
||||
public void setJsonString(String jsonString) {
|
||||
this.jsonString = jsonString;
|
||||
}
|
||||
|
||||
public String getAppOwner() {
|
||||
return appOwner;
|
||||
}
|
||||
|
||||
public void setAppOwner(String appOwner) {
|
||||
this.appOwner = appOwner;
|
||||
}
|
||||
|
||||
public String getClientName() {
|
||||
return clientName;
|
||||
}
|
||||
|
||||
public void setClientName(String clientName) {
|
||||
this.clientName = clientName;
|
||||
}
|
||||
|
||||
public String getCallBackURL() {
|
||||
return callBackURL;
|
||||
}
|
||||
|
||||
public void setCallBackURL(String callBackURL) {
|
||||
this.callBackURL = callBackURL;
|
||||
}
|
||||
|
||||
public String getIsSaasApplication() {
|
||||
return isSaasApplication;
|
||||
}
|
||||
|
||||
public void setIsSaasApplication(String isSaasApplication) {
|
||||
this.isSaasApplication = isSaasApplication;
|
||||
}
|
||||
|
||||
public String getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(String clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public String getClientSecret() {
|
||||
return clientSecret;
|
||||
}
|
||||
|
||||
public void setClientSecret(String clientSecret) {
|
||||
this.clientSecret = clientSecret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class OAuthApplication {\n");
|
||||
|
||||
sb.append(" jsonString: ").append(jsonString).append("\n");
|
||||
sb.append(" appOwner: ").append(appOwner).append("\n");
|
||||
sb.append(" clientName: ").append(clientName).append("\n");
|
||||
sb.append(" callBackURL: ").append(callBackURL).append("\n");
|
||||
sb.append(" isSaasApplication: ").append(isSaasApplication).append("\n");
|
||||
sb.append(" clientId: ").append(isSaasApplication).append("\n");
|
||||
sb.append(" clientSecret: ").append(clientSecret).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.publisher;
|
||||
|
||||
import feign.Feign;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.gson.GsonDecoder;
|
||||
import feign.gson.GsonEncoder;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.api.*;
|
||||
import org.wso2.carbon.core.util.Utils;
|
||||
|
||||
/**
|
||||
* Publisher client generated using swagger.
|
||||
*/
|
||||
public class PublisherClient {
|
||||
|
||||
private static final org.apache.commons.logging.Log log = LogFactory.getLog(PublisherClient.class);
|
||||
private APIsApi api = null;
|
||||
private APIDocumentApi document = null;
|
||||
private ApplicationsApi application = null;
|
||||
private EnvironmentsApi environments = null;
|
||||
private SubscriptionsApi subscriptions = null;
|
||||
private TiersApi tiers = null;
|
||||
|
||||
|
||||
/**
|
||||
* PublisherClient constructor - Initialize a PublisherClient instance
|
||||
*
|
||||
*/
|
||||
public PublisherClient(RequestInterceptor requestInterceptor) {
|
||||
Feign.Builder builder = Feign.builder().requestInterceptor(requestInterceptor)
|
||||
.encoder(new GsonEncoder()).decoder(new GsonDecoder());
|
||||
String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getPublisherEndpoint());
|
||||
|
||||
api = builder.target(APIsApi.class, basePath);
|
||||
document = builder.target(APIDocumentApi.class, basePath);
|
||||
application = builder.target(ApplicationsApi.class, basePath);
|
||||
environments = builder.target(EnvironmentsApi.class, basePath);
|
||||
subscriptions = builder.target(SubscriptionsApi.class, basePath);
|
||||
tiers = builder.target(TiersApi.class, basePath);
|
||||
}
|
||||
|
||||
public APIsApi getApi() {
|
||||
return api;
|
||||
}
|
||||
|
||||
public APIDocumentApi getDocument() {
|
||||
return document;
|
||||
}
|
||||
|
||||
public ApplicationsApi getApplication() {
|
||||
return application;
|
||||
}
|
||||
|
||||
public EnvironmentsApi getEnvironments() {
|
||||
return environments;
|
||||
}
|
||||
|
||||
public SubscriptionsApi getSubscriptions() {
|
||||
return subscriptions;
|
||||
}
|
||||
|
||||
public TiersApi getTiers() {
|
||||
return tiers;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,194 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.publisher.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.Document;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.DocumentList;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public interface APIDocumentApi {
|
||||
|
||||
|
||||
/**
|
||||
* Get document content
|
||||
* Downloads a FILE type document/get the inline content or source url of a certain document.
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param documentId **Document Identifier** (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}/documents/{documentId}/content")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
void apisApiIdDocumentsDocumentIdContentGet(@Param("apiId") String apiId, @Param("documentId") String documentId,
|
||||
@Param("accept") String accept, @Param("ifNoneMatch") String ifNoneMatch,
|
||||
@Param("ifModifiedSince") String ifModifiedSince);
|
||||
|
||||
/**
|
||||
* Update API document content.
|
||||
* Upload a file to a document or add inline content to the document. Document's source type should be **FILE** in order to upload a file to the document using **file** parameter. Document's source type should be **INLINE** in order to add inline content to the document using **inlineContent** parameter. Only one of **file** or **inlineContent** can be specified at one time.
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param documentId **Document Identifier** (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @param file Document to upload (optional)
|
||||
* @param inlineContent Inline content of the document (optional)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return Document
|
||||
*/
|
||||
@RequestLine("POST /apis/{apiId}/documents/{documentId}/content")
|
||||
@Headers({
|
||||
"Content-type: multipart/form-data",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}",
|
||||
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
Document apisApiIdDocumentsDocumentIdContentPost(@Param("apiId") String apiId, @Param("documentId") String documentId,
|
||||
@Param("contentType") String contentType, @Param("file") File file,
|
||||
@Param("inlineContent") String inlineContent,
|
||||
@Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Delete an API Document
|
||||
* Delete a document of an API
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param documentId **Document Identifier** (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("DELETE /apis/{apiId}/documents/{documentId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
void apisApiIdDocumentsDocumentIdDelete(@Param("apiId") String apiId, @Param("documentId") String documentId,
|
||||
@Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Get an API Document
|
||||
* Get a particular document associated with an API.
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param documentId **Document Identifier** (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly
|
||||
* retrieved variant of the resource. (optional)
|
||||
* @return Document
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}/documents/{documentId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
Document apisApiIdDocumentsDocumentIdGet(@Param("apiId") String apiId, @Param("documentId") String documentId,
|
||||
@Param("accept") String accept, @Param("ifNoneMatch") String ifNoneMatch,
|
||||
@Param("ifModifiedSince") String ifModifiedSince);
|
||||
|
||||
/**
|
||||
* Update an API Document
|
||||
* Update document details.
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param documentId **Document Identifier** (required)
|
||||
* @param body Document object that needs to be added (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return Document
|
||||
*/
|
||||
@RequestLine("PUT /apis/{apiId}/documents/{documentId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}",
|
||||
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
Document apisApiIdDocumentsDocumentIdPut(@Param("apiId") String apiId, @Param("documentId") String documentId,
|
||||
Document body, @Param("contentType") String contentType,
|
||||
@Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Get API Documents
|
||||
* Get a list of documents belonging to an API.
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param limit Maximum size of resource array to return. (optional, default to 25)
|
||||
* @param offset Starting point within the complete list of items qualified. (optional, default to 0)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @return DocumentList
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}/documents?limit={limit}&offset={offset}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}"
|
||||
})
|
||||
DocumentList apisApiIdDocumentsGet(@Param("apiId") String apiId, @Param("limit") Integer limit,
|
||||
@Param("offset") Integer offset, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch);
|
||||
|
||||
/**
|
||||
* Add a new document
|
||||
* Add a new document to an API
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param body Document object that needs to be added (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @return Document
|
||||
*/
|
||||
@RequestLine("POST /apis/{apiId}/documents")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}"
|
||||
})
|
||||
Document apisApiIdDocumentsPost(@Param("apiId") String apiId, Document body, @Param("contentType") String contentType);
|
||||
}
|
||||
@ -0,0 +1,262 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.publisher.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.API;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.APIList;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.FileInfo;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public interface APIsApi {
|
||||
|
||||
|
||||
/**
|
||||
* Delete API
|
||||
* Delete an existing API
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("DELETE /apis/{apiId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
void apisApiIdDelete(@Param("apiId") String apiId, @Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Get API details
|
||||
* Get details of an API
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return API
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
API apisApiIdGet(@Param("apiId") String apiId, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch, @Param("ifModifiedSince") String ifModifiedSince);
|
||||
|
||||
/**
|
||||
* Update an existing API
|
||||
* Update an existing API
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param body API object that needs to be added (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return API
|
||||
*/
|
||||
@RequestLine("PUT /apis/{apiId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}",
|
||||
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
API apisApiIdPut(@Param("apiId") String apiId, API body, @Param("contentType") String contentType,
|
||||
@Param("ifMatch") String ifMatch, @Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Get API Definition
|
||||
* Get the swagger of an API
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}/swagger")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
void apisApiIdSwaggerGet(@Param("apiId") String apiId, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch, @Param("ifModifiedSince") String ifModifiedSince);
|
||||
|
||||
/**
|
||||
* Update API Definition
|
||||
* Update an existing swagger definition of an API
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param apiDefinition Swagger definition of the API (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("PUT /apis/{apiId}/swagger")
|
||||
@Headers({
|
||||
"Content-type: multipart/form-data",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}",
|
||||
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
void apisApiIdSwaggerPut(@Param("apiId") String apiId, @Param("apiDefinition") String apiDefinition,
|
||||
@Param("contentType") String contentType, @Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Get the thumbnail image
|
||||
* Downloads a thumbnail image of an API
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}/thumbnail")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
void apisApiIdThumbnailGet(@Param("apiId") String apiId, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch, @Param("ifModifiedSince") String ifModifiedSince);
|
||||
|
||||
/**
|
||||
* Upload a thumbnail image
|
||||
* Upload a thumbnail image to an API.
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param file Image to upload (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return FileInfo
|
||||
*/
|
||||
@RequestLine("POST /apis/{apiId}/thumbnail")
|
||||
@Headers({
|
||||
"Content-type: multipart/form-data",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}",
|
||||
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
FileInfo apisApiIdThumbnailPost(@Param("apiId") String apiId, @Param("file") File file,
|
||||
@Param("contentType") String contentType, @Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Change API Status
|
||||
* Change the lifecycle of an API
|
||||
* @param action The action to demote or promote the state of the API. Supported actions are [ **Publish, Deploy as a Prototype, Demote to Created, Demote to Prototyped, Block, Deprecate, Re-Publish, Retire **] (required)
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. Should be formatted as **provider-name-version**. (required)
|
||||
* @param lifecycleChecklist You can specify additional checklist items by using an **\"attribute:\"** modifier. Eg: \"Deprecate Old Versions:true\" will deprecate older versions of a particular API when it is promoted to Published state from Created state. Multiple checklist items can be given in \"attribute1:true, attribute2:false\" format. Supported checklist items are as follows. 1. **Deprecate Old Versions**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state. 2. **Require Re-Subscription**: If you set this to true, users need to re subscribe to the API although they may have subscribed to an older version. (optional)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("POST /apis/change-lifecycle?action={action}&lifecycleChecklist={lifecycleChecklist}&apiId={apiId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
void apisChangeLifecyclePost(@Param("action") String action, @Param("apiId") String apiId,
|
||||
@Param("lifecycleChecklist") String lifecycleChecklist, @Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Copy API
|
||||
* Create a new API by copying an existing API
|
||||
* @param newVersion Version of the new API. (required)
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. Should be formatted as **provider-name-version**. (required)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("POST /apis/copy-api?newVersion={newVersion}&apiId={apiId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json"
|
||||
})
|
||||
void apisCopyApiPost(@Param("newVersion") String newVersion, @Param("apiId") String apiId);
|
||||
|
||||
/**
|
||||
* Get all APIs
|
||||
* Get a list of available APIs qualifying under a given search condition.
|
||||
* @param limit Maximum size of resource array to return. (optional, default to 25)
|
||||
* @param offset Starting point within the complete list of items qualified. (optional, default to 0)
|
||||
* @param query **Search condition**. You can search in attributes by using an **\"attribute:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". Supported attribute modifiers are [**version, context, status, description, subcontext, doc, provider**] If no advanced attribute modifier has been specified, search will match the given query string against API Name. (optional)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of
|
||||
* the resourec. (optional)
|
||||
* @return APIList
|
||||
*/
|
||||
@RequestLine("GET /apis?limit={limit}&offset={offset}&query={query}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}"
|
||||
})
|
||||
APIList apisGet(@Param("limit") Integer limit, @Param("offset") Integer offset, @Param("query") String query,
|
||||
@Param("accept") String accept, @Param("ifNoneMatch") String ifNoneMatch);
|
||||
|
||||
/**
|
||||
* Create a new API
|
||||
* Create a new API
|
||||
* @param body API object that needs to be added (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @return API
|
||||
*/
|
||||
@RequestLine("POST /apis")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}"
|
||||
})
|
||||
API apisPost(API body, @Param("contentType") String contentType);
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.publisher.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.Application;
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public interface ApplicationsApi {
|
||||
|
||||
|
||||
/**
|
||||
* Get Application
|
||||
* Get application details
|
||||
* @param applicationId **Application Identifier** consisting of the UUID of the Application. (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return Application
|
||||
*/
|
||||
@RequestLine("GET /applications/{applicationId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
Application applicationsApplicationIdGet(@Param("applicationId") String applicationId, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch,
|
||||
@Param("ifModifiedSince") String ifModifiedSince);
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.publisher.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.EnvironmentList;
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public interface EnvironmentsApi {
|
||||
|
||||
|
||||
/**
|
||||
* Get gateway environments
|
||||
* Get a list of gateway environments configured previously.
|
||||
* @param apiId Will return environment list for the provided API. (optional)
|
||||
* @return EnvironmentList
|
||||
*/
|
||||
@RequestLine("GET /environments?apiId={apiId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json"
|
||||
})
|
||||
EnvironmentList environmentsGet(@Param("apiId") String apiId);
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.publisher.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.Subscription;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.SubscriptionList;
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public interface SubscriptionsApi {
|
||||
|
||||
|
||||
/**
|
||||
* Block a subscription
|
||||
* Block a subscription.
|
||||
* @param subscriptionId Subscription Id (required)
|
||||
* @param blockState Subscription block state. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("POST /subscriptions/block-subscription?subscriptionId={subscriptionId}&blockState={blockState}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
void subscriptionsBlockSubscriptionPost(@Param("subscriptionId") String subscriptionId,
|
||||
@Param("blockState") String blockState, @Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Get All Subscriptions
|
||||
* Get subscription list. The API Identifier and corresponding Application Identifier the subscriptions of which are to be returned are passed as parameters.
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. Should be formatted as **provider-name-version**. (required)
|
||||
* @param limit Maximum size of resource array to return. (optional, default to 25)
|
||||
* @param offset Starting point within the complete list of items qualified. (optional, default to 0)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @return SubscriptionList
|
||||
*/
|
||||
@RequestLine("GET /subscriptions?apiId={apiId}&limit={limit}&offset={offset}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}"
|
||||
})
|
||||
SubscriptionList subscriptionsGet(@Param("apiId") String apiId, @Param("limit") Integer limit,
|
||||
@Param("offset") Integer offset, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch);
|
||||
|
||||
/**
|
||||
* Get a Subscription
|
||||
* Get subscription details
|
||||
* @param subscriptionId Subscription Id (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return Subscription
|
||||
*/
|
||||
@RequestLine("GET /subscriptions/{subscriptionId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
Subscription subscriptionsSubscriptionIdGet(@Param("subscriptionId") String subscriptionId,
|
||||
@Param("accept") String accept, @Param("ifNoneMatch") String ifNoneMatch,
|
||||
@Param("ifModifiedSince") String ifModifiedSince);
|
||||
|
||||
/**
|
||||
* Unblock a Subscription
|
||||
* Unblock a subscription.
|
||||
* @param subscriptionId Subscription Id (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("POST /subscriptions/unblock-subscription?subscriptionId={subscriptionId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
void subscriptionsUnblockSubscriptionPost(@Param("subscriptionId") String subscriptionId,
|
||||
@Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
}
|
||||
@ -0,0 +1,163 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.publisher.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.Tier;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.TierList;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.TierPermission;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public interface TiersApi {
|
||||
|
||||
|
||||
/**
|
||||
* List Tiers
|
||||
* Get available tiers
|
||||
* @param tierLevel List API or Application or Resource type tiers. (required)
|
||||
* @param limit Maximum size of resource array to return. (optional, default to 25)
|
||||
* @param offset Starting point within the complete list of items qualified. (optional, default to 0)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @return TierList
|
||||
*/
|
||||
@RequestLine("GET /tiers/{tierLevel}?limit={limit}&offset={offset}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}"
|
||||
})
|
||||
TierList tiersTierLevelGet(@Param("tierLevel") String tierLevel, @Param("limit") Integer limit,
|
||||
@Param("offset") Integer offset, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch);
|
||||
|
||||
/**
|
||||
* Add a new Tier
|
||||
* Add a new tier
|
||||
* @param body Tier object that should to be added (required)
|
||||
* @param tierLevel List API or Application or Resource type tiers. (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @return Tier
|
||||
*/
|
||||
@RequestLine("POST /tiers/{tierLevel}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}"
|
||||
})
|
||||
Tier tiersTierLevelPost(Tier body, @Param("tierLevel") String tierLevel, @Param("contentType") String contentType);
|
||||
|
||||
/**
|
||||
* Delete a Tier
|
||||
* Remove a tier
|
||||
* @param tierName Tier name (required)
|
||||
* @param tierLevel List API or Application or Resource type tiers. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("DELETE /tiers/{tierLevel}/{tierName}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
void tiersTierLevelTierNameDelete(@Param("tierName") String tierName, @Param("tierLevel") String tierLevel,
|
||||
@Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Get a Tier
|
||||
* Get tier details
|
||||
* @param tierName Tier name (required)
|
||||
* @param tierLevel List API or Application or Resource type tiers. (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return Tier
|
||||
*/
|
||||
@RequestLine("GET /tiers/{tierLevel}/{tierName}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
Tier tiersTierLevelTierNameGet(@Param("tierName") String tierName, @Param("tierLevel") String tierLevel,
|
||||
@Param("accept") String accept, @Param("ifNoneMatch") String ifNoneMatch,
|
||||
@Param("ifModifiedSince") String ifModifiedSince);
|
||||
|
||||
/**
|
||||
* Update a Tier
|
||||
* Update tier details
|
||||
* @param tierName Tier name (required)
|
||||
* @param body Tier object that needs to be modified (required)
|
||||
* @param tierLevel List API or Application or Resource type tiers. (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return Tier
|
||||
*/
|
||||
@RequestLine("PUT /tiers/{tierLevel}/{tierName}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}",
|
||||
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
Tier tiersTierLevelTierNamePut(@Param("tierName") String tierName, Tier body, @Param("tierLevel") String tierLevel,
|
||||
@Param("contentType") String contentType, @Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Update Tier Permission
|
||||
* Update tier permission
|
||||
* @param tierName Name of the tier (required)
|
||||
* @param tierLevel List API or Application or Resource type tiers. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @param permissions (optional)
|
||||
* @return List<Tier>
|
||||
*/
|
||||
@RequestLine("POST /tiers/update-permission?tierName={tierName}&tierLevel={tierLevel}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
List<Tier> tiersUpdatePermissionPost(@Param("tierName") String tierName, @Param("tierLevel") String tierLevel,
|
||||
@Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince, TierPermission permissions);
|
||||
}
|
||||
@ -0,0 +1,847 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* API
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class API {
|
||||
@JsonProperty("id")
|
||||
private String id = null;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("description")
|
||||
private String description = null;
|
||||
|
||||
@JsonProperty("context")
|
||||
private String context = null;
|
||||
|
||||
@JsonProperty("version")
|
||||
private String version = null;
|
||||
|
||||
@JsonProperty("provider")
|
||||
private String provider = null;
|
||||
|
||||
@JsonProperty("apiDefinition")
|
||||
private String apiDefinition = null;
|
||||
|
||||
@JsonProperty("wsdlUri")
|
||||
private String wsdlUri = null;
|
||||
|
||||
@JsonProperty("status")
|
||||
private String status = null;
|
||||
|
||||
@JsonProperty("responseCaching")
|
||||
private String responseCaching = null;
|
||||
|
||||
@JsonProperty("cacheTimeout")
|
||||
private Integer cacheTimeout = null;
|
||||
|
||||
@JsonProperty("destinationStatsEnabled")
|
||||
private String destinationStatsEnabled = null;
|
||||
|
||||
@JsonProperty("isDefaultVersion")
|
||||
private Boolean isDefaultVersion = null;
|
||||
|
||||
@JsonProperty("transport")
|
||||
private List<String> transport = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("tags")
|
||||
private List<String> tags = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("tiers")
|
||||
private List<String> tiers = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("maxTps")
|
||||
private APIMaxTps maxTps = null;
|
||||
|
||||
@JsonProperty("thumbnailUri")
|
||||
private String thumbnailUri = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets visibility
|
||||
*/
|
||||
public enum VisibilityEnum {
|
||||
PUBLIC("PUBLIC"),
|
||||
|
||||
PRIVATE("PRIVATE"),
|
||||
|
||||
RESTRICTED("RESTRICTED"),
|
||||
|
||||
CONTROLLED("CONTROLLED");
|
||||
|
||||
private String value;
|
||||
|
||||
VisibilityEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static VisibilityEnum fromValue(String text) {
|
||||
for (VisibilityEnum b : VisibilityEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("visibility")
|
||||
private VisibilityEnum visibility = null;
|
||||
|
||||
@JsonProperty("visibleRoles")
|
||||
private List<String> visibleRoles = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("visibleTenants")
|
||||
private List<String> visibleTenants = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("endpointConfig")
|
||||
private String endpointConfig = null;
|
||||
|
||||
@JsonProperty("endpointSecurity")
|
||||
private APIEndpointSecurity endpointSecurity = null;
|
||||
|
||||
@JsonProperty("gatewayEnvironments")
|
||||
private String gatewayEnvironments = null;
|
||||
|
||||
@JsonProperty("sequences")
|
||||
private List<Sequence> sequences = new ArrayList<Sequence>();
|
||||
|
||||
/**
|
||||
* Gets or Sets subscriptionAvailability
|
||||
*/
|
||||
public enum SubscriptionAvailabilityEnum {
|
||||
current_tenant("current_tenant"),
|
||||
|
||||
all_tenants("all_tenants"),
|
||||
|
||||
specific_tenants("specific_tenants");
|
||||
|
||||
private String value;
|
||||
|
||||
SubscriptionAvailabilityEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static SubscriptionAvailabilityEnum fromValue(String text) {
|
||||
for (SubscriptionAvailabilityEnum b : SubscriptionAvailabilityEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("subscriptionAvailability")
|
||||
private SubscriptionAvailabilityEnum subscriptionAvailability = null;
|
||||
|
||||
@JsonProperty("subscriptionAvailableTenants")
|
||||
private List<String> subscriptionAvailableTenants = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("businessInformation")
|
||||
private APIBusinessInformation businessInformation = null;
|
||||
|
||||
@JsonProperty("corsConfiguration")
|
||||
private APICorsConfiguration corsConfiguration = null;
|
||||
|
||||
public API id(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* UUID of the api registry artifact
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "UUID of the api registry artifact ")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public API name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorAPI", required = true, value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public API description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
* @return description
|
||||
**/
|
||||
@ApiModelProperty(example = "A calculator API that supports basic operations", value = "")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public API context(String context) {
|
||||
this.context = context;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get context
|
||||
* @return context
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorAPI", required = true, value = "")
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(String context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public API version(String version) {
|
||||
this.version = version;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get version
|
||||
* @return version
|
||||
**/
|
||||
@ApiModelProperty(example = "1.0.0", required = true, value = "")
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public API provider(String provider) {
|
||||
this.provider = provider;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the provider value is not given user invoking the api will be used as the provider.
|
||||
* @return provider
|
||||
**/
|
||||
@ApiModelProperty(example = "admin", value = "If the provider value is not given user invoking the api will be used as the provider. ")
|
||||
public String getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
public void setProvider(String provider) {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
public API apiDefinition(String apiDefinition) {
|
||||
this.apiDefinition = apiDefinition;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Swagger definition of the API which contains details about URI templates and scopes
|
||||
* @return apiDefinition
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "Swagger definition of the API which contains details about URI templates and scopes ")
|
||||
public String getApiDefinition() {
|
||||
return apiDefinition;
|
||||
}
|
||||
|
||||
public void setApiDefinition(String apiDefinition) {
|
||||
this.apiDefinition = apiDefinition;
|
||||
}
|
||||
|
||||
public API wsdlUri(String wsdlUri) {
|
||||
this.wsdlUri = wsdlUri;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* WSDL URL if the API is based on a WSDL endpoint
|
||||
* @return wsdlUri
|
||||
**/
|
||||
@ApiModelProperty(example = "http://www.webservicex.com/globalweather.asmx?wsdl", value = "WSDL URL if the API is based on a WSDL endpoint ")
|
||||
public String getWsdlUri() {
|
||||
return wsdlUri;
|
||||
}
|
||||
|
||||
public void setWsdlUri(String wsdlUri) {
|
||||
this.wsdlUri = wsdlUri;
|
||||
}
|
||||
|
||||
public API status(String status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(example = "CREATED", value = "")
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public API responseCaching(String responseCaching) {
|
||||
this.responseCaching = responseCaching;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get responseCaching
|
||||
* @return responseCaching
|
||||
**/
|
||||
@ApiModelProperty(example = "Disabled", value = "")
|
||||
public String getResponseCaching() {
|
||||
return responseCaching;
|
||||
}
|
||||
|
||||
public void setResponseCaching(String responseCaching) {
|
||||
this.responseCaching = responseCaching;
|
||||
}
|
||||
|
||||
public API cacheTimeout(Integer cacheTimeout) {
|
||||
this.cacheTimeout = cacheTimeout;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cacheTimeout
|
||||
* @return cacheTimeout
|
||||
**/
|
||||
@ApiModelProperty(example = "300", value = "")
|
||||
public Integer getCacheTimeout() {
|
||||
return cacheTimeout;
|
||||
}
|
||||
|
||||
public void setCacheTimeout(Integer cacheTimeout) {
|
||||
this.cacheTimeout = cacheTimeout;
|
||||
}
|
||||
|
||||
public API destinationStatsEnabled(String destinationStatsEnabled) {
|
||||
this.destinationStatsEnabled = destinationStatsEnabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get destinationStatsEnabled
|
||||
* @return destinationStatsEnabled
|
||||
**/
|
||||
@ApiModelProperty(example = "Disabled", value = "")
|
||||
public String getDestinationStatsEnabled() {
|
||||
return destinationStatsEnabled;
|
||||
}
|
||||
|
||||
public void setDestinationStatsEnabled(String destinationStatsEnabled) {
|
||||
this.destinationStatsEnabled = destinationStatsEnabled;
|
||||
}
|
||||
|
||||
public API isDefaultVersion(Boolean isDefaultVersion) {
|
||||
this.isDefaultVersion = isDefaultVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isDefaultVersion
|
||||
* @return isDefaultVersion
|
||||
**/
|
||||
@ApiModelProperty(example = "false", required = true, value = "")
|
||||
public Boolean getIsDefaultVersion() {
|
||||
return isDefaultVersion;
|
||||
}
|
||||
|
||||
public void setIsDefaultVersion(Boolean isDefaultVersion) {
|
||||
this.isDefaultVersion = isDefaultVersion;
|
||||
}
|
||||
|
||||
public API transport(List<String> transport) {
|
||||
this.transport = transport;
|
||||
return this;
|
||||
}
|
||||
|
||||
public API addTransportItem(String transportItem) {
|
||||
this.transport.add(transportItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported transports for the API (http and/or https).
|
||||
* @return transport
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "Supported transports for the API (http and/or https). ")
|
||||
public List<String> getTransport() {
|
||||
return transport;
|
||||
}
|
||||
|
||||
public void setTransport(List<String> transport) {
|
||||
this.transport = transport;
|
||||
}
|
||||
|
||||
public API tags(List<String> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
}
|
||||
|
||||
public API addTagsItem(String tagsItem) {
|
||||
this.tags.add(tagsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<String> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(List<String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public API tiers(List<String> tiers) {
|
||||
this.tiers = tiers;
|
||||
return this;
|
||||
}
|
||||
|
||||
public API addTiersItem(String tiersItem) {
|
||||
this.tiers.add(tiersItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tiers
|
||||
* @return tiers
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
public List<String> getTiers() {
|
||||
return tiers;
|
||||
}
|
||||
|
||||
public void setTiers(List<String> tiers) {
|
||||
this.tiers = tiers;
|
||||
}
|
||||
|
||||
public API maxTps(APIMaxTps maxTps) {
|
||||
this.maxTps = maxTps;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get maxTps
|
||||
* @return maxTps
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public APIMaxTps getMaxTps() {
|
||||
return maxTps;
|
||||
}
|
||||
|
||||
public void setMaxTps(APIMaxTps maxTps) {
|
||||
this.maxTps = maxTps;
|
||||
}
|
||||
|
||||
public API thumbnailUri(String thumbnailUri) {
|
||||
this.thumbnailUri = thumbnailUri;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get thumbnailUri
|
||||
* @return thumbnailUri
|
||||
**/
|
||||
@ApiModelProperty(example = "/apis/01234567-0123-0123-0123-012345678901/thumbnail", value = "")
|
||||
public String getThumbnailUri() {
|
||||
return thumbnailUri;
|
||||
}
|
||||
|
||||
public void setThumbnailUri(String thumbnailUri) {
|
||||
this.thumbnailUri = thumbnailUri;
|
||||
}
|
||||
|
||||
public API visibility(VisibilityEnum visibility) {
|
||||
this.visibility = visibility;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get visibility
|
||||
* @return visibility
|
||||
**/
|
||||
@ApiModelProperty(example = "PUBLIC", required = true, value = "")
|
||||
public VisibilityEnum getVisibility() {
|
||||
return visibility;
|
||||
}
|
||||
|
||||
public void setVisibility(VisibilityEnum visibility) {
|
||||
this.visibility = visibility;
|
||||
}
|
||||
|
||||
public API visibleRoles(List<String> visibleRoles) {
|
||||
this.visibleRoles = visibleRoles;
|
||||
return this;
|
||||
}
|
||||
|
||||
public API addVisibleRolesItem(String visibleRolesItem) {
|
||||
this.visibleRoles.add(visibleRolesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get visibleRoles
|
||||
* @return visibleRoles
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<String> getVisibleRoles() {
|
||||
return visibleRoles;
|
||||
}
|
||||
|
||||
public void setVisibleRoles(List<String> visibleRoles) {
|
||||
this.visibleRoles = visibleRoles;
|
||||
}
|
||||
|
||||
public API visibleTenants(List<String> visibleTenants) {
|
||||
this.visibleTenants = visibleTenants;
|
||||
return this;
|
||||
}
|
||||
|
||||
public API addVisibleTenantsItem(String visibleTenantsItem) {
|
||||
this.visibleTenants.add(visibleTenantsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get visibleTenants
|
||||
* @return visibleTenants
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<String> getVisibleTenants() {
|
||||
return visibleTenants;
|
||||
}
|
||||
|
||||
public void setVisibleTenants(List<String> visibleTenants) {
|
||||
this.visibleTenants = visibleTenants;
|
||||
}
|
||||
|
||||
public API endpointConfig(String endpointConfig) {
|
||||
this.endpointConfig = endpointConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get endpointConfig
|
||||
* @return endpointConfig
|
||||
**/
|
||||
@ApiModelProperty(example = "{"production_endpoints":{"url":"http://localhost:9763/am/sample/calculator/v1/api","config":null},"implementation_status":"managed","endpoint_type":"http"}", required = true, value = "")
|
||||
public String getEndpointConfig() {
|
||||
return endpointConfig;
|
||||
}
|
||||
|
||||
public void setEndpointConfig(String endpointConfig) {
|
||||
this.endpointConfig = endpointConfig;
|
||||
}
|
||||
|
||||
public API endpointSecurity(APIEndpointSecurity endpointSecurity) {
|
||||
this.endpointSecurity = endpointSecurity;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get endpointSecurity
|
||||
* @return endpointSecurity
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public APIEndpointSecurity getEndpointSecurity() {
|
||||
return endpointSecurity;
|
||||
}
|
||||
|
||||
public void setEndpointSecurity(APIEndpointSecurity endpointSecurity) {
|
||||
this.endpointSecurity = endpointSecurity;
|
||||
}
|
||||
|
||||
public API gatewayEnvironments(String gatewayEnvironments) {
|
||||
this.gatewayEnvironments = gatewayEnvironments;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Comma separated list of gateway environments.
|
||||
* @return gatewayEnvironments
|
||||
**/
|
||||
@ApiModelProperty(example = "Production and Sandbox", value = "Comma separated list of gateway environments. ")
|
||||
public String getGatewayEnvironments() {
|
||||
return gatewayEnvironments;
|
||||
}
|
||||
|
||||
public void setGatewayEnvironments(String gatewayEnvironments) {
|
||||
this.gatewayEnvironments = gatewayEnvironments;
|
||||
}
|
||||
|
||||
public API sequences(List<Sequence> sequences) {
|
||||
this.sequences = sequences;
|
||||
return this;
|
||||
}
|
||||
|
||||
public API addSequencesItem(Sequence sequencesItem) {
|
||||
this.sequences.add(sequencesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sequences
|
||||
* @return sequences
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<Sequence> getSequences() {
|
||||
return sequences;
|
||||
}
|
||||
|
||||
public void setSequences(List<Sequence> sequences) {
|
||||
this.sequences = sequences;
|
||||
}
|
||||
|
||||
public API subscriptionAvailability(SubscriptionAvailabilityEnum subscriptionAvailability) {
|
||||
this.subscriptionAvailability = subscriptionAvailability;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get subscriptionAvailability
|
||||
* @return subscriptionAvailability
|
||||
**/
|
||||
@ApiModelProperty(example = "current_tenant", value = "")
|
||||
public SubscriptionAvailabilityEnum getSubscriptionAvailability() {
|
||||
return subscriptionAvailability;
|
||||
}
|
||||
|
||||
public void setSubscriptionAvailability(SubscriptionAvailabilityEnum subscriptionAvailability) {
|
||||
this.subscriptionAvailability = subscriptionAvailability;
|
||||
}
|
||||
|
||||
public API subscriptionAvailableTenants(List<String> subscriptionAvailableTenants) {
|
||||
this.subscriptionAvailableTenants = subscriptionAvailableTenants;
|
||||
return this;
|
||||
}
|
||||
|
||||
public API addSubscriptionAvailableTenantsItem(String subscriptionAvailableTenantsItem) {
|
||||
this.subscriptionAvailableTenants.add(subscriptionAvailableTenantsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get subscriptionAvailableTenants
|
||||
* @return subscriptionAvailableTenants
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<String> getSubscriptionAvailableTenants() {
|
||||
return subscriptionAvailableTenants;
|
||||
}
|
||||
|
||||
public void setSubscriptionAvailableTenants(List<String> subscriptionAvailableTenants) {
|
||||
this.subscriptionAvailableTenants = subscriptionAvailableTenants;
|
||||
}
|
||||
|
||||
public API businessInformation(APIBusinessInformation businessInformation) {
|
||||
this.businessInformation = businessInformation;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get businessInformation
|
||||
* @return businessInformation
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public APIBusinessInformation getBusinessInformation() {
|
||||
return businessInformation;
|
||||
}
|
||||
|
||||
public void setBusinessInformation(APIBusinessInformation businessInformation) {
|
||||
this.businessInformation = businessInformation;
|
||||
}
|
||||
|
||||
public API corsConfiguration(APICorsConfiguration corsConfiguration) {
|
||||
this.corsConfiguration = corsConfiguration;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get corsConfiguration
|
||||
* @return corsConfiguration
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public APICorsConfiguration getCorsConfiguration() {
|
||||
return corsConfiguration;
|
||||
}
|
||||
|
||||
public void setCorsConfiguration(APICorsConfiguration corsConfiguration) {
|
||||
this.corsConfiguration = corsConfiguration;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
API API = (org.wso2.carbon.apimgt.integration.client.publisher.model.API) o;
|
||||
return Objects.equals(this.id, API.id) &&
|
||||
Objects.equals(this.name, API.name) &&
|
||||
Objects.equals(this.description, API.description) &&
|
||||
Objects.equals(this.context, API.context) &&
|
||||
Objects.equals(this.version, API.version) &&
|
||||
Objects.equals(this.provider, API.provider) &&
|
||||
Objects.equals(this.apiDefinition, API.apiDefinition) &&
|
||||
Objects.equals(this.wsdlUri, API.wsdlUri) &&
|
||||
Objects.equals(this.status, API.status) &&
|
||||
Objects.equals(this.responseCaching, API.responseCaching) &&
|
||||
Objects.equals(this.cacheTimeout, API.cacheTimeout) &&
|
||||
Objects.equals(this.destinationStatsEnabled, API.destinationStatsEnabled) &&
|
||||
Objects.equals(this.isDefaultVersion, API.isDefaultVersion) &&
|
||||
Objects.equals(this.transport, API.transport) &&
|
||||
Objects.equals(this.tags, API.tags) &&
|
||||
Objects.equals(this.tiers, API.tiers) &&
|
||||
Objects.equals(this.maxTps, API.maxTps) &&
|
||||
Objects.equals(this.thumbnailUri, API.thumbnailUri) &&
|
||||
Objects.equals(this.visibility, API.visibility) &&
|
||||
Objects.equals(this.visibleRoles, API.visibleRoles) &&
|
||||
Objects.equals(this.visibleTenants, API.visibleTenants) &&
|
||||
Objects.equals(this.endpointConfig, API.endpointConfig) &&
|
||||
Objects.equals(this.endpointSecurity, API.endpointSecurity) &&
|
||||
Objects.equals(this.gatewayEnvironments, API.gatewayEnvironments) &&
|
||||
Objects.equals(this.sequences, API.sequences) &&
|
||||
Objects.equals(this.subscriptionAvailability, API.subscriptionAvailability) &&
|
||||
Objects.equals(this.subscriptionAvailableTenants, API.subscriptionAvailableTenants) &&
|
||||
Objects.equals(this.businessInformation, API.businessInformation) &&
|
||||
Objects.equals(this.corsConfiguration, API.corsConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, description, context, version, provider, apiDefinition, wsdlUri, status, responseCaching, cacheTimeout, destinationStatsEnabled, isDefaultVersion, transport, tags, tiers, maxTps, thumbnailUri, visibility, visibleRoles, visibleTenants, endpointConfig, endpointSecurity, gatewayEnvironments, sequences, subscriptionAvailability, subscriptionAvailableTenants, businessInformation, corsConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class API {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" context: ").append(toIndentedString(context)).append("\n");
|
||||
sb.append(" version: ").append(toIndentedString(version)).append("\n");
|
||||
sb.append(" provider: ").append(toIndentedString(provider)).append("\n");
|
||||
sb.append(" apiDefinition: ").append(toIndentedString(apiDefinition)).append("\n");
|
||||
sb.append(" wsdlUri: ").append(toIndentedString(wsdlUri)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" responseCaching: ").append(toIndentedString(responseCaching)).append("\n");
|
||||
sb.append(" cacheTimeout: ").append(toIndentedString(cacheTimeout)).append("\n");
|
||||
sb.append(" destinationStatsEnabled: ").append(toIndentedString(destinationStatsEnabled)).append("\n");
|
||||
sb.append(" isDefaultVersion: ").append(toIndentedString(isDefaultVersion)).append("\n");
|
||||
sb.append(" transport: ").append(toIndentedString(transport)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" tiers: ").append(toIndentedString(tiers)).append("\n");
|
||||
sb.append(" maxTps: ").append(toIndentedString(maxTps)).append("\n");
|
||||
sb.append(" thumbnailUri: ").append(toIndentedString(thumbnailUri)).append("\n");
|
||||
sb.append(" visibility: ").append(toIndentedString(visibility)).append("\n");
|
||||
sb.append(" visibleRoles: ").append(toIndentedString(visibleRoles)).append("\n");
|
||||
sb.append(" visibleTenants: ").append(toIndentedString(visibleTenants)).append("\n");
|
||||
sb.append(" endpointConfig: ").append(toIndentedString(endpointConfig)).append("\n");
|
||||
sb.append(" endpointSecurity: ").append(toIndentedString(endpointSecurity)).append("\n");
|
||||
sb.append(" gatewayEnvironments: ").append(toIndentedString(gatewayEnvironments)).append("\n");
|
||||
sb.append(" sequences: ").append(toIndentedString(sequences)).append("\n");
|
||||
sb.append(" subscriptionAvailability: ").append(toIndentedString(subscriptionAvailability)).append("\n");
|
||||
sb.append(" subscriptionAvailableTenants: ").append(toIndentedString(subscriptionAvailableTenants)).append("\n");
|
||||
sb.append(" businessInformation: ").append(toIndentedString(businessInformation)).append("\n");
|
||||
sb.append(" corsConfiguration: ").append(toIndentedString(corsConfiguration)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,168 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* APIBusinessInformation
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class APIBusinessInformation {
|
||||
@JsonProperty("businessOwner")
|
||||
private String businessOwner = null;
|
||||
|
||||
@JsonProperty("businessOwnerEmail")
|
||||
private String businessOwnerEmail = null;
|
||||
|
||||
@JsonProperty("technicalOwner")
|
||||
private String technicalOwner = null;
|
||||
|
||||
@JsonProperty("technicalOwnerEmail")
|
||||
private String technicalOwnerEmail = null;
|
||||
|
||||
public APIBusinessInformation businessOwner(String businessOwner) {
|
||||
this.businessOwner = businessOwner;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get businessOwner
|
||||
* @return businessOwner
|
||||
**/
|
||||
@ApiModelProperty(example = "businessowner", value = "")
|
||||
public String getBusinessOwner() {
|
||||
return businessOwner;
|
||||
}
|
||||
|
||||
public void setBusinessOwner(String businessOwner) {
|
||||
this.businessOwner = businessOwner;
|
||||
}
|
||||
|
||||
public APIBusinessInformation businessOwnerEmail(String businessOwnerEmail) {
|
||||
this.businessOwnerEmail = businessOwnerEmail;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get businessOwnerEmail
|
||||
* @return businessOwnerEmail
|
||||
**/
|
||||
@ApiModelProperty(example = "businessowner@wso2.com", value = "")
|
||||
public String getBusinessOwnerEmail() {
|
||||
return businessOwnerEmail;
|
||||
}
|
||||
|
||||
public void setBusinessOwnerEmail(String businessOwnerEmail) {
|
||||
this.businessOwnerEmail = businessOwnerEmail;
|
||||
}
|
||||
|
||||
public APIBusinessInformation technicalOwner(String technicalOwner) {
|
||||
this.technicalOwner = technicalOwner;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get technicalOwner
|
||||
* @return technicalOwner
|
||||
**/
|
||||
@ApiModelProperty(example = "technicalowner", value = "")
|
||||
public String getTechnicalOwner() {
|
||||
return technicalOwner;
|
||||
}
|
||||
|
||||
public void setTechnicalOwner(String technicalOwner) {
|
||||
this.technicalOwner = technicalOwner;
|
||||
}
|
||||
|
||||
public APIBusinessInformation technicalOwnerEmail(String technicalOwnerEmail) {
|
||||
this.technicalOwnerEmail = technicalOwnerEmail;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get technicalOwnerEmail
|
||||
* @return technicalOwnerEmail
|
||||
**/
|
||||
@ApiModelProperty(example = "technicalowner@wso2.com", value = "")
|
||||
public String getTechnicalOwnerEmail() {
|
||||
return technicalOwnerEmail;
|
||||
}
|
||||
|
||||
public void setTechnicalOwnerEmail(String technicalOwnerEmail) {
|
||||
this.technicalOwnerEmail = technicalOwnerEmail;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
APIBusinessInformation aPIBusinessInformation = (APIBusinessInformation) o;
|
||||
return Objects.equals(this.businessOwner, aPIBusinessInformation.businessOwner) &&
|
||||
Objects.equals(this.businessOwnerEmail, aPIBusinessInformation.businessOwnerEmail) &&
|
||||
Objects.equals(this.technicalOwner, aPIBusinessInformation.technicalOwner) &&
|
||||
Objects.equals(this.technicalOwnerEmail, aPIBusinessInformation.technicalOwnerEmail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(businessOwner, businessOwnerEmail, technicalOwner, technicalOwnerEmail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class APIBusinessInformation {\n");
|
||||
|
||||
sb.append(" businessOwner: ").append(toIndentedString(businessOwner)).append("\n");
|
||||
sb.append(" businessOwnerEmail: ").append(toIndentedString(businessOwnerEmail)).append("\n");
|
||||
sb.append(" technicalOwner: ").append(toIndentedString(technicalOwner)).append("\n");
|
||||
sb.append(" technicalOwnerEmail: ").append(toIndentedString(technicalOwnerEmail)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,210 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* CORS configuration for the API
|
||||
*/
|
||||
@ApiModel(description = "CORS configuration for the API ")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class APICorsConfiguration {
|
||||
@JsonProperty("corsConfigurationEnabled")
|
||||
private Boolean corsConfigurationEnabled = false;
|
||||
|
||||
@JsonProperty("accessControlAllowOrigins")
|
||||
private List<String> accessControlAllowOrigins = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("accessControlAllowCredentials")
|
||||
private Boolean accessControlAllowCredentials = false;
|
||||
|
||||
@JsonProperty("accessControlAllowHeaders")
|
||||
private List<String> accessControlAllowHeaders = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("accessControlAllowMethods")
|
||||
private List<String> accessControlAllowMethods = new ArrayList<String>();
|
||||
|
||||
public APICorsConfiguration corsConfigurationEnabled(Boolean corsConfigurationEnabled) {
|
||||
this.corsConfigurationEnabled = corsConfigurationEnabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get corsConfigurationEnabled
|
||||
* @return corsConfigurationEnabled
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public Boolean getCorsConfigurationEnabled() {
|
||||
return corsConfigurationEnabled;
|
||||
}
|
||||
|
||||
public void setCorsConfigurationEnabled(Boolean corsConfigurationEnabled) {
|
||||
this.corsConfigurationEnabled = corsConfigurationEnabled;
|
||||
}
|
||||
|
||||
public APICorsConfiguration accessControlAllowOrigins(List<String> accessControlAllowOrigins) {
|
||||
this.accessControlAllowOrigins = accessControlAllowOrigins;
|
||||
return this;
|
||||
}
|
||||
|
||||
public APICorsConfiguration addAccessControlAllowOriginsItem(String accessControlAllowOriginsItem) {
|
||||
this.accessControlAllowOrigins.add(accessControlAllowOriginsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get accessControlAllowOrigins
|
||||
* @return accessControlAllowOrigins
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<String> getAccessControlAllowOrigins() {
|
||||
return accessControlAllowOrigins;
|
||||
}
|
||||
|
||||
public void setAccessControlAllowOrigins(List<String> accessControlAllowOrigins) {
|
||||
this.accessControlAllowOrigins = accessControlAllowOrigins;
|
||||
}
|
||||
|
||||
public APICorsConfiguration accessControlAllowCredentials(Boolean accessControlAllowCredentials) {
|
||||
this.accessControlAllowCredentials = accessControlAllowCredentials;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get accessControlAllowCredentials
|
||||
* @return accessControlAllowCredentials
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public Boolean getAccessControlAllowCredentials() {
|
||||
return accessControlAllowCredentials;
|
||||
}
|
||||
|
||||
public void setAccessControlAllowCredentials(Boolean accessControlAllowCredentials) {
|
||||
this.accessControlAllowCredentials = accessControlAllowCredentials;
|
||||
}
|
||||
|
||||
public APICorsConfiguration accessControlAllowHeaders(List<String> accessControlAllowHeaders) {
|
||||
this.accessControlAllowHeaders = accessControlAllowHeaders;
|
||||
return this;
|
||||
}
|
||||
|
||||
public APICorsConfiguration addAccessControlAllowHeadersItem(String accessControlAllowHeadersItem) {
|
||||
this.accessControlAllowHeaders.add(accessControlAllowHeadersItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get accessControlAllowHeaders
|
||||
* @return accessControlAllowHeaders
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<String> getAccessControlAllowHeaders() {
|
||||
return accessControlAllowHeaders;
|
||||
}
|
||||
|
||||
public void setAccessControlAllowHeaders(List<String> accessControlAllowHeaders) {
|
||||
this.accessControlAllowHeaders = accessControlAllowHeaders;
|
||||
}
|
||||
|
||||
public APICorsConfiguration accessControlAllowMethods(List<String> accessControlAllowMethods) {
|
||||
this.accessControlAllowMethods = accessControlAllowMethods;
|
||||
return this;
|
||||
}
|
||||
|
||||
public APICorsConfiguration addAccessControlAllowMethodsItem(String accessControlAllowMethodsItem) {
|
||||
this.accessControlAllowMethods.add(accessControlAllowMethodsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get accessControlAllowMethods
|
||||
* @return accessControlAllowMethods
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<String> getAccessControlAllowMethods() {
|
||||
return accessControlAllowMethods;
|
||||
}
|
||||
|
||||
public void setAccessControlAllowMethods(List<String> accessControlAllowMethods) {
|
||||
this.accessControlAllowMethods = accessControlAllowMethods;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
APICorsConfiguration aPICorsConfiguration = (APICorsConfiguration) o;
|
||||
return Objects.equals(this.corsConfigurationEnabled, aPICorsConfiguration.corsConfigurationEnabled) &&
|
||||
Objects.equals(this.accessControlAllowOrigins, aPICorsConfiguration.accessControlAllowOrigins) &&
|
||||
Objects.equals(this.accessControlAllowCredentials, aPICorsConfiguration.accessControlAllowCredentials) &&
|
||||
Objects.equals(this.accessControlAllowHeaders, aPICorsConfiguration.accessControlAllowHeaders) &&
|
||||
Objects.equals(this.accessControlAllowMethods, aPICorsConfiguration.accessControlAllowMethods);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(corsConfigurationEnabled, accessControlAllowOrigins, accessControlAllowCredentials, accessControlAllowHeaders, accessControlAllowMethods);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class APICorsConfiguration {\n");
|
||||
|
||||
sb.append(" corsConfigurationEnabled: ").append(toIndentedString(corsConfigurationEnabled)).append("\n");
|
||||
sb.append(" accessControlAllowOrigins: ").append(toIndentedString(accessControlAllowOrigins)).append("\n");
|
||||
sb.append(" accessControlAllowCredentials: ").append(toIndentedString(accessControlAllowCredentials)).append("\n");
|
||||
sb.append(" accessControlAllowHeaders: ").append(toIndentedString(accessControlAllowHeaders)).append("\n");
|
||||
sb.append(" accessControlAllowMethods: ").append(toIndentedString(accessControlAllowMethods)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,176 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* APIEndpointSecurity
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class APIEndpointSecurity {
|
||||
/**
|
||||
* Gets or Sets type
|
||||
*/
|
||||
public enum TypeEnum {
|
||||
BASIC("basic"),
|
||||
|
||||
DIGEST("digest");
|
||||
|
||||
private String value;
|
||||
|
||||
TypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static TypeEnum fromValue(String text) {
|
||||
for (TypeEnum b : TypeEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("type")
|
||||
private TypeEnum type = null;
|
||||
|
||||
@JsonProperty("username")
|
||||
private String username = null;
|
||||
|
||||
@JsonProperty("password")
|
||||
private String password = null;
|
||||
|
||||
public APIEndpointSecurity type(TypeEnum type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
**/
|
||||
@ApiModelProperty(example = "basic", value = "")
|
||||
public TypeEnum getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(TypeEnum type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public APIEndpointSecurity username(String username) {
|
||||
this.username = username;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get username
|
||||
* @return username
|
||||
**/
|
||||
@ApiModelProperty(example = "admin", value = "")
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public APIEndpointSecurity password(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get password
|
||||
* @return password
|
||||
**/
|
||||
@ApiModelProperty(example = "password", value = "")
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
APIEndpointSecurity aPIEndpointSecurity = (APIEndpointSecurity) o;
|
||||
return Objects.equals(this.type, aPIEndpointSecurity.type) &&
|
||||
Objects.equals(this.username, aPIEndpointSecurity.username) &&
|
||||
Objects.equals(this.password, aPIEndpointSecurity.password);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(type, username, password);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class APIEndpointSecurity {\n");
|
||||
|
||||
sb.append(" type: ").append(toIndentedString(type)).append("\n");
|
||||
sb.append(" username: ").append(toIndentedString(username)).append("\n");
|
||||
sb.append(" password: ").append(toIndentedString(password)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,237 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* APIInfo
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class APIInfo {
|
||||
@JsonProperty("id")
|
||||
private String id = null;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("description")
|
||||
private String description = null;
|
||||
|
||||
@JsonProperty("context")
|
||||
private String context = null;
|
||||
|
||||
@JsonProperty("version")
|
||||
private String version = null;
|
||||
|
||||
@JsonProperty("provider")
|
||||
private String provider = null;
|
||||
|
||||
@JsonProperty("status")
|
||||
private String status = null;
|
||||
|
||||
public APIInfo id(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public APIInfo name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorAPI", value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public APIInfo description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
* @return description
|
||||
**/
|
||||
@ApiModelProperty(example = "A calculator API that supports basic operations", value = "")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public APIInfo context(String context) {
|
||||
this.context = context;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get context
|
||||
* @return context
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorAPI", value = "")
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(String context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public APIInfo version(String version) {
|
||||
this.version = version;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get version
|
||||
* @return version
|
||||
**/
|
||||
@ApiModelProperty(example = "1.0.0", value = "")
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public APIInfo provider(String provider) {
|
||||
this.provider = provider;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the provider value is not given, the user invoking the API will be used as the provider.
|
||||
* @return provider
|
||||
**/
|
||||
@ApiModelProperty(example = "admin", value = "If the provider value is not given, the user invoking the API will be used as the provider. ")
|
||||
public String getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
public void setProvider(String provider) {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
public APIInfo status(String status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(example = "CREATED", value = "")
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
APIInfo aPIInfo = (APIInfo) o;
|
||||
return Objects.equals(this.id, aPIInfo.id) &&
|
||||
Objects.equals(this.name, aPIInfo.name) &&
|
||||
Objects.equals(this.description, aPIInfo.description) &&
|
||||
Objects.equals(this.context, aPIInfo.context) &&
|
||||
Objects.equals(this.version, aPIInfo.version) &&
|
||||
Objects.equals(this.provider, aPIInfo.provider) &&
|
||||
Objects.equals(this.status, aPIInfo.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, description, context, version, provider, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class APIInfo {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" context: ").append(toIndentedString(context)).append("\n");
|
||||
sb.append(" version: ").append(toIndentedString(version)).append("\n");
|
||||
sb.append(" provider: ").append(toIndentedString(provider)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* APIList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class APIList {
|
||||
@JsonProperty("count")
|
||||
private Integer count = null;
|
||||
|
||||
@JsonProperty("next")
|
||||
private String next = null;
|
||||
|
||||
@JsonProperty("previous")
|
||||
private String previous = null;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<APIInfo> list = new ArrayList<APIInfo>();
|
||||
|
||||
public APIList count(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of APIs returned.
|
||||
* @return count
|
||||
**/
|
||||
@ApiModelProperty(example = "1", value = "Number of APIs returned. ")
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public APIList next(String next) {
|
||||
this.next = next;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the next subset of resources qualified. Empty if no more resources are to be returned.
|
||||
* @return next
|
||||
**/
|
||||
@ApiModelProperty(example = "/apis?limit=1&offset=2&query=", value = "Link to the next subset of resources qualified. Empty if no more resources are to be returned. ")
|
||||
public String getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(String next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public APIList previous(String previous) {
|
||||
this.previous = previous;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the previous subset of resources qualified. Empty if current subset is the first subset returned.
|
||||
* @return previous
|
||||
**/
|
||||
@ApiModelProperty(example = "/apis?limit=1&offset=0&query=", value = "Link to the previous subset of resources qualified. Empty if current subset is the first subset returned. ")
|
||||
public String getPrevious() {
|
||||
return previous;
|
||||
}
|
||||
|
||||
public void setPrevious(String previous) {
|
||||
this.previous = previous;
|
||||
}
|
||||
|
||||
public APIList list(List<APIInfo> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public APIList addListItem(APIInfo listItem) {
|
||||
this.list.add(listItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
* @return list
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<APIInfo> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<APIInfo> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
APIList aPIList = (APIList) o;
|
||||
return Objects.equals(this.count, aPIList.count) &&
|
||||
Objects.equals(this.next, aPIList.next) &&
|
||||
Objects.equals(this.previous, aPIList.previous) &&
|
||||
Objects.equals(this.list, aPIList.list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(count, next, previous, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class APIList {\n");
|
||||
|
||||
sb.append(" count: ").append(toIndentedString(count)).append("\n");
|
||||
sb.append(" next: ").append(toIndentedString(next)).append("\n");
|
||||
sb.append(" previous: ").append(toIndentedString(previous)).append("\n");
|
||||
sb.append(" list: ").append(toIndentedString(list)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* APIMaxTps
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class APIMaxTps {
|
||||
@JsonProperty("production")
|
||||
private Long production = null;
|
||||
|
||||
@JsonProperty("sandbox")
|
||||
private Long sandbox = null;
|
||||
|
||||
public APIMaxTps production(Long production) {
|
||||
this.production = production;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get production
|
||||
* @return production
|
||||
**/
|
||||
@ApiModelProperty(example = "1000", value = "")
|
||||
public Long getProduction() {
|
||||
return production;
|
||||
}
|
||||
|
||||
public void setProduction(Long production) {
|
||||
this.production = production;
|
||||
}
|
||||
|
||||
public APIMaxTps sandbox(Long sandbox) {
|
||||
this.sandbox = sandbox;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sandbox
|
||||
* @return sandbox
|
||||
**/
|
||||
@ApiModelProperty(example = "1000", value = "")
|
||||
public Long getSandbox() {
|
||||
return sandbox;
|
||||
}
|
||||
|
||||
public void setSandbox(Long sandbox) {
|
||||
this.sandbox = sandbox;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
APIMaxTps aPIMaxTps = (APIMaxTps) o;
|
||||
return Objects.equals(this.production, aPIMaxTps.production) &&
|
||||
Objects.equals(this.sandbox, aPIMaxTps.sandbox);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(production, sandbox);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class APIMaxTps {\n");
|
||||
|
||||
sb.append(" production: ").append(toIndentedString(production)).append("\n");
|
||||
sb.append(" sandbox: ").append(toIndentedString(sandbox)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,214 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Application
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class Application {
|
||||
@JsonProperty("applicationId")
|
||||
private String applicationId = null;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("subscriber")
|
||||
private String subscriber = null;
|
||||
|
||||
@JsonProperty("throttlingTier")
|
||||
private String throttlingTier = null;
|
||||
|
||||
@JsonProperty("description")
|
||||
private String description = null;
|
||||
|
||||
@JsonProperty("groupId")
|
||||
private String groupId = null;
|
||||
|
||||
public Application applicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get applicationId
|
||||
* @return applicationId
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "")
|
||||
public String getApplicationId() {
|
||||
return applicationId;
|
||||
}
|
||||
|
||||
public void setApplicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
}
|
||||
|
||||
public Application name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorApp", required = true, value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Application subscriber(String subscriber) {
|
||||
this.subscriber = subscriber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get subscriber
|
||||
* @return subscriber
|
||||
**/
|
||||
@ApiModelProperty(example = "admin", value = "")
|
||||
public String getSubscriber() {
|
||||
return subscriber;
|
||||
}
|
||||
|
||||
public void setSubscriber(String subscriber) {
|
||||
this.subscriber = subscriber;
|
||||
}
|
||||
|
||||
public Application throttlingTier(String throttlingTier) {
|
||||
this.throttlingTier = throttlingTier;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get throttlingTier
|
||||
* @return throttlingTier
|
||||
**/
|
||||
@ApiModelProperty(example = "Unlimited", required = true, value = "")
|
||||
public String getThrottlingTier() {
|
||||
return throttlingTier;
|
||||
}
|
||||
|
||||
public void setThrottlingTier(String throttlingTier) {
|
||||
this.throttlingTier = throttlingTier;
|
||||
}
|
||||
|
||||
public Application description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
* @return description
|
||||
**/
|
||||
@ApiModelProperty(example = "Sample calculator application", value = "")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Application groupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get groupId
|
||||
* @return groupId
|
||||
**/
|
||||
@ApiModelProperty(example = "", value = "")
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Application application = (Application) o;
|
||||
return Objects.equals(this.applicationId, application.applicationId) &&
|
||||
Objects.equals(this.name, application.name) &&
|
||||
Objects.equals(this.subscriber, application.subscriber) &&
|
||||
Objects.equals(this.throttlingTier, application.throttlingTier) &&
|
||||
Objects.equals(this.description, application.description) &&
|
||||
Objects.equals(this.groupId, application.groupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(applicationId, name, subscriber, throttlingTier, description, groupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Application {\n");
|
||||
|
||||
sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" subscriber: ").append(toIndentedString(subscriber)).append("\n");
|
||||
sb.append(" throttlingTier: ").append(toIndentedString(throttlingTier)).append("\n");
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" groupId: ").append(toIndentedString(groupId)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,365 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Document
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class Document {
|
||||
@JsonProperty("documentId")
|
||||
private String documentId = null;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets type
|
||||
*/
|
||||
public enum TypeEnum {
|
||||
HOWTO("HOWTO"),
|
||||
|
||||
SAMPLES("SAMPLES"),
|
||||
|
||||
PUBLIC_FORUM("PUBLIC_FORUM"),
|
||||
|
||||
SUPPORT_FORUM("SUPPORT_FORUM"),
|
||||
|
||||
API_MESSAGE_FORMAT("API_MESSAGE_FORMAT"),
|
||||
|
||||
SWAGGER_DOC("SWAGGER_DOC"),
|
||||
|
||||
OTHER("OTHER");
|
||||
|
||||
private String value;
|
||||
|
||||
TypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static TypeEnum fromValue(String text) {
|
||||
for (TypeEnum b : TypeEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("type")
|
||||
private TypeEnum type = null;
|
||||
|
||||
@JsonProperty("summary")
|
||||
private String summary = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets sourceType
|
||||
*/
|
||||
public enum SourceTypeEnum {
|
||||
INLINE("INLINE"),
|
||||
|
||||
URL("URL"),
|
||||
|
||||
FILE("FILE");
|
||||
|
||||
private String value;
|
||||
|
||||
SourceTypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static SourceTypeEnum fromValue(String text) {
|
||||
for (SourceTypeEnum b : SourceTypeEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("sourceType")
|
||||
private SourceTypeEnum sourceType = null;
|
||||
|
||||
@JsonProperty("sourceUrl")
|
||||
private String sourceUrl = null;
|
||||
|
||||
@JsonProperty("otherTypeName")
|
||||
private String otherTypeName = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets visibility
|
||||
*/
|
||||
public enum VisibilityEnum {
|
||||
OWNER_ONLY("OWNER_ONLY"),
|
||||
|
||||
PRIVATE("PRIVATE"),
|
||||
|
||||
API_LEVEL("API_LEVEL");
|
||||
|
||||
private String value;
|
||||
|
||||
VisibilityEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static VisibilityEnum fromValue(String text) {
|
||||
for (VisibilityEnum b : VisibilityEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("visibility")
|
||||
private VisibilityEnum visibility = null;
|
||||
|
||||
public Document documentId(String documentId) {
|
||||
this.documentId = documentId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get documentId
|
||||
* @return documentId
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "")
|
||||
public String getDocumentId() {
|
||||
return documentId;
|
||||
}
|
||||
|
||||
public void setDocumentId(String documentId) {
|
||||
this.documentId = documentId;
|
||||
}
|
||||
|
||||
public Document name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorDoc", required = true, value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Document type(TypeEnum type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
**/
|
||||
@ApiModelProperty(example = "HOWTO", required = true, value = "")
|
||||
public TypeEnum getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(TypeEnum type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Document summary(String summary) {
|
||||
this.summary = summary;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get summary
|
||||
* @return summary
|
||||
**/
|
||||
@ApiModelProperty(example = "Summary of Calculator Documentation", value = "")
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public Document sourceType(SourceTypeEnum sourceType) {
|
||||
this.sourceType = sourceType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sourceType
|
||||
* @return sourceType
|
||||
**/
|
||||
@ApiModelProperty(example = "INLINE", required = true, value = "")
|
||||
public SourceTypeEnum getSourceType() {
|
||||
return sourceType;
|
||||
}
|
||||
|
||||
public void setSourceType(SourceTypeEnum sourceType) {
|
||||
this.sourceType = sourceType;
|
||||
}
|
||||
|
||||
public Document sourceUrl(String sourceUrl) {
|
||||
this.sourceUrl = sourceUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sourceUrl
|
||||
* @return sourceUrl
|
||||
**/
|
||||
@ApiModelProperty(example = "", value = "")
|
||||
public String getSourceUrl() {
|
||||
return sourceUrl;
|
||||
}
|
||||
|
||||
public void setSourceUrl(String sourceUrl) {
|
||||
this.sourceUrl = sourceUrl;
|
||||
}
|
||||
|
||||
public Document otherTypeName(String otherTypeName) {
|
||||
this.otherTypeName = otherTypeName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get otherTypeName
|
||||
* @return otherTypeName
|
||||
**/
|
||||
@ApiModelProperty(example = "", value = "")
|
||||
public String getOtherTypeName() {
|
||||
return otherTypeName;
|
||||
}
|
||||
|
||||
public void setOtherTypeName(String otherTypeName) {
|
||||
this.otherTypeName = otherTypeName;
|
||||
}
|
||||
|
||||
public Document visibility(VisibilityEnum visibility) {
|
||||
this.visibility = visibility;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get visibility
|
||||
* @return visibility
|
||||
**/
|
||||
@ApiModelProperty(example = "API_LEVEL", required = true, value = "")
|
||||
public VisibilityEnum getVisibility() {
|
||||
return visibility;
|
||||
}
|
||||
|
||||
public void setVisibility(VisibilityEnum visibility) {
|
||||
this.visibility = visibility;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Document document = (Document) o;
|
||||
return Objects.equals(this.documentId, document.documentId) &&
|
||||
Objects.equals(this.name, document.name) &&
|
||||
Objects.equals(this.type, document.type) &&
|
||||
Objects.equals(this.summary, document.summary) &&
|
||||
Objects.equals(this.sourceType, document.sourceType) &&
|
||||
Objects.equals(this.sourceUrl, document.sourceUrl) &&
|
||||
Objects.equals(this.otherTypeName, document.otherTypeName) &&
|
||||
Objects.equals(this.visibility, document.visibility);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(documentId, name, type, summary, sourceType, sourceUrl, otherTypeName, visibility);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Document {\n");
|
||||
|
||||
sb.append(" documentId: ").append(toIndentedString(documentId)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" type: ").append(toIndentedString(type)).append("\n");
|
||||
sb.append(" summary: ").append(toIndentedString(summary)).append("\n");
|
||||
sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n");
|
||||
sb.append(" sourceUrl: ").append(toIndentedString(sourceUrl)).append("\n");
|
||||
sb.append(" otherTypeName: ").append(toIndentedString(otherTypeName)).append("\n");
|
||||
sb.append(" visibility: ").append(toIndentedString(visibility)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* DocumentList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class DocumentList {
|
||||
@JsonProperty("count")
|
||||
private Integer count = null;
|
||||
|
||||
@JsonProperty("next")
|
||||
private String next = null;
|
||||
|
||||
@JsonProperty("previous")
|
||||
private String previous = null;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<Document> list = new ArrayList<Document>();
|
||||
|
||||
public DocumentList count(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of Documents returned.
|
||||
* @return count
|
||||
**/
|
||||
@ApiModelProperty(example = "1", value = "Number of Documents returned. ")
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public DocumentList next(String next) {
|
||||
this.next = next;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the next subset of resources qualified. Empty if no more resources are to be returned.
|
||||
* @return next
|
||||
**/
|
||||
@ApiModelProperty(example = "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=2", value = "Link to the next subset of resources qualified. Empty if no more resources are to be returned. ")
|
||||
public String getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(String next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public DocumentList previous(String previous) {
|
||||
this.previous = previous;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the previous subset of resources qualified. Empty if current subset is the first subset returned.
|
||||
* @return previous
|
||||
**/
|
||||
@ApiModelProperty(example = "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=0", value = "Link to the previous subset of resources qualified. Empty if current subset is the first subset returned. ")
|
||||
public String getPrevious() {
|
||||
return previous;
|
||||
}
|
||||
|
||||
public void setPrevious(String previous) {
|
||||
this.previous = previous;
|
||||
}
|
||||
|
||||
public DocumentList list(List<Document> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DocumentList addListItem(Document listItem) {
|
||||
this.list.add(listItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
* @return list
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<Document> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<Document> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DocumentList documentList = (DocumentList) o;
|
||||
return Objects.equals(this.count, documentList.count) &&
|
||||
Objects.equals(this.next, documentList.next) &&
|
||||
Objects.equals(this.previous, documentList.previous) &&
|
||||
Objects.equals(this.list, documentList.list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(count, next, previous, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DocumentList {\n");
|
||||
|
||||
sb.append(" count: ").append(toIndentedString(count)).append("\n");
|
||||
sb.append(" next: ").append(toIndentedString(next)).append("\n");
|
||||
sb.append(" previous: ").append(toIndentedString(previous)).append("\n");
|
||||
sb.append(" list: ").append(toIndentedString(list)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,191 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Environment
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class Environment {
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("type")
|
||||
private String type = null;
|
||||
|
||||
@JsonProperty("serverUrl")
|
||||
private String serverUrl = null;
|
||||
|
||||
@JsonProperty("showInApiConsole")
|
||||
private Boolean showInApiConsole = null;
|
||||
|
||||
@JsonProperty("endpoints")
|
||||
private EnvironmentEndpoints endpoints = null;
|
||||
|
||||
public Environment name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "Production and Sandbox", required = true, value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Environment type(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
**/
|
||||
@ApiModelProperty(example = "hybrid", required = true, value = "")
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Environment serverUrl(String serverUrl) {
|
||||
this.serverUrl = serverUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get serverUrl
|
||||
* @return serverUrl
|
||||
**/
|
||||
@ApiModelProperty(example = "https://localhost:9443//services/", required = true, value = "")
|
||||
public String getServerUrl() {
|
||||
return serverUrl;
|
||||
}
|
||||
|
||||
public void setServerUrl(String serverUrl) {
|
||||
this.serverUrl = serverUrl;
|
||||
}
|
||||
|
||||
public Environment showInApiConsole(Boolean showInApiConsole) {
|
||||
this.showInApiConsole = showInApiConsole;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get showInApiConsole
|
||||
* @return showInApiConsole
|
||||
**/
|
||||
@ApiModelProperty(example = "true", required = true, value = "")
|
||||
public Boolean getShowInApiConsole() {
|
||||
return showInApiConsole;
|
||||
}
|
||||
|
||||
public void setShowInApiConsole(Boolean showInApiConsole) {
|
||||
this.showInApiConsole = showInApiConsole;
|
||||
}
|
||||
|
||||
public Environment endpoints(EnvironmentEndpoints endpoints) {
|
||||
this.endpoints = endpoints;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get endpoints
|
||||
* @return endpoints
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
public EnvironmentEndpoints getEndpoints() {
|
||||
return endpoints;
|
||||
}
|
||||
|
||||
public void setEndpoints(EnvironmentEndpoints endpoints) {
|
||||
this.endpoints = endpoints;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Environment environment = (Environment) o;
|
||||
return Objects.equals(this.name, environment.name) &&
|
||||
Objects.equals(this.type, environment.type) &&
|
||||
Objects.equals(this.serverUrl, environment.serverUrl) &&
|
||||
Objects.equals(this.showInApiConsole, environment.showInApiConsole) &&
|
||||
Objects.equals(this.endpoints, environment.endpoints);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, type, serverUrl, showInApiConsole, endpoints);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Environment {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" type: ").append(toIndentedString(type)).append("\n");
|
||||
sb.append(" serverUrl: ").append(toIndentedString(serverUrl)).append("\n");
|
||||
sb.append(" showInApiConsole: ").append(toIndentedString(showInApiConsole)).append("\n");
|
||||
sb.append(" endpoints: ").append(toIndentedString(endpoints)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* EnvironmentEndpoints
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class EnvironmentEndpoints {
|
||||
@JsonProperty("http")
|
||||
private String http = null;
|
||||
|
||||
@JsonProperty("https")
|
||||
private String https = null;
|
||||
|
||||
public EnvironmentEndpoints http(String http) {
|
||||
this.http = http;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP environment URL
|
||||
* @return http
|
||||
**/
|
||||
@ApiModelProperty(example = "http://localhost:8280", value = "HTTP environment URL")
|
||||
public String getHttp() {
|
||||
return http;
|
||||
}
|
||||
|
||||
public void setHttp(String http) {
|
||||
this.http = http;
|
||||
}
|
||||
|
||||
public EnvironmentEndpoints https(String https) {
|
||||
this.https = https;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTPS environment URL
|
||||
* @return https
|
||||
**/
|
||||
@ApiModelProperty(example = "https://localhost:8244", value = "HTTPS environment URL")
|
||||
public String getHttps() {
|
||||
return https;
|
||||
}
|
||||
|
||||
public void setHttps(String https) {
|
||||
this.https = https;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EnvironmentEndpoints environmentEndpoints = (EnvironmentEndpoints) o;
|
||||
return Objects.equals(this.http, environmentEndpoints.http) &&
|
||||
Objects.equals(this.https, environmentEndpoints.https);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(http, https);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnvironmentEndpoints {\n");
|
||||
|
||||
sb.append(" http: ").append(toIndentedString(http)).append("\n");
|
||||
sb.append(" https: ").append(toIndentedString(https)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,129 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* EnvironmentList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class EnvironmentList {
|
||||
@JsonProperty("count")
|
||||
private Integer count = null;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<Environment> list = new ArrayList<Environment>();
|
||||
|
||||
public EnvironmentList count(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of Environments returned.
|
||||
* @return count
|
||||
**/
|
||||
@ApiModelProperty(example = "1", value = "Number of Environments returned. ")
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public EnvironmentList list(List<Environment> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EnvironmentList addListItem(Environment listItem) {
|
||||
this.list.add(listItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
* @return list
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<Environment> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<Environment> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EnvironmentList environmentList = (EnvironmentList) o;
|
||||
return Objects.equals(this.count, environmentList.count) &&
|
||||
Objects.equals(this.list, environmentList.list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(count, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnvironmentList {\n");
|
||||
|
||||
sb.append(" count: ").append(toIndentedString(count)).append("\n");
|
||||
sb.append(" list: ").append(toIndentedString(list)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,198 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Error
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class Error {
|
||||
@JsonProperty("code")
|
||||
private Long code = null;
|
||||
|
||||
@JsonProperty("message")
|
||||
private String message = null;
|
||||
|
||||
@JsonProperty("description")
|
||||
private String description = null;
|
||||
|
||||
@JsonProperty("moreInfo")
|
||||
private String moreInfo = null;
|
||||
|
||||
@JsonProperty("error")
|
||||
private List<ErrorListItem> error = new ArrayList<ErrorListItem>();
|
||||
|
||||
public Error code(Long code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get code
|
||||
* @return code
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
public Long getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Long code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Error message(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Error message.
|
||||
* @return message
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "Error message.")
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Error description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A detail description about the error message.
|
||||
* @return description
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "A detail description about the error message. ")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Error moreInfo(String moreInfo) {
|
||||
this.moreInfo = moreInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Preferably an url with more details about the error.
|
||||
* @return moreInfo
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "Preferably an url with more details about the error. ")
|
||||
public String getMoreInfo() {
|
||||
return moreInfo;
|
||||
}
|
||||
|
||||
public void setMoreInfo(String moreInfo) {
|
||||
this.moreInfo = moreInfo;
|
||||
}
|
||||
|
||||
public Error error(List<ErrorListItem> error) {
|
||||
this.error = error;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Error addErrorItem(ErrorListItem errorItem) {
|
||||
this.error.add(errorItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If there are more than one error list them out. For example, list out validation errors by each field.
|
||||
* @return error
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "If there are more than one error list them out. For example, list out validation errors by each field. ")
|
||||
public List<ErrorListItem> getError() {
|
||||
return error;
|
||||
}
|
||||
|
||||
public void setError(List<ErrorListItem> error) {
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Error error = (Error) o;
|
||||
return Objects.equals(this.code, error.code) &&
|
||||
Objects.equals(this.message, error.message) &&
|
||||
Objects.equals(this.description, error.description) &&
|
||||
Objects.equals(this.moreInfo, error.moreInfo) &&
|
||||
Objects.equals(this.error, error.error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(code, message, description, moreInfo, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Error {\n");
|
||||
|
||||
sb.append(" code: ").append(toIndentedString(code)).append("\n");
|
||||
sb.append(" message: ").append(toIndentedString(message)).append("\n");
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" moreInfo: ").append(toIndentedString(moreInfo)).append("\n");
|
||||
sb.append(" error: ").append(toIndentedString(error)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* ErrorListItem
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class ErrorListItem {
|
||||
@JsonProperty("code")
|
||||
private String code = null;
|
||||
|
||||
@JsonProperty("message")
|
||||
private String message = null;
|
||||
|
||||
public ErrorListItem code(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get code
|
||||
* @return code
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public ErrorListItem message(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description about individual errors occurred
|
||||
* @return message
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "Description about individual errors occurred ")
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ErrorListItem errorListItem = (ErrorListItem) o;
|
||||
return Objects.equals(this.code, errorListItem.code) &&
|
||||
Objects.equals(this.message, errorListItem.message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(code, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ErrorListItem {\n");
|
||||
|
||||
sb.append(" code: ").append(toIndentedString(code)).append("\n");
|
||||
sb.append(" message: ").append(toIndentedString(message)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* FileInfo
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class FileInfo {
|
||||
@JsonProperty("relativePath")
|
||||
private String relativePath = null;
|
||||
|
||||
@JsonProperty("mediaType")
|
||||
private String mediaType = null;
|
||||
|
||||
public FileInfo relativePath(String relativePath) {
|
||||
this.relativePath = relativePath;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* relative location of the file (excluding the base context and host of the Publisher API)
|
||||
* @return relativePath
|
||||
**/
|
||||
@ApiModelProperty(example = "apis/01234567-0123-0123-0123-012345678901/thumbnail", value = "relative location of the file (excluding the base context and host of the Publisher API)")
|
||||
public String getRelativePath() {
|
||||
return relativePath;
|
||||
}
|
||||
|
||||
public void setRelativePath(String relativePath) {
|
||||
this.relativePath = relativePath;
|
||||
}
|
||||
|
||||
public FileInfo mediaType(String mediaType) {
|
||||
this.mediaType = mediaType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* media-type of the file
|
||||
* @return mediaType
|
||||
**/
|
||||
@ApiModelProperty(example = "image/jpeg", value = "media-type of the file")
|
||||
public String getMediaType() {
|
||||
return mediaType;
|
||||
}
|
||||
|
||||
public void setMediaType(String mediaType) {
|
||||
this.mediaType = mediaType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileInfo fileInfo = (FileInfo) o;
|
||||
return Objects.equals(this.relativePath, fileInfo.relativePath) &&
|
||||
Objects.equals(this.mediaType, fileInfo.mediaType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(relativePath, mediaType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileInfo {\n");
|
||||
|
||||
sb.append(" relativePath: ").append(toIndentedString(relativePath)).append("\n");
|
||||
sb.append(" mediaType: ").append(toIndentedString(mediaType)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,145 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Sequence
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class Sequence {
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("config")
|
||||
private String config = null;
|
||||
|
||||
@JsonProperty("type")
|
||||
private String type = null;
|
||||
|
||||
public Sequence name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "log_in_message", required = true, value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Sequence config(String config) {
|
||||
this.config = config;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get config
|
||||
* @return config
|
||||
**/
|
||||
@ApiModelProperty(example = "", value = "")
|
||||
public String getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
public void setConfig(String config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public Sequence type(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
**/
|
||||
@ApiModelProperty(example = "in", value = "")
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Sequence sequence = (Sequence) o;
|
||||
return Objects.equals(this.name, sequence.name) &&
|
||||
Objects.equals(this.config, sequence.config) &&
|
||||
Objects.equals(this.type, sequence.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, config, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Sequence {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" config: ").append(toIndentedString(config)).append("\n");
|
||||
sb.append(" type: ").append(toIndentedString(type)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,228 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Subscription
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class Subscription {
|
||||
@JsonProperty("subscriptionId")
|
||||
private String subscriptionId = null;
|
||||
|
||||
@JsonProperty("applicationId")
|
||||
private String applicationId = null;
|
||||
|
||||
@JsonProperty("apiIdentifier")
|
||||
private String apiIdentifier = null;
|
||||
|
||||
@JsonProperty("tier")
|
||||
private String tier = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets status
|
||||
*/
|
||||
public enum StatusEnum {
|
||||
BLOCKED("BLOCKED"),
|
||||
|
||||
PROD_ONLY_BLOCKED("PROD_ONLY_BLOCKED"),
|
||||
|
||||
UNBLOCKED("UNBLOCKED"),
|
||||
|
||||
ON_HOLD("ON_HOLD"),
|
||||
|
||||
REJECTED("REJECTED");
|
||||
|
||||
private String value;
|
||||
|
||||
StatusEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static StatusEnum fromValue(String text) {
|
||||
for (StatusEnum b : StatusEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("status")
|
||||
private StatusEnum status = null;
|
||||
|
||||
public Subscription subscriptionId(String subscriptionId) {
|
||||
this.subscriptionId = subscriptionId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get subscriptionId
|
||||
* @return subscriptionId
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "")
|
||||
public String getSubscriptionId() {
|
||||
return subscriptionId;
|
||||
}
|
||||
|
||||
public void setSubscriptionId(String subscriptionId) {
|
||||
this.subscriptionId = subscriptionId;
|
||||
}
|
||||
|
||||
public Subscription applicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get applicationId
|
||||
* @return applicationId
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", required = true, value = "")
|
||||
public String getApplicationId() {
|
||||
return applicationId;
|
||||
}
|
||||
|
||||
public void setApplicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
}
|
||||
|
||||
public Subscription apiIdentifier(String apiIdentifier) {
|
||||
this.apiIdentifier = apiIdentifier;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get apiIdentifier
|
||||
* @return apiIdentifier
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", required = true, value = "")
|
||||
public String getApiIdentifier() {
|
||||
return apiIdentifier;
|
||||
}
|
||||
|
||||
public void setApiIdentifier(String apiIdentifier) {
|
||||
this.apiIdentifier = apiIdentifier;
|
||||
}
|
||||
|
||||
public Subscription tier(String tier) {
|
||||
this.tier = tier;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tier
|
||||
* @return tier
|
||||
**/
|
||||
@ApiModelProperty(example = "Unlimited", required = true, value = "")
|
||||
public String getTier() {
|
||||
return tier;
|
||||
}
|
||||
|
||||
public void setTier(String tier) {
|
||||
this.tier = tier;
|
||||
}
|
||||
|
||||
public Subscription status(StatusEnum status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(example = "UNBLOCKED", value = "")
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(StatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Subscription subscription = (Subscription) o;
|
||||
return Objects.equals(this.subscriptionId, subscription.subscriptionId) &&
|
||||
Objects.equals(this.applicationId, subscription.applicationId) &&
|
||||
Objects.equals(this.apiIdentifier, subscription.apiIdentifier) &&
|
||||
Objects.equals(this.tier, subscription.tier) &&
|
||||
Objects.equals(this.status, subscription.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(subscriptionId, applicationId, apiIdentifier, tier, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Subscription {\n");
|
||||
|
||||
sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n");
|
||||
sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n");
|
||||
sb.append(" apiIdentifier: ").append(toIndentedString(apiIdentifier)).append("\n");
|
||||
sb.append(" tier: ").append(toIndentedString(tier)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* SubscriptionList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class SubscriptionList {
|
||||
@JsonProperty("count")
|
||||
private Integer count = null;
|
||||
|
||||
@JsonProperty("next")
|
||||
private String next = null;
|
||||
|
||||
@JsonProperty("previous")
|
||||
private String previous = null;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<Subscription> list = new ArrayList<Subscription>();
|
||||
|
||||
public SubscriptionList count(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of Subscriptions returned.
|
||||
* @return count
|
||||
**/
|
||||
@ApiModelProperty(example = "1", value = "Number of Subscriptions returned. ")
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public SubscriptionList next(String next) {
|
||||
this.next = next;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the next subset of resources qualified. Empty if no more resources are to be returned.
|
||||
* @return next
|
||||
**/
|
||||
@ApiModelProperty(example = "/subscriptions?limit=1&offset=2&apiId=01234567-0123-0123-0123-012345678901&groupId=", value = "Link to the next subset of resources qualified. Empty if no more resources are to be returned. ")
|
||||
public String getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(String next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public SubscriptionList previous(String previous) {
|
||||
this.previous = previous;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the previous subset of resources qualified. Empty if current subset is the first subset returned.
|
||||
* @return previous
|
||||
**/
|
||||
@ApiModelProperty(example = "/subscriptions?limit=1&offset=0&apiId=01234567-0123-0123-0123-012345678901&groupId=", value = "Link to the previous subset of resources qualified. Empty if current subset is the first subset returned. ")
|
||||
public String getPrevious() {
|
||||
return previous;
|
||||
}
|
||||
|
||||
public void setPrevious(String previous) {
|
||||
this.previous = previous;
|
||||
}
|
||||
|
||||
public SubscriptionList list(List<Subscription> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SubscriptionList addListItem(Subscription listItem) {
|
||||
this.list.add(listItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
* @return list
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<Subscription> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<Subscription> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SubscriptionList subscriptionList = (SubscriptionList) o;
|
||||
return Objects.equals(this.count, subscriptionList.count) &&
|
||||
Objects.equals(this.next, subscriptionList.next) &&
|
||||
Objects.equals(this.previous, subscriptionList.previous) &&
|
||||
Objects.equals(this.list, subscriptionList.list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(count, next, previous, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class SubscriptionList {\n");
|
||||
|
||||
sb.append(" count: ").append(toIndentedString(count)).append("\n");
|
||||
sb.append(" next: ").append(toIndentedString(next)).append("\n");
|
||||
sb.append(" previous: ").append(toIndentedString(previous)).append("\n");
|
||||
sb.append(" list: ").append(toIndentedString(list)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,353 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Tier
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class Tier {
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("description")
|
||||
private String description = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets tierLevel
|
||||
*/
|
||||
public enum TierLevelEnum {
|
||||
API("api"),
|
||||
|
||||
APPLICATION("application"),
|
||||
|
||||
RESOURCE("resource");
|
||||
|
||||
private String value;
|
||||
|
||||
TierLevelEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static TierLevelEnum fromValue(String text) {
|
||||
for (TierLevelEnum b : TierLevelEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("tierLevel")
|
||||
private TierLevelEnum tierLevel = null;
|
||||
|
||||
@JsonProperty("attributes")
|
||||
private Map<String, String> attributes = new HashMap<String, String>();
|
||||
|
||||
@JsonProperty("requestCount")
|
||||
private Long requestCount = null;
|
||||
|
||||
@JsonProperty("unitTime")
|
||||
private Long unitTime = null;
|
||||
|
||||
@JsonProperty("timeUnit")
|
||||
private String timeUnit = null;
|
||||
|
||||
/**
|
||||
* This attribute declares whether this tier is available under commercial or free
|
||||
*/
|
||||
public enum TierPlanEnum {
|
||||
FREE("FREE"),
|
||||
|
||||
COMMERCIAL("COMMERCIAL");
|
||||
|
||||
private String value;
|
||||
|
||||
TierPlanEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static TierPlanEnum fromValue(String text) {
|
||||
for (TierPlanEnum b : TierPlanEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("tierPlan")
|
||||
private TierPlanEnum tierPlan = null;
|
||||
|
||||
@JsonProperty("stopOnQuotaReach")
|
||||
private Boolean stopOnQuotaReach = null;
|
||||
|
||||
public Tier name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "Platinum", required = true, value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Tier description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
* @return description
|
||||
**/
|
||||
@ApiModelProperty(example = "Allows 50 request(s) per minute.", value = "")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Tier tierLevel(TierLevelEnum tierLevel) {
|
||||
this.tierLevel = tierLevel;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tierLevel
|
||||
* @return tierLevel
|
||||
**/
|
||||
@ApiModelProperty(example = "api", value = "")
|
||||
public TierLevelEnum getTierLevel() {
|
||||
return tierLevel;
|
||||
}
|
||||
|
||||
public void setTierLevel(TierLevelEnum tierLevel) {
|
||||
this.tierLevel = tierLevel;
|
||||
}
|
||||
|
||||
public Tier attributes(Map<String, String> attributes) {
|
||||
this.attributes = attributes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Tier putAttributesItem(String key, String attributesItem) {
|
||||
this.attributes.put(key, attributesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom attributes added to the tier policy
|
||||
* @return attributes
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "Custom attributes added to the tier policy ")
|
||||
public Map<String, String> getAttributes() {
|
||||
return attributes;
|
||||
}
|
||||
|
||||
public void setAttributes(Map<String, String> attributes) {
|
||||
this.attributes = attributes;
|
||||
}
|
||||
|
||||
public Tier requestCount(Long requestCount) {
|
||||
this.requestCount = requestCount;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximum number of requests which can be sent within a provided unit time
|
||||
* @return requestCount
|
||||
**/
|
||||
@ApiModelProperty(example = "50", required = true, value = "Maximum number of requests which can be sent within a provided unit time ")
|
||||
public Long getRequestCount() {
|
||||
return requestCount;
|
||||
}
|
||||
|
||||
public void setRequestCount(Long requestCount) {
|
||||
this.requestCount = requestCount;
|
||||
}
|
||||
|
||||
public Tier unitTime(Long unitTime) {
|
||||
this.unitTime = unitTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get unitTime
|
||||
* @return unitTime
|
||||
**/
|
||||
@ApiModelProperty(example = "60000", required = true, value = "")
|
||||
public Long getUnitTime() {
|
||||
return unitTime;
|
||||
}
|
||||
|
||||
public void setUnitTime(Long unitTime) {
|
||||
this.unitTime = unitTime;
|
||||
}
|
||||
|
||||
public Tier timeUnit(String timeUnit) {
|
||||
this.timeUnit = timeUnit;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get timeUnit
|
||||
* @return timeUnit
|
||||
**/
|
||||
@ApiModelProperty(example = "min", value = "")
|
||||
public String getTimeUnit() {
|
||||
return timeUnit;
|
||||
}
|
||||
|
||||
public void setTimeUnit(String timeUnit) {
|
||||
this.timeUnit = timeUnit;
|
||||
}
|
||||
|
||||
public Tier tierPlan(TierPlanEnum tierPlan) {
|
||||
this.tierPlan = tierPlan;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This attribute declares whether this tier is available under commercial or free
|
||||
* @return tierPlan
|
||||
**/
|
||||
@ApiModelProperty(example = "FREE", required = true, value = "This attribute declares whether this tier is available under commercial or free ")
|
||||
public TierPlanEnum getTierPlan() {
|
||||
return tierPlan;
|
||||
}
|
||||
|
||||
public void setTierPlan(TierPlanEnum tierPlan) {
|
||||
this.tierPlan = tierPlan;
|
||||
}
|
||||
|
||||
public Tier stopOnQuotaReach(Boolean stopOnQuotaReach) {
|
||||
this.stopOnQuotaReach = stopOnQuotaReach;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* By making this attribute to false, you are capabale of sending requests even if the request count exceeded within a unit time
|
||||
* @return stopOnQuotaReach
|
||||
**/
|
||||
@ApiModelProperty(example = "true", required = true, value = "By making this attribute to false, you are capabale of sending requests even if the request count exceeded within a unit time ")
|
||||
public Boolean getStopOnQuotaReach() {
|
||||
return stopOnQuotaReach;
|
||||
}
|
||||
|
||||
public void setStopOnQuotaReach(Boolean stopOnQuotaReach) {
|
||||
this.stopOnQuotaReach = stopOnQuotaReach;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Tier tier = (Tier) o;
|
||||
return Objects.equals(this.name, tier.name) &&
|
||||
Objects.equals(this.description, tier.description) &&
|
||||
Objects.equals(this.tierLevel, tier.tierLevel) &&
|
||||
Objects.equals(this.attributes, tier.attributes) &&
|
||||
Objects.equals(this.requestCount, tier.requestCount) &&
|
||||
Objects.equals(this.unitTime, tier.unitTime) &&
|
||||
Objects.equals(this.timeUnit, tier.timeUnit) &&
|
||||
Objects.equals(this.tierPlan, tier.tierPlan) &&
|
||||
Objects.equals(this.stopOnQuotaReach, tier.stopOnQuotaReach);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, description, tierLevel, attributes, requestCount, unitTime, timeUnit, tierPlan, stopOnQuotaReach);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Tier {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" tierLevel: ").append(toIndentedString(tierLevel)).append("\n");
|
||||
sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
|
||||
sb.append(" requestCount: ").append(toIndentedString(requestCount)).append("\n");
|
||||
sb.append(" unitTime: ").append(toIndentedString(unitTime)).append("\n");
|
||||
sb.append(" timeUnit: ").append(toIndentedString(timeUnit)).append("\n");
|
||||
sb.append(" tierPlan: ").append(toIndentedString(tierPlan)).append("\n");
|
||||
sb.append(" stopOnQuotaReach: ").append(toIndentedString(stopOnQuotaReach)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* TierList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class TierList {
|
||||
@JsonProperty("count")
|
||||
private Integer count = null;
|
||||
|
||||
@JsonProperty("next")
|
||||
private String next = null;
|
||||
|
||||
@JsonProperty("previous")
|
||||
private String previous = null;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<Tier> list = new ArrayList<Tier>();
|
||||
|
||||
public TierList count(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of Tiers returned.
|
||||
* @return count
|
||||
**/
|
||||
@ApiModelProperty(example = "1", value = "Number of Tiers returned. ")
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public TierList next(String next) {
|
||||
this.next = next;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the next subset of resources qualified. Empty if no more resources are to be returned.
|
||||
* @return next
|
||||
**/
|
||||
@ApiModelProperty(example = "/tiers/api?limit=1&offset=2", value = "Link to the next subset of resources qualified. Empty if no more resources are to be returned. ")
|
||||
public String getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(String next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public TierList previous(String previous) {
|
||||
this.previous = previous;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the previous subset of resources qualified. Empty if current subset is the first subset returned.
|
||||
* @return previous
|
||||
**/
|
||||
@ApiModelProperty(example = "/tiers/api?limit=1&offset=0", value = "Link to the previous subset of resources qualified. Empty if current subset is the first subset returned. ")
|
||||
public String getPrevious() {
|
||||
return previous;
|
||||
}
|
||||
|
||||
public void setPrevious(String previous) {
|
||||
this.previous = previous;
|
||||
}
|
||||
|
||||
public TierList list(List<Tier> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TierList addListItem(Tier listItem) {
|
||||
this.list.add(listItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
* @return list
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<Tier> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<Tier> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TierList tierList = (TierList) o;
|
||||
return Objects.equals(this.count, tierList.count) &&
|
||||
Objects.equals(this.next, tierList.next) &&
|
||||
Objects.equals(this.previous, tierList.previous) &&
|
||||
Objects.equals(this.list, tierList.list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(count, next, previous, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class TierList {\n");
|
||||
|
||||
sb.append(" count: ").append(toIndentedString(count)).append("\n");
|
||||
sb.append(" next: ").append(toIndentedString(next)).append("\n");
|
||||
sb.append(" previous: ").append(toIndentedString(previous)).append("\n");
|
||||
sb.append(" list: ").append(toIndentedString(list)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,160 @@
|
||||
/**
|
||||
* WSO2 API Manager - Publisher API
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Publisher. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.publisher.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* TierPermission
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:49.624+05:30")
|
||||
public class TierPermission {
|
||||
/**
|
||||
* Gets or Sets permissionType
|
||||
*/
|
||||
public enum PermissionTypeEnum {
|
||||
ALLOW("allow"),
|
||||
|
||||
DENY("deny");
|
||||
|
||||
private String value;
|
||||
|
||||
PermissionTypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static PermissionTypeEnum fromValue(String text) {
|
||||
for (PermissionTypeEnum b : PermissionTypeEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("permissionType")
|
||||
private PermissionTypeEnum permissionType = null;
|
||||
|
||||
@JsonProperty("roles")
|
||||
private List<String> roles = new ArrayList<String>();
|
||||
|
||||
public TierPermission permissionType(PermissionTypeEnum permissionType) {
|
||||
this.permissionType = permissionType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get permissionType
|
||||
* @return permissionType
|
||||
**/
|
||||
@ApiModelProperty(example = "deny", required = true, value = "")
|
||||
public PermissionTypeEnum getPermissionType() {
|
||||
return permissionType;
|
||||
}
|
||||
|
||||
public void setPermissionType(PermissionTypeEnum permissionType) {
|
||||
this.permissionType = permissionType;
|
||||
}
|
||||
|
||||
public TierPermission roles(List<String> roles) {
|
||||
this.roles = roles;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TierPermission addRolesItem(String rolesItem) {
|
||||
this.roles.add(rolesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get roles
|
||||
* @return roles
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
public List<String> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(List<String> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TierPermission tierPermission = (TierPermission) o;
|
||||
return Objects.equals(this.permissionType, tierPermission.permissionType) &&
|
||||
Objects.equals(this.roles, tierPermission.roles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(permissionType, roles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class TierPermission {\n");
|
||||
|
||||
sb.append(" permissionType: ").append(toIndentedString(permissionType)).append("\n");
|
||||
sb.append(" roles: ").append(toIndentedString(roles)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.service;
|
||||
|
||||
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.StoreClient;
|
||||
|
||||
/**
|
||||
* This is a service that can be called upon to access store and publisher.
|
||||
*/
|
||||
public interface IntegrationClientService {
|
||||
|
||||
/**
|
||||
*
|
||||
* @return API Store Client.
|
||||
*/
|
||||
StoreClient getStoreClient();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return API Publisher Client.
|
||||
*/
|
||||
PublisherClient getPublisherClient();
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.store;
|
||||
|
||||
import feign.Feign;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.gson.GsonDecoder;
|
||||
import feign.gson.GsonEncoder;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.api.*;
|
||||
import org.wso2.carbon.core.util.Utils;
|
||||
|
||||
/**
|
||||
* API Store client, created using swagger gen.
|
||||
*/
|
||||
public class StoreClient {
|
||||
|
||||
private static final org.apache.commons.logging.Log log = LogFactory.getLog(StoreClient.class);
|
||||
private ApisAPIApi apis = null;
|
||||
private APIindividualApi individualApi = null;
|
||||
private ApplicationCollectionApi applications = null;
|
||||
private ApplicationindividualApi individualApplication = null;
|
||||
private SubscriptionCollectionApi subscriptions = null;
|
||||
private SubscriptionindividualApi individualSubscription = null;
|
||||
private TierindividualApi individualTier = null;
|
||||
private TagCollectionApi tags = null;
|
||||
private TierCollectionApi tiers = null;
|
||||
|
||||
|
||||
public StoreClient(RequestInterceptor requestInterceptor) {
|
||||
|
||||
Feign.Builder builder = Feign.builder().requestInterceptor(requestInterceptor)
|
||||
.encoder(new GsonEncoder()).decoder(new GsonDecoder());
|
||||
String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getStoreEndpoint());
|
||||
|
||||
apis = builder.target(ApisAPIApi.class, basePath);
|
||||
individualApi = builder.target(APIindividualApi.class, basePath);
|
||||
applications = builder.target(ApplicationCollectionApi.class, basePath);
|
||||
individualApplication = builder.target(ApplicationindividualApi.class, basePath);
|
||||
subscriptions = builder.target(SubscriptionCollectionApi.class, basePath);
|
||||
individualSubscription = builder.target(SubscriptionindividualApi.class, basePath);
|
||||
tags = builder.target(TagCollectionApi.class, basePath);
|
||||
tiers = builder.target(TierCollectionApi.class, basePath);
|
||||
individualTier = builder.target(TierindividualApi.class, basePath);
|
||||
|
||||
}
|
||||
|
||||
public ApisAPIApi getApis() {
|
||||
return apis;
|
||||
}
|
||||
|
||||
public APIindividualApi getIndividualApi() {
|
||||
return individualApi;
|
||||
}
|
||||
|
||||
public ApplicationCollectionApi getApplications() {
|
||||
return applications;
|
||||
}
|
||||
|
||||
public ApplicationindividualApi getIndividualApplication() {
|
||||
return individualApplication;
|
||||
}
|
||||
|
||||
public SubscriptionCollectionApi getSubscriptions() {
|
||||
return subscriptions;
|
||||
}
|
||||
|
||||
public SubscriptionindividualApi getIndividualSubscription() {
|
||||
return individualSubscription;
|
||||
}
|
||||
|
||||
public TierindividualApi getIndividualTier() {
|
||||
return individualTier;
|
||||
}
|
||||
|
||||
public TagCollectionApi getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public TierCollectionApi getTiers() {
|
||||
return tiers;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,187 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.store.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.API;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.Document;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.DocumentList;
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public interface APIindividualApi {
|
||||
|
||||
|
||||
/**
|
||||
* Downloads a FILE type document/get the inline content or source url of a certain document.
|
||||
* Downloads a FILE type document/get the inline content or source url of a certain document.
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param documentId **Document Identifier** (required)
|
||||
* @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}/documents/{documentId}/content")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"X-WSO2-Tenant: {xWSO2Tenant}",
|
||||
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
void apisApiIdDocumentsDocumentIdContentGet(@Param("apiId") String apiId, @Param("documentId") String documentId,
|
||||
@Param("xWSO2Tenant") String xWSO2Tenant, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch,
|
||||
@Param("ifModifiedSince") String ifModifiedSince);
|
||||
|
||||
/**
|
||||
* Get a particular document associated with an API.
|
||||
* Get a particular document associated with an API.
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param documentId **Document Identifier** (required)
|
||||
* @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return Document
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}/documents/{documentId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"X-WSO2-Tenant: {xWSO2Tenant}",
|
||||
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
Document apisApiIdDocumentsDocumentIdGet(@Param("apiId") String apiId, @Param("documentId") String documentId,
|
||||
@Param("xWSO2Tenant") String xWSO2Tenant, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch,
|
||||
@Param("ifModifiedSince") String ifModifiedSince);
|
||||
|
||||
/**
|
||||
* Get a list of documents belonging to an API.
|
||||
* Get a list of documents belonging to an API.
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param limit Maximum size of resource array to return. (optional, default to 25)
|
||||
* @param offset Starting point within the complete list of items qualified. (optional, default to 0)
|
||||
* @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @return DocumentList
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}/documents?limit={limit}&offset={offset}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"X-WSO2-Tenant: {xWSO2Tenant}",
|
||||
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}"
|
||||
})
|
||||
DocumentList apisApiIdDocumentsGet(@Param("apiId") String apiId, @Param("limit") Integer limit,
|
||||
@Param("offset") Integer offset, @Param("xWSO2Tenant") String xWSO2Tenant,
|
||||
@Param("accept") String accept, @Param("ifNoneMatch") String ifNoneMatch);
|
||||
|
||||
/**
|
||||
* Get Details of API
|
||||
* Get details of an API
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional)
|
||||
* @return API
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}",
|
||||
|
||||
"X-WSO2-Tenant: {xWSO2Tenant}"
|
||||
})
|
||||
API apisApiIdGet(@Param("apiId") String apiId, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch, @Param("ifModifiedSince") String ifModifiedSince,
|
||||
@Param("xWSO2Tenant") String xWSO2Tenant);
|
||||
|
||||
/**
|
||||
* Get the swagger of an API
|
||||
* Get the swagger of an API
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}/swagger")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}",
|
||||
|
||||
"X-WSO2-Tenant: {xWSO2Tenant}"
|
||||
})
|
||||
void apisApiIdSwaggerGet(@Param("apiId") String apiId, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch, @Param("ifModifiedSince") String ifModifiedSince,
|
||||
@Param("xWSO2Tenant") String xWSO2Tenant);
|
||||
|
||||
/**
|
||||
* Get the thumbnail image
|
||||
* Downloads a thumbnail image of an API
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**. (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly
|
||||
* retrieved variant of the resource. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("GET /apis/{apiId}/thumbnail")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
void apisApiIdThumbnailGet(@Param("apiId") String apiId, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch, @Param("ifModifiedSince") String ifModifiedSince);
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.store.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.APIList;
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public interface ApisAPIApi {
|
||||
|
||||
|
||||
/**
|
||||
* Retrieving APIs
|
||||
* Get a list of available APIs qualifying under a given search condition.
|
||||
* @param limit Maximum size of resource array to return. (optional, default to 25)
|
||||
* @param offset Starting point within the complete list of items qualified. (optional, default to 0)
|
||||
* @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional)
|
||||
* @param query **Search condition**. You can search in attributes by using an **\"attribute:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API is exactly \"wso2\". Additionally you can use wildcards. Eg. \"provider:wso2\\*\" will match an API if the provider of the API starts with \"wso2\". Supported attribute modifiers are [**version, context, status, description, subcontext, doc, provider, tag**] If no advanced attribute modifier has been specified, search will match the given query string against API Name. (optional)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @return APIList
|
||||
*/
|
||||
@RequestLine("GET /apis?limit={limit}&offset={offset}&query={query}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"X-WSO2-Tenant: {xWSO2Tenant}",
|
||||
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}"
|
||||
})
|
||||
APIList apisGet(@Param("limit") Integer limit, @Param("offset") Integer offset,
|
||||
@Param("xWSO2Tenant") String xWSO2Tenant, @Param("query") String query,
|
||||
@Param("accept") String accept, @Param("ifNoneMatch") String ifNoneMatch);
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.store.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.ApplicationList;
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public interface ApplicationCollectionApi {
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of applications
|
||||
* Get a list of applications
|
||||
* @param groupId Application Group Id (optional)
|
||||
* @param query **Search condition**. You can search for an application by specifying the name as \"query\" attribute. Eg. \"app1\" will match an application if the name is exactly \"app1\". Currently this does not support wildcards. Given name must exactly match the application name. (optional)
|
||||
* @param limit Maximum size of resource array to return. (optional, default to 25)
|
||||
* @param offset Starting point within the complete list of items qualified. (optional, default to 0)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @return ApplicationList
|
||||
*/
|
||||
@RequestLine("GET /applications?groupId={groupId}&query={query}&limit={limit}&offset={offset}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}"
|
||||
})
|
||||
ApplicationList applicationsGet(@Param("groupId") String groupId, @Param("query") String query,
|
||||
@Param("limit") Integer limit, @Param("offset") Integer offset,
|
||||
@Param("accept") String accept, @Param("ifNoneMatch") String ifNoneMatch);
|
||||
}
|
||||
@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.store.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.Application;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.ApplicationKey;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.ApplicationKeyGenerateRequest;
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public interface ApplicationindividualApi {
|
||||
|
||||
|
||||
/**
|
||||
* Remove an application
|
||||
* Remove an application
|
||||
* @param applicationId **Application Identifier** consisting of the UUID of the Application. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("DELETE /applications/{applicationId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
void applicationsApplicationIdDelete(@Param("applicationId") String applicationId, @Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Get application details
|
||||
* Get application details
|
||||
* @param applicationId **Application Identifier** consisting of the UUID of the Application. (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return Application
|
||||
*/
|
||||
@RequestLine("GET /applications/{applicationId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
Application applicationsApplicationIdGet(@Param("applicationId") String applicationId, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch,
|
||||
@Param("ifModifiedSince") String ifModifiedSince);
|
||||
|
||||
/**
|
||||
* Update application details
|
||||
* Update application details
|
||||
* @param applicationId **Application Identifier** consisting of the UUID of the Application. (required)
|
||||
* @param body Application object that needs to be updated (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return Application
|
||||
*/
|
||||
@RequestLine("PUT /applications/{applicationId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}",
|
||||
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
Application applicationsApplicationIdPut(@Param("applicationId") String applicationId, Application body,
|
||||
@Param("contentType") String contentType, @Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Generate keys for application
|
||||
* Generate keys for application
|
||||
* @param applicationId **Application Identifier** consisting of the UUID of the Application. (required)
|
||||
* @param body Application object the keys of which are to be generated (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return ApplicationKey
|
||||
*/
|
||||
@RequestLine("POST /applications/generate-keys?applicationId={applicationId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}",
|
||||
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
ApplicationKey applicationsGenerateKeysPost(@Param("applicationId") String applicationId,
|
||||
ApplicationKeyGenerateRequest body,
|
||||
@Param("contentType") String contentType,
|
||||
@Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Create a new application.
|
||||
* Create a new application.
|
||||
* @param body Application object that is to be created. (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @return Application
|
||||
*/
|
||||
@RequestLine("POST /applications")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}"
|
||||
})
|
||||
Application applicationsPost(Application body, @Param("contentType") String contentType);
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.store.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.SubscriptionList;
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public interface SubscriptionCollectionApi {
|
||||
|
||||
|
||||
/**
|
||||
* Get subscription list.
|
||||
* Get subscription list. The API Identifier or Application Identifier the subscriptions of which are to be returned are passed as parameters.
|
||||
* @param apiId **API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. Should be formatted as **provider-name-version**. (required)
|
||||
* @param applicationId **Application Identifier** consisting of the UUID of the Application. (required)
|
||||
* @param groupId Application Group Id (optional)
|
||||
* @param offset Starting point within the complete list of items qualified. (optional, default to 0)
|
||||
* @param limit Maximum size of resource array to return. (optional, default to 25)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @return SubscriptionList
|
||||
*/
|
||||
@RequestLine("GET /subscriptions?apiId={apiId}&applicationId={applicationId}&groupId={groupId}&offset={offset}&limit={limit}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}"
|
||||
})
|
||||
SubscriptionList subscriptionsGet(@Param("apiId") String apiId, @Param("applicationId") String applicationId,
|
||||
@Param("groupId") String groupId, @Param("offset") Integer offset,
|
||||
@Param("limit") Integer limit, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch);
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.store.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.Subscription;
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public interface SubscriptionindividualApi {
|
||||
|
||||
|
||||
/**
|
||||
* Add a new subscription
|
||||
* Add a new subscription
|
||||
* @param body Subscription object that should to be added (required)
|
||||
* @param contentType Media type of the entity in the body. Default is JSON. (required)
|
||||
* @return Subscription
|
||||
*/
|
||||
@RequestLine("POST /subscriptions")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Content-Type: {contentType}"
|
||||
})
|
||||
Subscription subscriptionsPost(Subscription body, @Param("contentType") String contentType);
|
||||
|
||||
/**
|
||||
* Remove subscription
|
||||
* Remove subscription
|
||||
* @param subscriptionId Subscription Id (required)
|
||||
* @param ifMatch Validator for conditional requests; based on ETag. (optional)
|
||||
* @param ifUnmodifiedSince Validator for conditional requests; based on Last Modified header. (optional)
|
||||
* @return void
|
||||
*/
|
||||
@RequestLine("DELETE /subscriptions/{subscriptionId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"If-Match: {ifMatch}",
|
||||
|
||||
"If-Unmodified-Since: {ifUnmodifiedSince}"
|
||||
})
|
||||
void subscriptionsSubscriptionIdDelete(@Param("subscriptionId") String subscriptionId,
|
||||
@Param("ifMatch") String ifMatch,
|
||||
@Param("ifUnmodifiedSince") String ifUnmodifiedSince);
|
||||
|
||||
/**
|
||||
* Get subscription details
|
||||
* Get subscription details
|
||||
* @param subscriptionId Subscription Id (required)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return Subscription
|
||||
*/
|
||||
@RequestLine("GET /subscriptions/{subscriptionId}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
Subscription subscriptionsSubscriptionIdGet(@Param("subscriptionId") String subscriptionId,
|
||||
@Param("accept") String accept, @Param("ifNoneMatch") String ifNoneMatch,
|
||||
@Param("ifModifiedSince") String ifModifiedSince);
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.store.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.TagList;
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public interface TagCollectionApi {
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of tags that are already added to APIs
|
||||
* Get a list of tags that are already added to APIs
|
||||
* @param limit Maximum size of resource array to return. (optional, default to 25)
|
||||
* @param offset Starting point within the complete list of items qualified. (optional, default to 0)
|
||||
* @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @return TagList
|
||||
*/
|
||||
@RequestLine("GET /tags?limit={limit}&offset={offset}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"X-WSO2-Tenant: {xWSO2Tenant}",
|
||||
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}"
|
||||
})
|
||||
TagList tagsGet(@Param("limit") Integer limit, @Param("offset") Integer offset,
|
||||
@Param("xWSO2Tenant") String xWSO2Tenant, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch);
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.store.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.TierList;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public interface TierCollectionApi {
|
||||
|
||||
|
||||
/**
|
||||
* Get available tiers
|
||||
* Get available tiers
|
||||
* @param tierLevel List API or Application type tiers. (required)
|
||||
* @param limit Maximum size of resource array to return. (optional, default to 25)
|
||||
* @param offset Starting point within the complete list of items qualified. (optional, default to 0)
|
||||
* @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @return List<TierList>
|
||||
*/
|
||||
@RequestLine("GET /tiers/{tierLevel}?limit={limit}&offset={offset}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"X-WSO2-Tenant: {xWSO2Tenant}",
|
||||
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}"
|
||||
})
|
||||
List<TierList> tiersTierLevelGet(@Param("tierLevel") String tierLevel, @Param("limit") Integer limit,
|
||||
@Param("offset") Integer offset, @Param("xWSO2Tenant") String xWSO2Tenant,
|
||||
@Param("accept") String accept, @Param("ifNoneMatch") String ifNoneMatch);
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.store.api;
|
||||
|
||||
import feign.Headers;
|
||||
import feign.Param;
|
||||
import feign.RequestLine;
|
||||
import org.wso2.carbon.apimgt.integration.client.store.model.Tier;
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public interface TierindividualApi {
|
||||
|
||||
|
||||
/**
|
||||
* Get tier details
|
||||
* Get tier details
|
||||
* @param tierName Tier name (required)
|
||||
* @param tierLevel List API or Application type tiers. (required)
|
||||
* @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional)
|
||||
* @param accept Media types acceptable for the response. Default is JSON. (optional, default to JSON)
|
||||
* @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. (optional)
|
||||
* @param ifModifiedSince Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource. (optional)
|
||||
* @return Tier
|
||||
*/
|
||||
@RequestLine("GET /tiers/{tierLevel}/{tierName}")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
"X-WSO2-Tenant: {xWSO2Tenant}",
|
||||
|
||||
"Accept: {accept}",
|
||||
|
||||
"If-None-Match: {ifNoneMatch}",
|
||||
|
||||
"If-Modified-Since: {ifModifiedSince}"
|
||||
})
|
||||
Tier tiersTierLevelTierNameGet(@Param("tierName") String tierName, @Param("tierLevel") String tierLevel,
|
||||
@Param("xWSO2Tenant") String xWSO2Tenant, @Param("accept") String accept,
|
||||
@Param("ifNoneMatch") String ifNoneMatch,
|
||||
@Param("ifModifiedSince") String ifModifiedSince);
|
||||
}
|
||||
@ -0,0 +1,466 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* API
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class API {
|
||||
@JsonProperty("id")
|
||||
private String id = null;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("description")
|
||||
private String description = null;
|
||||
|
||||
@JsonProperty("context")
|
||||
private String context = null;
|
||||
|
||||
@JsonProperty("version")
|
||||
private String version = null;
|
||||
|
||||
@JsonProperty("provider")
|
||||
private String provider = null;
|
||||
|
||||
@JsonProperty("apiDefinition")
|
||||
private String apiDefinition = null;
|
||||
|
||||
@JsonProperty("wsdlUri")
|
||||
private String wsdlUri = null;
|
||||
|
||||
@JsonProperty("status")
|
||||
private String status = null;
|
||||
|
||||
@JsonProperty("isDefaultVersion")
|
||||
private Boolean isDefaultVersion = null;
|
||||
|
||||
@JsonProperty("transport")
|
||||
private List<String> transport = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("tags")
|
||||
private List<String> tags = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("tiers")
|
||||
private List<String> tiers = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("thumbnailUrl")
|
||||
private String thumbnailUrl = null;
|
||||
|
||||
@JsonProperty("endpointURLs")
|
||||
private List<APIEndpointURLs> endpointURLs = new ArrayList<APIEndpointURLs>();
|
||||
|
||||
@JsonProperty("businessInformation")
|
||||
private APIBusinessInformation businessInformation = null;
|
||||
|
||||
public API id(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* UUID of the api registry artifact
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "UUID of the api registry artifact ")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public API name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorAPI", required = true, value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public API description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
* @return description
|
||||
**/
|
||||
@ApiModelProperty(example = "A calculator API that supports basic operations", value = "")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public API context(String context) {
|
||||
this.context = context;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get context
|
||||
* @return context
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorAPI", required = true, value = "")
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(String context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public API version(String version) {
|
||||
this.version = version;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get version
|
||||
* @return version
|
||||
**/
|
||||
@ApiModelProperty(example = "1.0.0", required = true, value = "")
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public API provider(String provider) {
|
||||
this.provider = provider;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the provider value is not given user invoking the api will be used as the provider.
|
||||
* @return provider
|
||||
**/
|
||||
@ApiModelProperty(example = "admin", required = true, value = "If the provider value is not given user invoking the api will be used as the provider. ")
|
||||
public String getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
public void setProvider(String provider) {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
public API apiDefinition(String apiDefinition) {
|
||||
this.apiDefinition = apiDefinition;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Swagger definition of the API which contains details about URI templates and scopes
|
||||
* @return apiDefinition
|
||||
**/
|
||||
@ApiModelProperty(example = "", required = true, value = "Swagger definition of the API which contains details about URI templates and scopes ")
|
||||
public String getApiDefinition() {
|
||||
return apiDefinition;
|
||||
}
|
||||
|
||||
public void setApiDefinition(String apiDefinition) {
|
||||
this.apiDefinition = apiDefinition;
|
||||
}
|
||||
|
||||
public API wsdlUri(String wsdlUri) {
|
||||
this.wsdlUri = wsdlUri;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* WSDL URL if the API is based on a WSDL endpoint
|
||||
* @return wsdlUri
|
||||
**/
|
||||
@ApiModelProperty(example = "http://www.webservicex.com/globalweather.asmx?wsdl", value = "WSDL URL if the API is based on a WSDL endpoint ")
|
||||
public String getWsdlUri() {
|
||||
return wsdlUri;
|
||||
}
|
||||
|
||||
public void setWsdlUri(String wsdlUri) {
|
||||
this.wsdlUri = wsdlUri;
|
||||
}
|
||||
|
||||
public API status(String status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(example = "PUBLISHED", required = true, value = "")
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public API isDefaultVersion(Boolean isDefaultVersion) {
|
||||
this.isDefaultVersion = isDefaultVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isDefaultVersion
|
||||
* @return isDefaultVersion
|
||||
**/
|
||||
@ApiModelProperty(example = "false", value = "")
|
||||
public Boolean getIsDefaultVersion() {
|
||||
return isDefaultVersion;
|
||||
}
|
||||
|
||||
public void setIsDefaultVersion(Boolean isDefaultVersion) {
|
||||
this.isDefaultVersion = isDefaultVersion;
|
||||
}
|
||||
|
||||
public API transport(List<String> transport) {
|
||||
this.transport = transport;
|
||||
return this;
|
||||
}
|
||||
|
||||
public API addTransportItem(String transportItem) {
|
||||
this.transport.add(transportItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get transport
|
||||
* @return transport
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<String> getTransport() {
|
||||
return transport;
|
||||
}
|
||||
|
||||
public void setTransport(List<String> transport) {
|
||||
this.transport = transport;
|
||||
}
|
||||
|
||||
public API tags(List<String> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
}
|
||||
|
||||
public API addTagsItem(String tagsItem) {
|
||||
this.tags.add(tagsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<String> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(List<String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public API tiers(List<String> tiers) {
|
||||
this.tiers = tiers;
|
||||
return this;
|
||||
}
|
||||
|
||||
public API addTiersItem(String tiersItem) {
|
||||
this.tiers.add(tiersItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tiers
|
||||
* @return tiers
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<String> getTiers() {
|
||||
return tiers;
|
||||
}
|
||||
|
||||
public void setTiers(List<String> tiers) {
|
||||
this.tiers = tiers;
|
||||
}
|
||||
|
||||
public API thumbnailUrl(String thumbnailUrl) {
|
||||
this.thumbnailUrl = thumbnailUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get thumbnailUrl
|
||||
* @return thumbnailUrl
|
||||
**/
|
||||
@ApiModelProperty(example = "", value = "")
|
||||
public String getThumbnailUrl() {
|
||||
return thumbnailUrl;
|
||||
}
|
||||
|
||||
public void setThumbnailUrl(String thumbnailUrl) {
|
||||
this.thumbnailUrl = thumbnailUrl;
|
||||
}
|
||||
|
||||
public API endpointURLs(List<APIEndpointURLs> endpointURLs) {
|
||||
this.endpointURLs = endpointURLs;
|
||||
return this;
|
||||
}
|
||||
|
||||
public API addEndpointURLsItem(APIEndpointURLs endpointURLsItem) {
|
||||
this.endpointURLs.add(endpointURLsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get endpointURLs
|
||||
* @return endpointURLs
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<APIEndpointURLs> getEndpointURLs() {
|
||||
return endpointURLs;
|
||||
}
|
||||
|
||||
public void setEndpointURLs(List<APIEndpointURLs> endpointURLs) {
|
||||
this.endpointURLs = endpointURLs;
|
||||
}
|
||||
|
||||
public API businessInformation(APIBusinessInformation businessInformation) {
|
||||
this.businessInformation = businessInformation;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get businessInformation
|
||||
* @return businessInformation
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public APIBusinessInformation getBusinessInformation() {
|
||||
return businessInformation;
|
||||
}
|
||||
|
||||
public void setBusinessInformation(APIBusinessInformation businessInformation) {
|
||||
this.businessInformation = businessInformation;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
API API = (org.wso2.carbon.apimgt.integration.client.store.model.API) o;
|
||||
return Objects.equals(this.id, API.id) &&
|
||||
Objects.equals(this.name, API.name) &&
|
||||
Objects.equals(this.description, API.description) &&
|
||||
Objects.equals(this.context, API.context) &&
|
||||
Objects.equals(this.version, API.version) &&
|
||||
Objects.equals(this.provider, API.provider) &&
|
||||
Objects.equals(this.apiDefinition, API.apiDefinition) &&
|
||||
Objects.equals(this.wsdlUri, API.wsdlUri) &&
|
||||
Objects.equals(this.status, API.status) &&
|
||||
Objects.equals(this.isDefaultVersion, API.isDefaultVersion) &&
|
||||
Objects.equals(this.transport, API.transport) &&
|
||||
Objects.equals(this.tags, API.tags) &&
|
||||
Objects.equals(this.tiers, API.tiers) &&
|
||||
Objects.equals(this.thumbnailUrl, API.thumbnailUrl) &&
|
||||
Objects.equals(this.endpointURLs, API.endpointURLs) &&
|
||||
Objects.equals(this.businessInformation, API.businessInformation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, description, context, version, provider, apiDefinition, wsdlUri, status, isDefaultVersion, transport, tags, tiers, thumbnailUrl, endpointURLs, businessInformation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class API {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" context: ").append(toIndentedString(context)).append("\n");
|
||||
sb.append(" version: ").append(toIndentedString(version)).append("\n");
|
||||
sb.append(" provider: ").append(toIndentedString(provider)).append("\n");
|
||||
sb.append(" apiDefinition: ").append(toIndentedString(apiDefinition)).append("\n");
|
||||
sb.append(" wsdlUri: ").append(toIndentedString(wsdlUri)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" isDefaultVersion: ").append(toIndentedString(isDefaultVersion)).append("\n");
|
||||
sb.append(" transport: ").append(toIndentedString(transport)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" tiers: ").append(toIndentedString(tiers)).append("\n");
|
||||
sb.append(" thumbnailUrl: ").append(toIndentedString(thumbnailUrl)).append("\n");
|
||||
sb.append(" endpointURLs: ").append(toIndentedString(endpointURLs)).append("\n");
|
||||
sb.append(" businessInformation: ").append(toIndentedString(businessInformation)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,168 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* APIBusinessInformation
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class APIBusinessInformation {
|
||||
@JsonProperty("businessOwner")
|
||||
private String businessOwner = null;
|
||||
|
||||
@JsonProperty("businessOwnerEmail")
|
||||
private String businessOwnerEmail = null;
|
||||
|
||||
@JsonProperty("technicalOwner")
|
||||
private String technicalOwner = null;
|
||||
|
||||
@JsonProperty("technicalOwnerEmail")
|
||||
private String technicalOwnerEmail = null;
|
||||
|
||||
public APIBusinessInformation businessOwner(String businessOwner) {
|
||||
this.businessOwner = businessOwner;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get businessOwner
|
||||
* @return businessOwner
|
||||
**/
|
||||
@ApiModelProperty(example = "businessowner", value = "")
|
||||
public String getBusinessOwner() {
|
||||
return businessOwner;
|
||||
}
|
||||
|
||||
public void setBusinessOwner(String businessOwner) {
|
||||
this.businessOwner = businessOwner;
|
||||
}
|
||||
|
||||
public APIBusinessInformation businessOwnerEmail(String businessOwnerEmail) {
|
||||
this.businessOwnerEmail = businessOwnerEmail;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get businessOwnerEmail
|
||||
* @return businessOwnerEmail
|
||||
**/
|
||||
@ApiModelProperty(example = "businessowner@wso2.com", value = "")
|
||||
public String getBusinessOwnerEmail() {
|
||||
return businessOwnerEmail;
|
||||
}
|
||||
|
||||
public void setBusinessOwnerEmail(String businessOwnerEmail) {
|
||||
this.businessOwnerEmail = businessOwnerEmail;
|
||||
}
|
||||
|
||||
public APIBusinessInformation technicalOwner(String technicalOwner) {
|
||||
this.technicalOwner = technicalOwner;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get technicalOwner
|
||||
* @return technicalOwner
|
||||
**/
|
||||
@ApiModelProperty(example = "technicalowner", value = "")
|
||||
public String getTechnicalOwner() {
|
||||
return technicalOwner;
|
||||
}
|
||||
|
||||
public void setTechnicalOwner(String technicalOwner) {
|
||||
this.technicalOwner = technicalOwner;
|
||||
}
|
||||
|
||||
public APIBusinessInformation technicalOwnerEmail(String technicalOwnerEmail) {
|
||||
this.technicalOwnerEmail = technicalOwnerEmail;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get technicalOwnerEmail
|
||||
* @return technicalOwnerEmail
|
||||
**/
|
||||
@ApiModelProperty(example = "technicalowner@wso2.com", value = "")
|
||||
public String getTechnicalOwnerEmail() {
|
||||
return technicalOwnerEmail;
|
||||
}
|
||||
|
||||
public void setTechnicalOwnerEmail(String technicalOwnerEmail) {
|
||||
this.technicalOwnerEmail = technicalOwnerEmail;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
APIBusinessInformation aPIBusinessInformation = (APIBusinessInformation) o;
|
||||
return Objects.equals(this.businessOwner, aPIBusinessInformation.businessOwner) &&
|
||||
Objects.equals(this.businessOwnerEmail, aPIBusinessInformation.businessOwnerEmail) &&
|
||||
Objects.equals(this.technicalOwner, aPIBusinessInformation.technicalOwner) &&
|
||||
Objects.equals(this.technicalOwnerEmail, aPIBusinessInformation.technicalOwnerEmail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(businessOwner, businessOwnerEmail, technicalOwner, technicalOwnerEmail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class APIBusinessInformation {\n");
|
||||
|
||||
sb.append(" businessOwner: ").append(toIndentedString(businessOwner)).append("\n");
|
||||
sb.append(" businessOwnerEmail: ").append(toIndentedString(businessOwnerEmail)).append("\n");
|
||||
sb.append(" technicalOwner: ").append(toIndentedString(technicalOwner)).append("\n");
|
||||
sb.append(" technicalOwnerEmail: ").append(toIndentedString(technicalOwnerEmail)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,145 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* APIEndpointURLs
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class APIEndpointURLs {
|
||||
@JsonProperty("environmentName")
|
||||
private String environmentName = null;
|
||||
|
||||
@JsonProperty("environmentType")
|
||||
private String environmentType = null;
|
||||
|
||||
@JsonProperty("environmentURLs")
|
||||
private APIEnvironmentURLs environmentURLs = null;
|
||||
|
||||
public APIEndpointURLs environmentName(String environmentName) {
|
||||
this.environmentName = environmentName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get environmentName
|
||||
* @return environmentName
|
||||
**/
|
||||
@ApiModelProperty(example = "Production and Sandbox", value = "")
|
||||
public String getEnvironmentName() {
|
||||
return environmentName;
|
||||
}
|
||||
|
||||
public void setEnvironmentName(String environmentName) {
|
||||
this.environmentName = environmentName;
|
||||
}
|
||||
|
||||
public APIEndpointURLs environmentType(String environmentType) {
|
||||
this.environmentType = environmentType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get environmentType
|
||||
* @return environmentType
|
||||
**/
|
||||
@ApiModelProperty(example = "hybrid", value = "")
|
||||
public String getEnvironmentType() {
|
||||
return environmentType;
|
||||
}
|
||||
|
||||
public void setEnvironmentType(String environmentType) {
|
||||
this.environmentType = environmentType;
|
||||
}
|
||||
|
||||
public APIEndpointURLs environmentURLs(APIEnvironmentURLs environmentURLs) {
|
||||
this.environmentURLs = environmentURLs;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get environmentURLs
|
||||
* @return environmentURLs
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public APIEnvironmentURLs getEnvironmentURLs() {
|
||||
return environmentURLs;
|
||||
}
|
||||
|
||||
public void setEnvironmentURLs(APIEnvironmentURLs environmentURLs) {
|
||||
this.environmentURLs = environmentURLs;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
APIEndpointURLs aPIEndpointURLs = (APIEndpointURLs) o;
|
||||
return Objects.equals(this.environmentName, aPIEndpointURLs.environmentName) &&
|
||||
Objects.equals(this.environmentType, aPIEndpointURLs.environmentType) &&
|
||||
Objects.equals(this.environmentURLs, aPIEndpointURLs.environmentURLs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(environmentName, environmentType, environmentURLs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class APIEndpointURLs {\n");
|
||||
|
||||
sb.append(" environmentName: ").append(toIndentedString(environmentName)).append("\n");
|
||||
sb.append(" environmentType: ").append(toIndentedString(environmentType)).append("\n");
|
||||
sb.append(" environmentURLs: ").append(toIndentedString(environmentURLs)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* APIEnvironmentURLs
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class APIEnvironmentURLs {
|
||||
@JsonProperty("http")
|
||||
private String http = null;
|
||||
|
||||
@JsonProperty("https")
|
||||
private String https = null;
|
||||
|
||||
public APIEnvironmentURLs http(String http) {
|
||||
this.http = http;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP environment URL
|
||||
* @return http
|
||||
**/
|
||||
@ApiModelProperty(example = "http://192.168.56.1:8280/phoneverify/1.0.0", value = "HTTP environment URL")
|
||||
public String getHttp() {
|
||||
return http;
|
||||
}
|
||||
|
||||
public void setHttp(String http) {
|
||||
this.http = http;
|
||||
}
|
||||
|
||||
public APIEnvironmentURLs https(String https) {
|
||||
this.https = https;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTPS environment URL
|
||||
* @return https
|
||||
**/
|
||||
@ApiModelProperty(example = "https://192.168.56.1:8243/phoneverify/1.0.0", value = "HTTPS environment URL")
|
||||
public String getHttps() {
|
||||
return https;
|
||||
}
|
||||
|
||||
public void setHttps(String https) {
|
||||
this.https = https;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
APIEnvironmentURLs aPIEnvironmentURLs = (APIEnvironmentURLs) o;
|
||||
return Objects.equals(this.http, aPIEnvironmentURLs.http) &&
|
||||
Objects.equals(this.https, aPIEnvironmentURLs.https);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(http, https);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class APIEnvironmentURLs {\n");
|
||||
|
||||
sb.append(" http: ").append(toIndentedString(http)).append("\n");
|
||||
sb.append(" https: ").append(toIndentedString(https)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,237 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* APIInfo
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class APIInfo {
|
||||
@JsonProperty("id")
|
||||
private String id = null;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("description")
|
||||
private String description = null;
|
||||
|
||||
@JsonProperty("context")
|
||||
private String context = null;
|
||||
|
||||
@JsonProperty("version")
|
||||
private String version = null;
|
||||
|
||||
@JsonProperty("provider")
|
||||
private String provider = null;
|
||||
|
||||
@JsonProperty("status")
|
||||
private String status = null;
|
||||
|
||||
public APIInfo id(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public APIInfo name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorAPI", value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public APIInfo description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
* @return description
|
||||
**/
|
||||
@ApiModelProperty(example = "A calculator API that supports basic operations", value = "")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public APIInfo context(String context) {
|
||||
this.context = context;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get context
|
||||
* @return context
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorAPI", value = "")
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(String context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public APIInfo version(String version) {
|
||||
this.version = version;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get version
|
||||
* @return version
|
||||
**/
|
||||
@ApiModelProperty(example = "1.0.0", value = "")
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public APIInfo provider(String provider) {
|
||||
this.provider = provider;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the provider value is not given, the user invoking the API will be used as the provider.
|
||||
* @return provider
|
||||
**/
|
||||
@ApiModelProperty(example = "admin", value = "If the provider value is not given, the user invoking the API will be used as the provider. ")
|
||||
public String getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
public void setProvider(String provider) {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
public APIInfo status(String status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(example = "PUBLISHED", value = "")
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
APIInfo aPIInfo = (APIInfo) o;
|
||||
return Objects.equals(this.id, aPIInfo.id) &&
|
||||
Objects.equals(this.name, aPIInfo.name) &&
|
||||
Objects.equals(this.description, aPIInfo.description) &&
|
||||
Objects.equals(this.context, aPIInfo.context) &&
|
||||
Objects.equals(this.version, aPIInfo.version) &&
|
||||
Objects.equals(this.provider, aPIInfo.provider) &&
|
||||
Objects.equals(this.status, aPIInfo.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, description, context, version, provider, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class APIInfo {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" context: ").append(toIndentedString(context)).append("\n");
|
||||
sb.append(" version: ").append(toIndentedString(version)).append("\n");
|
||||
sb.append(" provider: ").append(toIndentedString(provider)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* APIList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class APIList {
|
||||
@JsonProperty("count")
|
||||
private Integer count = null;
|
||||
|
||||
@JsonProperty("next")
|
||||
private String next = null;
|
||||
|
||||
@JsonProperty("previous")
|
||||
private String previous = null;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<APIInfo> list = new ArrayList<APIInfo>();
|
||||
|
||||
public APIList count(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of APIs returned.
|
||||
* @return count
|
||||
**/
|
||||
@ApiModelProperty(example = "1", value = "Number of APIs returned. ")
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public APIList next(String next) {
|
||||
this.next = next;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the next subset of resources qualified. Empty if no more resources are to be returned.
|
||||
* @return next
|
||||
**/
|
||||
@ApiModelProperty(example = "/apis?limit=1&offset=2&query=", value = "Link to the next subset of resources qualified. Empty if no more resources are to be returned. ")
|
||||
public String getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(String next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public APIList previous(String previous) {
|
||||
this.previous = previous;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the previous subset of resources qualified. Empty if current subset is the first subset returned.
|
||||
* @return previous
|
||||
**/
|
||||
@ApiModelProperty(example = "/apis?limit=1&offset=0&query=", value = "Link to the previous subset of resources qualified. Empty if current subset is the first subset returned. ")
|
||||
public String getPrevious() {
|
||||
return previous;
|
||||
}
|
||||
|
||||
public void setPrevious(String previous) {
|
||||
this.previous = previous;
|
||||
}
|
||||
|
||||
public APIList list(List<APIInfo> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public APIList addListItem(APIInfo listItem) {
|
||||
this.list.add(listItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
* @return list
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<APIInfo> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<APIInfo> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
APIList aPIList = (APIList) o;
|
||||
return Objects.equals(this.count, aPIList.count) &&
|
||||
Objects.equals(this.next, aPIList.next) &&
|
||||
Objects.equals(this.previous, aPIList.previous) &&
|
||||
Objects.equals(this.list, aPIList.list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(count, next, previous, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class APIList {\n");
|
||||
|
||||
sb.append(" count: ").append(toIndentedString(count)).append("\n");
|
||||
sb.append(" next: ").append(toIndentedString(next)).append("\n");
|
||||
sb.append(" previous: ").append(toIndentedString(previous)).append("\n");
|
||||
sb.append(" list: ").append(toIndentedString(list)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,290 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Application
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class Application {
|
||||
@JsonProperty("applicationId")
|
||||
private String applicationId = null;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("subscriber")
|
||||
private String subscriber = null;
|
||||
|
||||
@JsonProperty("throttlingTier")
|
||||
private String throttlingTier = null;
|
||||
|
||||
@JsonProperty("callbackUrl")
|
||||
private String callbackUrl = null;
|
||||
|
||||
@JsonProperty("description")
|
||||
private String description = null;
|
||||
|
||||
@JsonProperty("status")
|
||||
private String status = "";
|
||||
|
||||
@JsonProperty("groupId")
|
||||
private String groupId = null;
|
||||
|
||||
@JsonProperty("keys")
|
||||
private List<ApplicationKey> keys = new ArrayList<ApplicationKey>();
|
||||
|
||||
public Application applicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get applicationId
|
||||
* @return applicationId
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "")
|
||||
public String getApplicationId() {
|
||||
return applicationId;
|
||||
}
|
||||
|
||||
public void setApplicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
}
|
||||
|
||||
public Application name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorApp", required = true, value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Application subscriber(String subscriber) {
|
||||
this.subscriber = subscriber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If subscriber is not given user invoking the API will be taken as the subscriber.
|
||||
* @return subscriber
|
||||
**/
|
||||
@ApiModelProperty(example = "admin", value = "If subscriber is not given user invoking the API will be taken as the subscriber. ")
|
||||
public String getSubscriber() {
|
||||
return subscriber;
|
||||
}
|
||||
|
||||
public void setSubscriber(String subscriber) {
|
||||
this.subscriber = subscriber;
|
||||
}
|
||||
|
||||
public Application throttlingTier(String throttlingTier) {
|
||||
this.throttlingTier = throttlingTier;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get throttlingTier
|
||||
* @return throttlingTier
|
||||
**/
|
||||
@ApiModelProperty(example = "Unlimited", required = true, value = "")
|
||||
public String getThrottlingTier() {
|
||||
return throttlingTier;
|
||||
}
|
||||
|
||||
public void setThrottlingTier(String throttlingTier) {
|
||||
this.throttlingTier = throttlingTier;
|
||||
}
|
||||
|
||||
public Application callbackUrl(String callbackUrl) {
|
||||
this.callbackUrl = callbackUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get callbackUrl
|
||||
* @return callbackUrl
|
||||
**/
|
||||
@ApiModelProperty(example = "", value = "")
|
||||
public String getCallbackUrl() {
|
||||
return callbackUrl;
|
||||
}
|
||||
|
||||
public void setCallbackUrl(String callbackUrl) {
|
||||
this.callbackUrl = callbackUrl;
|
||||
}
|
||||
|
||||
public Application description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
* @return description
|
||||
**/
|
||||
@ApiModelProperty(example = "Sample calculator application", value = "")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Application status(String status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(example = "APPROVED", value = "")
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Application groupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get groupId
|
||||
* @return groupId
|
||||
**/
|
||||
@ApiModelProperty(example = "", value = "")
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public Application keys(List<ApplicationKey> keys) {
|
||||
this.keys = keys;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Application addKeysItem(ApplicationKey keysItem) {
|
||||
this.keys.add(keysItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get keys
|
||||
* @return keys
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<ApplicationKey> getKeys() {
|
||||
return keys;
|
||||
}
|
||||
|
||||
public void setKeys(List<ApplicationKey> keys) {
|
||||
this.keys = keys;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Application application = (Application) o;
|
||||
return Objects.equals(this.applicationId, application.applicationId) &&
|
||||
Objects.equals(this.name, application.name) &&
|
||||
Objects.equals(this.subscriber, application.subscriber) &&
|
||||
Objects.equals(this.throttlingTier, application.throttlingTier) &&
|
||||
Objects.equals(this.callbackUrl, application.callbackUrl) &&
|
||||
Objects.equals(this.description, application.description) &&
|
||||
Objects.equals(this.status, application.status) &&
|
||||
Objects.equals(this.groupId, application.groupId) &&
|
||||
Objects.equals(this.keys, application.keys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(applicationId, name, subscriber, throttlingTier, callbackUrl, description, status, groupId, keys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Application {\n");
|
||||
|
||||
sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" subscriber: ").append(toIndentedString(subscriber)).append("\n");
|
||||
sb.append(" throttlingTier: ").append(toIndentedString(throttlingTier)).append("\n");
|
||||
sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n");
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n");
|
||||
sb.append(" keys: ").append(toIndentedString(keys)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,237 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* ApplicationInfo
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class ApplicationInfo {
|
||||
@JsonProperty("applicationId")
|
||||
private String applicationId = null;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("subscriber")
|
||||
private String subscriber = null;
|
||||
|
||||
@JsonProperty("throttlingTier")
|
||||
private String throttlingTier = null;
|
||||
|
||||
@JsonProperty("description")
|
||||
private String description = null;
|
||||
|
||||
@JsonProperty("status")
|
||||
private String status = null;
|
||||
|
||||
@JsonProperty("groupId")
|
||||
private String groupId = null;
|
||||
|
||||
public ApplicationInfo applicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get applicationId
|
||||
* @return applicationId
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "")
|
||||
public String getApplicationId() {
|
||||
return applicationId;
|
||||
}
|
||||
|
||||
public void setApplicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
}
|
||||
|
||||
public ApplicationInfo name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorApp", value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public ApplicationInfo subscriber(String subscriber) {
|
||||
this.subscriber = subscriber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get subscriber
|
||||
* @return subscriber
|
||||
**/
|
||||
@ApiModelProperty(example = "admin", value = "")
|
||||
public String getSubscriber() {
|
||||
return subscriber;
|
||||
}
|
||||
|
||||
public void setSubscriber(String subscriber) {
|
||||
this.subscriber = subscriber;
|
||||
}
|
||||
|
||||
public ApplicationInfo throttlingTier(String throttlingTier) {
|
||||
this.throttlingTier = throttlingTier;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get throttlingTier
|
||||
* @return throttlingTier
|
||||
**/
|
||||
@ApiModelProperty(example = "Unlimited", value = "")
|
||||
public String getThrottlingTier() {
|
||||
return throttlingTier;
|
||||
}
|
||||
|
||||
public void setThrottlingTier(String throttlingTier) {
|
||||
this.throttlingTier = throttlingTier;
|
||||
}
|
||||
|
||||
public ApplicationInfo description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
* @return description
|
||||
**/
|
||||
@ApiModelProperty(example = "Sample calculator application", value = "")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public ApplicationInfo status(String status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(example = "APPROVED", value = "")
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public ApplicationInfo groupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get groupId
|
||||
* @return groupId
|
||||
**/
|
||||
@ApiModelProperty(example = "", value = "")
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ApplicationInfo applicationInfo = (ApplicationInfo) o;
|
||||
return Objects.equals(this.applicationId, applicationInfo.applicationId) &&
|
||||
Objects.equals(this.name, applicationInfo.name) &&
|
||||
Objects.equals(this.subscriber, applicationInfo.subscriber) &&
|
||||
Objects.equals(this.throttlingTier, applicationInfo.throttlingTier) &&
|
||||
Objects.equals(this.description, applicationInfo.description) &&
|
||||
Objects.equals(this.status, applicationInfo.status) &&
|
||||
Objects.equals(this.groupId, applicationInfo.groupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(applicationId, name, subscriber, throttlingTier, description, status, groupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ApplicationInfo {\n");
|
||||
|
||||
sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" subscriber: ").append(toIndentedString(subscriber)).append("\n");
|
||||
sb.append(" throttlingTier: ").append(toIndentedString(throttlingTier)).append("\n");
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" groupId: ").append(toIndentedString(groupId)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,252 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* ApplicationKey
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class ApplicationKey {
|
||||
@JsonProperty("consumerKey")
|
||||
private String consumerKey = null;
|
||||
|
||||
@JsonProperty("consumerSecret")
|
||||
private String consumerSecret = null;
|
||||
|
||||
@JsonProperty("supportedGrantTypes")
|
||||
private List<String> supportedGrantTypes = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("keyState")
|
||||
private String keyState = null;
|
||||
|
||||
/**
|
||||
* Key type
|
||||
*/
|
||||
public enum KeyTypeEnum {
|
||||
PRODUCTION("PRODUCTION"),
|
||||
|
||||
SANDBOX("SANDBOX");
|
||||
|
||||
private String value;
|
||||
|
||||
KeyTypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static KeyTypeEnum fromValue(String text) {
|
||||
for (KeyTypeEnum b : KeyTypeEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("keyType")
|
||||
private KeyTypeEnum keyType = null;
|
||||
|
||||
@JsonProperty("token")
|
||||
private Token token = null;
|
||||
|
||||
public ApplicationKey consumerKey(String consumerKey) {
|
||||
this.consumerKey = consumerKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumer key of the application
|
||||
* @return consumerKey
|
||||
**/
|
||||
@ApiModelProperty(example = "vYDoc9s7IgAFdkSyNDaswBX7ejoa", value = "Consumer key of the application")
|
||||
public String getConsumerKey() {
|
||||
return consumerKey;
|
||||
}
|
||||
|
||||
public void setConsumerKey(String consumerKey) {
|
||||
this.consumerKey = consumerKey;
|
||||
}
|
||||
|
||||
public ApplicationKey consumerSecret(String consumerSecret) {
|
||||
this.consumerSecret = consumerSecret;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumer secret of the application
|
||||
* @return consumerSecret
|
||||
**/
|
||||
@ApiModelProperty(example = "TIDlOFkpzB7WjufO3OJUhy1fsvAa", value = "Consumer secret of the application")
|
||||
public String getConsumerSecret() {
|
||||
return consumerSecret;
|
||||
}
|
||||
|
||||
public void setConsumerSecret(String consumerSecret) {
|
||||
this.consumerSecret = consumerSecret;
|
||||
}
|
||||
|
||||
public ApplicationKey supportedGrantTypes(List<String> supportedGrantTypes) {
|
||||
this.supportedGrantTypes = supportedGrantTypes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ApplicationKey addSupportedGrantTypesItem(String supportedGrantTypesItem) {
|
||||
this.supportedGrantTypes.add(supportedGrantTypesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported grant types for the application
|
||||
* @return supportedGrantTypes
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "Supported grant types for the application")
|
||||
public List<String> getSupportedGrantTypes() {
|
||||
return supportedGrantTypes;
|
||||
}
|
||||
|
||||
public void setSupportedGrantTypes(List<String> supportedGrantTypes) {
|
||||
this.supportedGrantTypes = supportedGrantTypes;
|
||||
}
|
||||
|
||||
public ApplicationKey keyState(String keyState) {
|
||||
this.keyState = keyState;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the key generation of the application
|
||||
* @return keyState
|
||||
**/
|
||||
@ApiModelProperty(example = "APPROVED", value = "State of the key generation of the application")
|
||||
public String getKeyState() {
|
||||
return keyState;
|
||||
}
|
||||
|
||||
public void setKeyState(String keyState) {
|
||||
this.keyState = keyState;
|
||||
}
|
||||
|
||||
public ApplicationKey keyType(KeyTypeEnum keyType) {
|
||||
this.keyType = keyType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Key type
|
||||
* @return keyType
|
||||
**/
|
||||
@ApiModelProperty(example = "PRODUCTION", value = "Key type")
|
||||
public KeyTypeEnum getKeyType() {
|
||||
return keyType;
|
||||
}
|
||||
|
||||
public void setKeyType(KeyTypeEnum keyType) {
|
||||
this.keyType = keyType;
|
||||
}
|
||||
|
||||
public ApplicationKey token(Token token) {
|
||||
this.token = token;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get token
|
||||
* @return token
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public Token getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(Token token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ApplicationKey applicationKey = (ApplicationKey) o;
|
||||
return Objects.equals(this.consumerKey, applicationKey.consumerKey) &&
|
||||
Objects.equals(this.consumerSecret, applicationKey.consumerSecret) &&
|
||||
Objects.equals(this.supportedGrantTypes, applicationKey.supportedGrantTypes) &&
|
||||
Objects.equals(this.keyState, applicationKey.keyState) &&
|
||||
Objects.equals(this.keyType, applicationKey.keyType) &&
|
||||
Objects.equals(this.token, applicationKey.token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(consumerKey, consumerSecret, supportedGrantTypes, keyState, keyType, token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ApplicationKey {\n");
|
||||
|
||||
sb.append(" consumerKey: ").append(toIndentedString(consumerKey)).append("\n");
|
||||
sb.append(" consumerSecret: ").append(toIndentedString(consumerSecret)).append("\n");
|
||||
sb.append(" supportedGrantTypes: ").append(toIndentedString(supportedGrantTypes)).append("\n");
|
||||
sb.append(" keyState: ").append(toIndentedString(keyState)).append("\n");
|
||||
sb.append(" keyType: ").append(toIndentedString(keyType)).append("\n");
|
||||
sb.append(" token: ").append(toIndentedString(token)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,234 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* ApplicationKeyGenerateRequest
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class ApplicationKeyGenerateRequest {
|
||||
/**
|
||||
* Gets or Sets keyType
|
||||
*/
|
||||
public enum KeyTypeEnum {
|
||||
PRODUCTION("PRODUCTION"),
|
||||
|
||||
SANDBOX("SANDBOX");
|
||||
|
||||
private String value;
|
||||
|
||||
KeyTypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static KeyTypeEnum fromValue(String text) {
|
||||
for (KeyTypeEnum b : KeyTypeEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("keyType")
|
||||
private KeyTypeEnum keyType = null;
|
||||
|
||||
@JsonProperty("validityTime")
|
||||
private String validityTime = null;
|
||||
|
||||
@JsonProperty("callbackUrl")
|
||||
private String callbackUrl = null;
|
||||
|
||||
@JsonProperty("accessAllowDomains")
|
||||
private List<String> accessAllowDomains = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("scopes")
|
||||
private List<String> scopes = new ArrayList<String>();
|
||||
|
||||
public ApplicationKeyGenerateRequest keyType(KeyTypeEnum keyType) {
|
||||
this.keyType = keyType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get keyType
|
||||
* @return keyType
|
||||
**/
|
||||
@ApiModelProperty(example = "PRODUCTION", required = true, value = "")
|
||||
public KeyTypeEnum getKeyType() {
|
||||
return keyType;
|
||||
}
|
||||
|
||||
public void setKeyType(KeyTypeEnum keyType) {
|
||||
this.keyType = keyType;
|
||||
}
|
||||
|
||||
public ApplicationKeyGenerateRequest validityTime(String validityTime) {
|
||||
this.validityTime = validityTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get validityTime
|
||||
* @return validityTime
|
||||
**/
|
||||
@ApiModelProperty(example = "3600", required = true, value = "")
|
||||
public String getValidityTime() {
|
||||
return validityTime;
|
||||
}
|
||||
|
||||
public void setValidityTime(String validityTime) {
|
||||
this.validityTime = validityTime;
|
||||
}
|
||||
|
||||
public ApplicationKeyGenerateRequest callbackUrl(String callbackUrl) {
|
||||
this.callbackUrl = callbackUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback URL
|
||||
* @return callbackUrl
|
||||
**/
|
||||
@ApiModelProperty(example = "", value = "Callback URL")
|
||||
public String getCallbackUrl() {
|
||||
return callbackUrl;
|
||||
}
|
||||
|
||||
public void setCallbackUrl(String callbackUrl) {
|
||||
this.callbackUrl = callbackUrl;
|
||||
}
|
||||
|
||||
public ApplicationKeyGenerateRequest accessAllowDomains(List<String> accessAllowDomains) {
|
||||
this.accessAllowDomains = accessAllowDomains;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ApplicationKeyGenerateRequest addAccessAllowDomainsItem(String accessAllowDomainsItem) {
|
||||
this.accessAllowDomains.add(accessAllowDomainsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allowed domains for the access token
|
||||
* @return accessAllowDomains
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "Allowed domains for the access token")
|
||||
public List<String> getAccessAllowDomains() {
|
||||
return accessAllowDomains;
|
||||
}
|
||||
|
||||
public void setAccessAllowDomains(List<String> accessAllowDomains) {
|
||||
this.accessAllowDomains = accessAllowDomains;
|
||||
}
|
||||
|
||||
public ApplicationKeyGenerateRequest scopes(List<String> scopes) {
|
||||
this.scopes = scopes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ApplicationKeyGenerateRequest addScopesItem(String scopesItem) {
|
||||
this.scopes.add(scopesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allowed scopes for the access token
|
||||
* @return scopes
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "Allowed scopes for the access token")
|
||||
public List<String> getScopes() {
|
||||
return scopes;
|
||||
}
|
||||
|
||||
public void setScopes(List<String> scopes) {
|
||||
this.scopes = scopes;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ApplicationKeyGenerateRequest applicationKeyGenerateRequest = (ApplicationKeyGenerateRequest) o;
|
||||
return Objects.equals(this.keyType, applicationKeyGenerateRequest.keyType) &&
|
||||
Objects.equals(this.validityTime, applicationKeyGenerateRequest.validityTime) &&
|
||||
Objects.equals(this.callbackUrl, applicationKeyGenerateRequest.callbackUrl) &&
|
||||
Objects.equals(this.accessAllowDomains, applicationKeyGenerateRequest.accessAllowDomains) &&
|
||||
Objects.equals(this.scopes, applicationKeyGenerateRequest.scopes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(keyType, validityTime, callbackUrl, accessAllowDomains, scopes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ApplicationKeyGenerateRequest {\n");
|
||||
|
||||
sb.append(" keyType: ").append(toIndentedString(keyType)).append("\n");
|
||||
sb.append(" validityTime: ").append(toIndentedString(validityTime)).append("\n");
|
||||
sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n");
|
||||
sb.append(" accessAllowDomains: ").append(toIndentedString(accessAllowDomains)).append("\n");
|
||||
sb.append(" scopes: ").append(toIndentedString(scopes)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* ApplicationList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class ApplicationList {
|
||||
@JsonProperty("count")
|
||||
private Integer count = null;
|
||||
|
||||
@JsonProperty("next")
|
||||
private String next = null;
|
||||
|
||||
@JsonProperty("previous")
|
||||
private String previous = null;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<ApplicationInfo> list = new ArrayList<ApplicationInfo>();
|
||||
|
||||
public ApplicationList count(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of applications returned.
|
||||
* @return count
|
||||
**/
|
||||
@ApiModelProperty(example = "1", value = "Number of applications returned. ")
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public ApplicationList next(String next) {
|
||||
this.next = next;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the next subset of resources qualified. Empty if no more resources are to be returned.
|
||||
* @return next
|
||||
**/
|
||||
@ApiModelProperty(example = "/applications?limit=1&offset=2&groupId=", value = "Link to the next subset of resources qualified. Empty if no more resources are to be returned. ")
|
||||
public String getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(String next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public ApplicationList previous(String previous) {
|
||||
this.previous = previous;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the previous subset of resources qualified. Empty if current subset is the first subset returned.
|
||||
* @return previous
|
||||
**/
|
||||
@ApiModelProperty(example = "/applications?limit=1&offset=0&groupId=", value = "Link to the previous subset of resources qualified. Empty if current subset is the first subset returned. ")
|
||||
public String getPrevious() {
|
||||
return previous;
|
||||
}
|
||||
|
||||
public void setPrevious(String previous) {
|
||||
this.previous = previous;
|
||||
}
|
||||
|
||||
public ApplicationList list(List<ApplicationInfo> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ApplicationList addListItem(ApplicationInfo listItem) {
|
||||
this.list.add(listItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
* @return list
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<ApplicationInfo> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<ApplicationInfo> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ApplicationList applicationList = (ApplicationList) o;
|
||||
return Objects.equals(this.count, applicationList.count) &&
|
||||
Objects.equals(this.next, applicationList.next) &&
|
||||
Objects.equals(this.previous, applicationList.previous) &&
|
||||
Objects.equals(this.list, applicationList.list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(count, next, previous, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ApplicationList {\n");
|
||||
|
||||
sb.append(" count: ").append(toIndentedString(count)).append("\n");
|
||||
sb.append(" next: ").append(toIndentedString(next)).append("\n");
|
||||
sb.append(" previous: ").append(toIndentedString(previous)).append("\n");
|
||||
sb.append(" list: ").append(toIndentedString(list)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,310 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Document
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class Document {
|
||||
@JsonProperty("documentId")
|
||||
private String documentId = null;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets type
|
||||
*/
|
||||
public enum TypeEnum {
|
||||
HOWTO("HOWTO"),
|
||||
|
||||
SAMPLES("SAMPLES"),
|
||||
|
||||
PUBLIC_FORUM("PUBLIC_FORUM"),
|
||||
|
||||
SUPPORT_FORUM("SUPPORT_FORUM"),
|
||||
|
||||
API_MESSAGE_FORMAT("API_MESSAGE_FORMAT"),
|
||||
|
||||
SWAGGER_DOC("SWAGGER_DOC"),
|
||||
|
||||
OTHER("OTHER");
|
||||
|
||||
private String value;
|
||||
|
||||
TypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static TypeEnum fromValue(String text) {
|
||||
for (TypeEnum b : TypeEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("type")
|
||||
private TypeEnum type = null;
|
||||
|
||||
@JsonProperty("summary")
|
||||
private String summary = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets sourceType
|
||||
*/
|
||||
public enum SourceTypeEnum {
|
||||
INLINE("INLINE"),
|
||||
|
||||
URL("URL"),
|
||||
|
||||
FILE("FILE");
|
||||
|
||||
private String value;
|
||||
|
||||
SourceTypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static SourceTypeEnum fromValue(String text) {
|
||||
for (SourceTypeEnum b : SourceTypeEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("sourceType")
|
||||
private SourceTypeEnum sourceType = null;
|
||||
|
||||
@JsonProperty("sourceUrl")
|
||||
private String sourceUrl = null;
|
||||
|
||||
@JsonProperty("otherTypeName")
|
||||
private String otherTypeName = null;
|
||||
|
||||
public Document documentId(String documentId) {
|
||||
this.documentId = documentId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get documentId
|
||||
* @return documentId
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "")
|
||||
public String getDocumentId() {
|
||||
return documentId;
|
||||
}
|
||||
|
||||
public void setDocumentId(String documentId) {
|
||||
this.documentId = documentId;
|
||||
}
|
||||
|
||||
public Document name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "CalculatorDoc", required = true, value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Document type(TypeEnum type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
**/
|
||||
@ApiModelProperty(example = "HOWTO", required = true, value = "")
|
||||
public TypeEnum getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(TypeEnum type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Document summary(String summary) {
|
||||
this.summary = summary;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get summary
|
||||
* @return summary
|
||||
**/
|
||||
@ApiModelProperty(example = "Summary of Calculator Documentation", value = "")
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public Document sourceType(SourceTypeEnum sourceType) {
|
||||
this.sourceType = sourceType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sourceType
|
||||
* @return sourceType
|
||||
**/
|
||||
@ApiModelProperty(example = "INLINE", required = true, value = "")
|
||||
public SourceTypeEnum getSourceType() {
|
||||
return sourceType;
|
||||
}
|
||||
|
||||
public void setSourceType(SourceTypeEnum sourceType) {
|
||||
this.sourceType = sourceType;
|
||||
}
|
||||
|
||||
public Document sourceUrl(String sourceUrl) {
|
||||
this.sourceUrl = sourceUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sourceUrl
|
||||
* @return sourceUrl
|
||||
**/
|
||||
@ApiModelProperty(example = "", value = "")
|
||||
public String getSourceUrl() {
|
||||
return sourceUrl;
|
||||
}
|
||||
|
||||
public void setSourceUrl(String sourceUrl) {
|
||||
this.sourceUrl = sourceUrl;
|
||||
}
|
||||
|
||||
public Document otherTypeName(String otherTypeName) {
|
||||
this.otherTypeName = otherTypeName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get otherTypeName
|
||||
* @return otherTypeName
|
||||
**/
|
||||
@ApiModelProperty(example = "", value = "")
|
||||
public String getOtherTypeName() {
|
||||
return otherTypeName;
|
||||
}
|
||||
|
||||
public void setOtherTypeName(String otherTypeName) {
|
||||
this.otherTypeName = otherTypeName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Document document = (Document) o;
|
||||
return Objects.equals(this.documentId, document.documentId) &&
|
||||
Objects.equals(this.name, document.name) &&
|
||||
Objects.equals(this.type, document.type) &&
|
||||
Objects.equals(this.summary, document.summary) &&
|
||||
Objects.equals(this.sourceType, document.sourceType) &&
|
||||
Objects.equals(this.sourceUrl, document.sourceUrl) &&
|
||||
Objects.equals(this.otherTypeName, document.otherTypeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(documentId, name, type, summary, sourceType, sourceUrl, otherTypeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Document {\n");
|
||||
|
||||
sb.append(" documentId: ").append(toIndentedString(documentId)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" type: ").append(toIndentedString(type)).append("\n");
|
||||
sb.append(" summary: ").append(toIndentedString(summary)).append("\n");
|
||||
sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n");
|
||||
sb.append(" sourceUrl: ").append(toIndentedString(sourceUrl)).append("\n");
|
||||
sb.append(" otherTypeName: ").append(toIndentedString(otherTypeName)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* DocumentList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class DocumentList {
|
||||
@JsonProperty("count")
|
||||
private Integer count = null;
|
||||
|
||||
@JsonProperty("next")
|
||||
private String next = null;
|
||||
|
||||
@JsonProperty("previous")
|
||||
private String previous = null;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<Document> list = new ArrayList<Document>();
|
||||
|
||||
public DocumentList count(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of Documents returned.
|
||||
* @return count
|
||||
**/
|
||||
@ApiModelProperty(example = "1", value = "Number of Documents returned. ")
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public DocumentList next(String next) {
|
||||
this.next = next;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the next subset of resources qualified. Empty if no more resources are to be returned.
|
||||
* @return next
|
||||
**/
|
||||
@ApiModelProperty(example = "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=2", value = "Link to the next subset of resources qualified. Empty if no more resources are to be returned. ")
|
||||
public String getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(String next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public DocumentList previous(String previous) {
|
||||
this.previous = previous;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the previous subset of resources qualified. Empty if current subset is the first subset returned.
|
||||
* @return previous
|
||||
**/
|
||||
@ApiModelProperty(example = "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=0", value = "Link to the previous subset of resources qualified. Empty if current subset is the first subset returned. ")
|
||||
public String getPrevious() {
|
||||
return previous;
|
||||
}
|
||||
|
||||
public void setPrevious(String previous) {
|
||||
this.previous = previous;
|
||||
}
|
||||
|
||||
public DocumentList list(List<Document> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DocumentList addListItem(Document listItem) {
|
||||
this.list.add(listItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
* @return list
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<Document> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<Document> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DocumentList documentList = (DocumentList) o;
|
||||
return Objects.equals(this.count, documentList.count) &&
|
||||
Objects.equals(this.next, documentList.next) &&
|
||||
Objects.equals(this.previous, documentList.previous) &&
|
||||
Objects.equals(this.list, documentList.list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(count, next, previous, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DocumentList {\n");
|
||||
|
||||
sb.append(" count: ").append(toIndentedString(count)).append("\n");
|
||||
sb.append(" next: ").append(toIndentedString(next)).append("\n");
|
||||
sb.append(" previous: ").append(toIndentedString(previous)).append("\n");
|
||||
sb.append(" list: ").append(toIndentedString(list)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,198 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Error
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class Error {
|
||||
@JsonProperty("code")
|
||||
private Long code = null;
|
||||
|
||||
@JsonProperty("message")
|
||||
private String message = null;
|
||||
|
||||
@JsonProperty("description")
|
||||
private String description = null;
|
||||
|
||||
@JsonProperty("moreInfo")
|
||||
private String moreInfo = null;
|
||||
|
||||
@JsonProperty("error")
|
||||
private List<ErrorListItem> error = new ArrayList<ErrorListItem>();
|
||||
|
||||
public Error code(Long code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get code
|
||||
* @return code
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
public Long getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Long code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Error message(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Error message.
|
||||
* @return message
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "Error message.")
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Error description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A detail description about the error message.
|
||||
* @return description
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "A detail description about the error message. ")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Error moreInfo(String moreInfo) {
|
||||
this.moreInfo = moreInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Preferably an url with more details about the error.
|
||||
* @return moreInfo
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "Preferably an url with more details about the error. ")
|
||||
public String getMoreInfo() {
|
||||
return moreInfo;
|
||||
}
|
||||
|
||||
public void setMoreInfo(String moreInfo) {
|
||||
this.moreInfo = moreInfo;
|
||||
}
|
||||
|
||||
public Error error(List<ErrorListItem> error) {
|
||||
this.error = error;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Error addErrorItem(ErrorListItem errorItem) {
|
||||
this.error.add(errorItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If there are more than one error list them out. For example, list out validation errors by each field.
|
||||
* @return error
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "If there are more than one error list them out. For example, list out validation errors by each field. ")
|
||||
public List<ErrorListItem> getError() {
|
||||
return error;
|
||||
}
|
||||
|
||||
public void setError(List<ErrorListItem> error) {
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Error error = (Error) o;
|
||||
return Objects.equals(this.code, error.code) &&
|
||||
Objects.equals(this.message, error.message) &&
|
||||
Objects.equals(this.description, error.description) &&
|
||||
Objects.equals(this.moreInfo, error.moreInfo) &&
|
||||
Objects.equals(this.error, error.error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(code, message, description, moreInfo, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Error {\n");
|
||||
|
||||
sb.append(" code: ").append(toIndentedString(code)).append("\n");
|
||||
sb.append(" message: ").append(toIndentedString(message)).append("\n");
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" moreInfo: ").append(toIndentedString(moreInfo)).append("\n");
|
||||
sb.append(" error: ").append(toIndentedString(error)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* ErrorListItem
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class ErrorListItem {
|
||||
@JsonProperty("code")
|
||||
private String code = null;
|
||||
|
||||
@JsonProperty("message")
|
||||
private String message = null;
|
||||
|
||||
public ErrorListItem code(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get code
|
||||
* @return code
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public ErrorListItem message(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description about individual errors occurred
|
||||
* @return message
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "Description about individual errors occurred ")
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ErrorListItem errorListItem = (ErrorListItem) o;
|
||||
return Objects.equals(this.code, errorListItem.code) &&
|
||||
Objects.equals(this.message, errorListItem.message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(code, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ErrorListItem {\n");
|
||||
|
||||
sb.append(" code: ").append(toIndentedString(code)).append("\n");
|
||||
sb.append(" message: ").append(toIndentedString(message)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,228 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Subscription
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class Subscription {
|
||||
@JsonProperty("subscriptionId")
|
||||
private String subscriptionId = null;
|
||||
|
||||
@JsonProperty("applicationId")
|
||||
private String applicationId = null;
|
||||
|
||||
@JsonProperty("apiIdentifier")
|
||||
private String apiIdentifier = null;
|
||||
|
||||
@JsonProperty("tier")
|
||||
private String tier = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets status
|
||||
*/
|
||||
public enum StatusEnum {
|
||||
BLOCKED("BLOCKED"),
|
||||
|
||||
PROD_ONLY_BLOCKED("PROD_ONLY_BLOCKED"),
|
||||
|
||||
UNBLOCKED("UNBLOCKED"),
|
||||
|
||||
ON_HOLD("ON_HOLD"),
|
||||
|
||||
REJECTED("REJECTED");
|
||||
|
||||
private String value;
|
||||
|
||||
StatusEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static StatusEnum fromValue(String text) {
|
||||
for (StatusEnum b : StatusEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("status")
|
||||
private StatusEnum status = null;
|
||||
|
||||
public Subscription subscriptionId(String subscriptionId) {
|
||||
this.subscriptionId = subscriptionId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get subscriptionId
|
||||
* @return subscriptionId
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "")
|
||||
public String getSubscriptionId() {
|
||||
return subscriptionId;
|
||||
}
|
||||
|
||||
public void setSubscriptionId(String subscriptionId) {
|
||||
this.subscriptionId = subscriptionId;
|
||||
}
|
||||
|
||||
public Subscription applicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get applicationId
|
||||
* @return applicationId
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", required = true, value = "")
|
||||
public String getApplicationId() {
|
||||
return applicationId;
|
||||
}
|
||||
|
||||
public void setApplicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
}
|
||||
|
||||
public Subscription apiIdentifier(String apiIdentifier) {
|
||||
this.apiIdentifier = apiIdentifier;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get apiIdentifier
|
||||
* @return apiIdentifier
|
||||
**/
|
||||
@ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", required = true, value = "")
|
||||
public String getApiIdentifier() {
|
||||
return apiIdentifier;
|
||||
}
|
||||
|
||||
public void setApiIdentifier(String apiIdentifier) {
|
||||
this.apiIdentifier = apiIdentifier;
|
||||
}
|
||||
|
||||
public Subscription tier(String tier) {
|
||||
this.tier = tier;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tier
|
||||
* @return tier
|
||||
**/
|
||||
@ApiModelProperty(example = "Unlimited", required = true, value = "")
|
||||
public String getTier() {
|
||||
return tier;
|
||||
}
|
||||
|
||||
public void setTier(String tier) {
|
||||
this.tier = tier;
|
||||
}
|
||||
|
||||
public Subscription status(StatusEnum status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(example = "UNBLOCKED", value = "")
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(StatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Subscription subscription = (Subscription) o;
|
||||
return Objects.equals(this.subscriptionId, subscription.subscriptionId) &&
|
||||
Objects.equals(this.applicationId, subscription.applicationId) &&
|
||||
Objects.equals(this.apiIdentifier, subscription.apiIdentifier) &&
|
||||
Objects.equals(this.tier, subscription.tier) &&
|
||||
Objects.equals(this.status, subscription.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(subscriptionId, applicationId, apiIdentifier, tier, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Subscription {\n");
|
||||
|
||||
sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n");
|
||||
sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n");
|
||||
sb.append(" apiIdentifier: ").append(toIndentedString(apiIdentifier)).append("\n");
|
||||
sb.append(" tier: ").append(toIndentedString(tier)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* SubscriptionList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class SubscriptionList {
|
||||
@JsonProperty("count")
|
||||
private Integer count = null;
|
||||
|
||||
@JsonProperty("next")
|
||||
private String next = null;
|
||||
|
||||
@JsonProperty("previous")
|
||||
private String previous = null;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<Subscription> list = new ArrayList<Subscription>();
|
||||
|
||||
public SubscriptionList count(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of Subscriptions returned.
|
||||
* @return count
|
||||
**/
|
||||
@ApiModelProperty(example = "1", value = "Number of Subscriptions returned. ")
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public SubscriptionList next(String next) {
|
||||
this.next = next;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the next subset of resources qualified. Empty if no more resources are to be returned.
|
||||
* @return next
|
||||
**/
|
||||
@ApiModelProperty(example = "/subscriptions?limit=1&offset=2&apiId=01234567-0123-0123-0123-012345678901&groupId=", value = "Link to the next subset of resources qualified. Empty if no more resources are to be returned. ")
|
||||
public String getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(String next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public SubscriptionList previous(String previous) {
|
||||
this.previous = previous;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the previous subset of resources qualified. Empty if current subset is the first subset returned.
|
||||
* @return previous
|
||||
**/
|
||||
@ApiModelProperty(example = "/subscriptions?limit=1&offset=0&apiId=01234567-0123-0123-0123-012345678901&groupId=", value = "Link to the previous subset of resources qualified. Empty if current subset is the first subset returned. ")
|
||||
public String getPrevious() {
|
||||
return previous;
|
||||
}
|
||||
|
||||
public void setPrevious(String previous) {
|
||||
this.previous = previous;
|
||||
}
|
||||
|
||||
public SubscriptionList list(List<Subscription> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SubscriptionList addListItem(Subscription listItem) {
|
||||
this.list.add(listItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
* @return list
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<Subscription> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<Subscription> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SubscriptionList subscriptionList = (SubscriptionList) o;
|
||||
return Objects.equals(this.count, subscriptionList.count) &&
|
||||
Objects.equals(this.next, subscriptionList.next) &&
|
||||
Objects.equals(this.previous, subscriptionList.previous) &&
|
||||
Objects.equals(this.list, subscriptionList.list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(count, next, previous, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class SubscriptionList {\n");
|
||||
|
||||
sb.append(" count: ").append(toIndentedString(count)).append("\n");
|
||||
sb.append(" next: ").append(toIndentedString(next)).append("\n");
|
||||
sb.append(" previous: ").append(toIndentedString(previous)).append("\n");
|
||||
sb.append(" list: ").append(toIndentedString(list)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Tag
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class Tag {
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("weight")
|
||||
private Integer weight = null;
|
||||
|
||||
public Tag name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "tag1", required = true, value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Tag weight(Integer weight) {
|
||||
this.weight = weight;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get weight
|
||||
* @return weight
|
||||
**/
|
||||
@ApiModelProperty(example = "5", required = true, value = "")
|
||||
public Integer getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(Integer weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Tag tag = (Tag) o;
|
||||
return Objects.equals(this.name, tag.name) &&
|
||||
Objects.equals(this.weight, tag.weight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, weight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Tag {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" weight: ").append(toIndentedString(weight)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* TagList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class TagList {
|
||||
@JsonProperty("count")
|
||||
private Integer count = null;
|
||||
|
||||
@JsonProperty("next")
|
||||
private String next = null;
|
||||
|
||||
@JsonProperty("previous")
|
||||
private String previous = null;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<Tag> list = new ArrayList<Tag>();
|
||||
|
||||
public TagList count(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of Tags returned.
|
||||
* @return count
|
||||
**/
|
||||
@ApiModelProperty(example = "1", value = "Number of Tags returned. ")
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public TagList next(String next) {
|
||||
this.next = next;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the next subset of resources qualified. Empty if no more resources are to be returned.
|
||||
* @return next
|
||||
**/
|
||||
@ApiModelProperty(example = "/tags?limit=1&offset=2", value = "Link to the next subset of resources qualified. Empty if no more resources are to be returned. ")
|
||||
public String getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(String next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public TagList previous(String previous) {
|
||||
this.previous = previous;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the previous subset of resources qualified. Empty if current subset is the first subset returned.
|
||||
* @return previous
|
||||
**/
|
||||
@ApiModelProperty(example = "/tags?limit=1&offset=0", value = "Link to the previous subset of resources qualified. Empty if current subset is the first subset returned. ")
|
||||
public String getPrevious() {
|
||||
return previous;
|
||||
}
|
||||
|
||||
public void setPrevious(String previous) {
|
||||
this.previous = previous;
|
||||
}
|
||||
|
||||
public TagList list(List<Tag> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TagList addListItem(Tag listItem) {
|
||||
this.list.add(listItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
* @return list
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<Tag> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<Tag> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TagList tagList = (TagList) o;
|
||||
return Objects.equals(this.count, tagList.count) &&
|
||||
Objects.equals(this.next, tagList.next) &&
|
||||
Objects.equals(this.previous, tagList.previous) &&
|
||||
Objects.equals(this.list, tagList.list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(count, next, previous, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class TagList {\n");
|
||||
|
||||
sb.append(" count: ").append(toIndentedString(count)).append("\n");
|
||||
sb.append(" next: ").append(toIndentedString(next)).append("\n");
|
||||
sb.append(" previous: ").append(toIndentedString(previous)).append("\n");
|
||||
sb.append(" list: ").append(toIndentedString(list)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,328 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Tier
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class Tier {
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
|
||||
@JsonProperty("description")
|
||||
private String description = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets tierLevel
|
||||
*/
|
||||
public enum TierLevelEnum {
|
||||
API("api"),
|
||||
|
||||
APPLICATION("application");
|
||||
|
||||
private String value;
|
||||
|
||||
TierLevelEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static TierLevelEnum fromValue(String text) {
|
||||
for (TierLevelEnum b : TierLevelEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("tierLevel")
|
||||
private TierLevelEnum tierLevel = null;
|
||||
|
||||
@JsonProperty("attributes")
|
||||
private Map<String, String> attributes = new HashMap<String, String>();
|
||||
|
||||
@JsonProperty("requestCount")
|
||||
private Long requestCount = null;
|
||||
|
||||
@JsonProperty("unitTime")
|
||||
private Long unitTime = null;
|
||||
|
||||
/**
|
||||
* This attribute declares whether this tier is available under commercial or free
|
||||
*/
|
||||
public enum TierPlanEnum {
|
||||
FREE("FREE"),
|
||||
|
||||
COMMERCIAL("COMMERCIAL");
|
||||
|
||||
private String value;
|
||||
|
||||
TierPlanEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static TierPlanEnum fromValue(String text) {
|
||||
for (TierPlanEnum b : TierPlanEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("tierPlan")
|
||||
private TierPlanEnum tierPlan = null;
|
||||
|
||||
@JsonProperty("stopOnQuotaReach")
|
||||
private Boolean stopOnQuotaReach = null;
|
||||
|
||||
public Tier name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "Platinum", required = true, value = "")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Tier description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
* @return description
|
||||
**/
|
||||
@ApiModelProperty(example = "Allows 50 request(s) per minute.", value = "")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Tier tierLevel(TierLevelEnum tierLevel) {
|
||||
this.tierLevel = tierLevel;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tierLevel
|
||||
* @return tierLevel
|
||||
**/
|
||||
@ApiModelProperty(example = "api", value = "")
|
||||
public TierLevelEnum getTierLevel() {
|
||||
return tierLevel;
|
||||
}
|
||||
|
||||
public void setTierLevel(TierLevelEnum tierLevel) {
|
||||
this.tierLevel = tierLevel;
|
||||
}
|
||||
|
||||
public Tier attributes(Map<String, String> attributes) {
|
||||
this.attributes = attributes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Tier putAttributesItem(String key, String attributesItem) {
|
||||
this.attributes.put(key, attributesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom attributes added to the tier policy
|
||||
* @return attributes
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "Custom attributes added to the tier policy ")
|
||||
public Map<String, String> getAttributes() {
|
||||
return attributes;
|
||||
}
|
||||
|
||||
public void setAttributes(Map<String, String> attributes) {
|
||||
this.attributes = attributes;
|
||||
}
|
||||
|
||||
public Tier requestCount(Long requestCount) {
|
||||
this.requestCount = requestCount;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximum number of requests which can be sent within a provided unit time
|
||||
* @return requestCount
|
||||
**/
|
||||
@ApiModelProperty(example = "50", required = true, value = "Maximum number of requests which can be sent within a provided unit time ")
|
||||
public Long getRequestCount() {
|
||||
return requestCount;
|
||||
}
|
||||
|
||||
public void setRequestCount(Long requestCount) {
|
||||
this.requestCount = requestCount;
|
||||
}
|
||||
|
||||
public Tier unitTime(Long unitTime) {
|
||||
this.unitTime = unitTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get unitTime
|
||||
* @return unitTime
|
||||
**/
|
||||
@ApiModelProperty(example = "60000", required = true, value = "")
|
||||
public Long getUnitTime() {
|
||||
return unitTime;
|
||||
}
|
||||
|
||||
public void setUnitTime(Long unitTime) {
|
||||
this.unitTime = unitTime;
|
||||
}
|
||||
|
||||
public Tier tierPlan(TierPlanEnum tierPlan) {
|
||||
this.tierPlan = tierPlan;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This attribute declares whether this tier is available under commercial or free
|
||||
* @return tierPlan
|
||||
**/
|
||||
@ApiModelProperty(example = "FREE", required = true, value = "This attribute declares whether this tier is available under commercial or free ")
|
||||
public TierPlanEnum getTierPlan() {
|
||||
return tierPlan;
|
||||
}
|
||||
|
||||
public void setTierPlan(TierPlanEnum tierPlan) {
|
||||
this.tierPlan = tierPlan;
|
||||
}
|
||||
|
||||
public Tier stopOnQuotaReach(Boolean stopOnQuotaReach) {
|
||||
this.stopOnQuotaReach = stopOnQuotaReach;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this attribute is set to false, you are capabale of sending requests even if the request count exceeded within a unit time
|
||||
* @return stopOnQuotaReach
|
||||
**/
|
||||
@ApiModelProperty(example = "true", required = true, value = "If this attribute is set to false, you are capabale of sending requests even if the request count exceeded within a unit time ")
|
||||
public Boolean getStopOnQuotaReach() {
|
||||
return stopOnQuotaReach;
|
||||
}
|
||||
|
||||
public void setStopOnQuotaReach(Boolean stopOnQuotaReach) {
|
||||
this.stopOnQuotaReach = stopOnQuotaReach;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Tier tier = (Tier) o;
|
||||
return Objects.equals(this.name, tier.name) &&
|
||||
Objects.equals(this.description, tier.description) &&
|
||||
Objects.equals(this.tierLevel, tier.tierLevel) &&
|
||||
Objects.equals(this.attributes, tier.attributes) &&
|
||||
Objects.equals(this.requestCount, tier.requestCount) &&
|
||||
Objects.equals(this.unitTime, tier.unitTime) &&
|
||||
Objects.equals(this.tierPlan, tier.tierPlan) &&
|
||||
Objects.equals(this.stopOnQuotaReach, tier.stopOnQuotaReach);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, description, tierLevel, attributes, requestCount, unitTime, tierPlan, stopOnQuotaReach);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Tier {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" tierLevel: ").append(toIndentedString(tierLevel)).append("\n");
|
||||
sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
|
||||
sb.append(" requestCount: ").append(toIndentedString(requestCount)).append("\n");
|
||||
sb.append(" unitTime: ").append(toIndentedString(unitTime)).append("\n");
|
||||
sb.append(" tierPlan: ").append(toIndentedString(tierPlan)).append("\n");
|
||||
sb.append(" stopOnQuotaReach: ").append(toIndentedString(stopOnQuotaReach)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* TierList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class TierList {
|
||||
@JsonProperty("count")
|
||||
private Integer count = null;
|
||||
|
||||
@JsonProperty("next")
|
||||
private String next = null;
|
||||
|
||||
@JsonProperty("previous")
|
||||
private String previous = null;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<Tier> list = new ArrayList<Tier>();
|
||||
|
||||
public TierList count(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of Tiers returned.
|
||||
* @return count
|
||||
**/
|
||||
@ApiModelProperty(example = "1", value = "Number of Tiers returned. ")
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public TierList next(String next) {
|
||||
this.next = next;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the next subset of resources qualified. Empty if no more resources are to be returned.
|
||||
* @return next
|
||||
**/
|
||||
@ApiModelProperty(example = "/tiers/api?limit=1&offset=2", value = "Link to the next subset of resources qualified. Empty if no more resources are to be returned. ")
|
||||
public String getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(String next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public TierList previous(String previous) {
|
||||
this.previous = previous;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to the previous subset of resources qualified. Empty if current subset is the first subset returned.
|
||||
* @return previous
|
||||
**/
|
||||
@ApiModelProperty(example = "/tiers/api?limit=1&offset=0", value = "Link to the previous subset of resources qualified. Empty if current subset is the first subset returned. ")
|
||||
public String getPrevious() {
|
||||
return previous;
|
||||
}
|
||||
|
||||
public void setPrevious(String previous) {
|
||||
this.previous = previous;
|
||||
}
|
||||
|
||||
public TierList list(List<Tier> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TierList addListItem(Tier listItem) {
|
||||
this.list.add(listItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
* @return list
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<Tier> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<Tier> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TierList tierList = (TierList) o;
|
||||
return Objects.equals(this.count, tierList.count) &&
|
||||
Objects.equals(this.next, tierList.next) &&
|
||||
Objects.equals(this.previous, tierList.previous) &&
|
||||
Objects.equals(this.list, tierList.list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(count, next, previous, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class TierList {\n");
|
||||
|
||||
sb.append(" count: ").append(toIndentedString(count)).append("\n");
|
||||
sb.append(" next: ").append(toIndentedString(next)).append("\n");
|
||||
sb.append(" previous: ").append(toIndentedString(previous)).append("\n");
|
||||
sb.append(" list: ").append(toIndentedString(list)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,152 @@
|
||||
/**
|
||||
* WSO2 API Manager - Store
|
||||
* This document specifies a **RESTful API** for WSO2 **API Manager** - Store. It is written with [swagger 2](http://swagger.io/).
|
||||
*
|
||||
* OpenAPI spec version: 0.10.0
|
||||
* Contact: architecture@wso2.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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.wso2.carbon.apimgt.integration.client.store.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Token
|
||||
*/
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-01-24T00:03:54.991+05:30")
|
||||
public class Token {
|
||||
@JsonProperty("accessToken")
|
||||
private String accessToken = null;
|
||||
|
||||
@JsonProperty("tokenScopes")
|
||||
private List<String> tokenScopes = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("validityTime")
|
||||
private Long validityTime = null;
|
||||
|
||||
public Token accessToken(String accessToken) {
|
||||
this.accessToken = accessToken;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access token
|
||||
* @return accessToken
|
||||
**/
|
||||
@ApiModelProperty(example = "1.2345678901234568E30", value = "Access token")
|
||||
public String getAccessToken() {
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
public void setAccessToken(String accessToken) {
|
||||
this.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public Token tokenScopes(List<String> tokenScopes) {
|
||||
this.tokenScopes = tokenScopes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Token addTokenScopesItem(String tokenScopesItem) {
|
||||
this.tokenScopes.add(tokenScopesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Valid scopes for the access token
|
||||
* @return tokenScopes
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "Valid scopes for the access token")
|
||||
public List<String> getTokenScopes() {
|
||||
return tokenScopes;
|
||||
}
|
||||
|
||||
public void setTokenScopes(List<String> tokenScopes) {
|
||||
this.tokenScopes = tokenScopes;
|
||||
}
|
||||
|
||||
public Token validityTime(Long validityTime) {
|
||||
this.validityTime = validityTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximum validity time for the access token
|
||||
* @return validityTime
|
||||
**/
|
||||
@ApiModelProperty(example = "3600", value = "Maximum validity time for the access token")
|
||||
public Long getValidityTime() {
|
||||
return validityTime;
|
||||
}
|
||||
|
||||
public void setValidityTime(Long validityTime) {
|
||||
this.validityTime = validityTime;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Token token = (Token) o;
|
||||
return Objects.equals(this.accessToken, token.accessToken) &&
|
||||
Objects.equals(this.tokenScopes, token.tokenScopes) &&
|
||||
Objects.equals(this.validityTime, token.validityTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(accessToken, tokenScopes, validityTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Token {\n");
|
||||
|
||||
sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n");
|
||||
sb.append(" tokenScopes: ").append(toIndentedString(tokenScopes)).append("\n");
|
||||
sb.append(" validityTime: ").append(toIndentedString(validityTime)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.integration.client.util;
|
||||
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class PropertyUtils {
|
||||
|
||||
//This method is only used if the mb features are within DAS.
|
||||
public static String replaceProperties(String text) {
|
||||
String regex = "\\$\\{(.*?)\\}";
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matchPattern = pattern.matcher(text);
|
||||
while (matchPattern.find()) {
|
||||
String sysPropertyName = matchPattern.group(1);
|
||||
String sysPropertyValue = System.getProperty(sysPropertyName);
|
||||
if (sysPropertyValue != null && !sysPropertyName.isEmpty()) {
|
||||
text = text.replaceAll("\\$\\{(" + sysPropertyName + ")\\}", sysPropertyValue);
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
@ -22,13 +22,13 @@
|
||||
<parent>
|
||||
<artifactId>apimgt-extensions</artifactId>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<version>2.0.8-SNAPSHOT</version>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>org.wso2.carbon.apimgt.webapp.publisher</artifactId>
|
||||
<version>2.0.8-SNAPSHOT</version>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<packaging>bundle</packaging>
|
||||
<name>WSO2 Carbon - API Management Webapp Publisher</name>
|
||||
<description>WSO2 Carbon - API Management Webapp Publisher</description>
|
||||
@ -47,14 +47,6 @@
|
||||
<groupId>org.testng</groupId>
|
||||
<artifactId>testng</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.apimgt</groupId>
|
||||
<artifactId>org.wso2.carbon.apimgt.api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.apimgt</groupId>
|
||||
<artifactId>org.wso2.carbon.apimgt.impl</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.tomcat</groupId>
|
||||
<artifactId>tomcat</artifactId>
|
||||
@ -111,6 +103,10 @@
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -147,16 +143,24 @@
|
||||
com.google.gson.*,
|
||||
org.apache.catalina,
|
||||
org.apache.catalina.core,
|
||||
org.wso2.carbon.apimgt.api,
|
||||
org.wso2.carbon.apimgt.api.model,
|
||||
org.wso2.carbon.apimgt.impl,
|
||||
org.apache.axis2.*;version="${axis2.osgi.version.range}",
|
||||
org.wso2.carbon.core,
|
||||
org.apache.commons.lang,
|
||||
org.wso2.carbon.utils,
|
||||
org.wso2.carbon.apimgt.annotations.*,
|
||||
org.wso2.carbon.governance.lcm.util.*,
|
||||
org.wso2.carbon.registry.core.*
|
||||
org.wso2.carbon.registry.core.*,
|
||||
io.swagger.annotations,
|
||||
javax.net.ssl,
|
||||
org.scannotation,
|
||||
org.scannotation.archiveiterator,
|
||||
org.w3c.dom,
|
||||
org.wso2.carbon.apimgt.integration.client.*,
|
||||
org.wso2.carbon.context,
|
||||
org.wso2.carbon.core.util,
|
||||
org.wso2.carbon.user.api,
|
||||
org.wso2.carbon.user.core.*,
|
||||
org.wso2.carbon.utils.multitenancy
|
||||
</Import-Package>
|
||||
<Embed-Dependency>
|
||||
javax.ws.rs-api,
|
||||
|
||||
@ -18,17 +18,11 @@
|
||||
*/
|
||||
package org.wso2.carbon.apimgt.webapp.publisher;
|
||||
|
||||
import org.wso2.carbon.apimgt.api.APIManagementException;
|
||||
import org.wso2.carbon.apimgt.api.APIProvider;
|
||||
import org.wso2.carbon.apimgt.api.model.URITemplate;
|
||||
import org.wso2.carbon.apimgt.impl.APIConstants;
|
||||
import org.wso2.carbon.apimgt.impl.APIManagerFactory;
|
||||
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiScope;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiUriTemplate;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@ -53,26 +47,16 @@ public class APIConfig {
|
||||
private String name;
|
||||
private String owner;
|
||||
private String context;
|
||||
private String contextTemplate;
|
||||
private String endpoint;
|
||||
private String version;
|
||||
private String policy;
|
||||
private String transports;
|
||||
private APIProvider provider;
|
||||
private boolean isSecured;
|
||||
private Set<URITemplate> uriTemplates;
|
||||
private List<String> tenants;
|
||||
private Set<ApiUriTemplate> uriTemplates;
|
||||
private boolean isSharedWithAllTenants;
|
||||
private String tenantDomain;
|
||||
private String[] tags;
|
||||
|
||||
public void init() throws APIManagementException {
|
||||
try {
|
||||
this.provider = APIManagerFactory.getInstance().getAPIProvider(owner);
|
||||
} catch (APIManagementException e) {
|
||||
throw new APIManagementException("Error occurred while initializing API provider", e);
|
||||
}
|
||||
}
|
||||
private Set<ApiScope> scopes;
|
||||
|
||||
@XmlElement(name = "Policy", required = true)
|
||||
public String getPolicy() {
|
||||
@ -84,20 +68,6 @@ public class APIConfig {
|
||||
this.policy = policy;
|
||||
}
|
||||
|
||||
@XmlElement(name = "ContextTemplate", required = true)
|
||||
public String getContextTemplate() {
|
||||
return contextTemplate;
|
||||
}
|
||||
|
||||
public void setContextTemplate(String contextTemplate) {
|
||||
this.contextTemplate = contextTemplate;
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public APIProvider getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
@XmlElement(name = "Name", required = true)
|
||||
public String getName() {
|
||||
return name;
|
||||
@ -168,12 +138,12 @@ public class APIConfig {
|
||||
}
|
||||
|
||||
@XmlElement(name = "UriTemplates", required = false)
|
||||
public Set<URITemplate> getUriTemplates() {
|
||||
public Set<ApiUriTemplate> getUriTemplates() {
|
||||
return uriTemplates;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void setUriTemplates(Set<URITemplate> uriTemplates) {
|
||||
public void setUriTemplates(Set<ApiUriTemplate> uriTemplates) {
|
||||
this.uriTemplates = uriTemplates;
|
||||
}
|
||||
|
||||
@ -206,4 +176,12 @@ public class APIConfig {
|
||||
public void setTags(String[] tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public Set<ApiScope> getScopes() {
|
||||
return scopes;
|
||||
}
|
||||
|
||||
public void setScopes(Set<ApiScope> scopes) {
|
||||
this.scopes = scopes;
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,18 +18,12 @@
|
||||
*/
|
||||
package org.wso2.carbon.apimgt.webapp.publisher;
|
||||
|
||||
import org.wso2.carbon.apimgt.api.APIManagementException;
|
||||
import org.wso2.carbon.apimgt.api.FaultGatewaysException;
|
||||
import org.wso2.carbon.apimgt.api.model.API;
|
||||
import org.wso2.carbon.apimgt.api.model.APIIdentifier;
|
||||
import java.util.List;
|
||||
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.exception.APIManagerPublisherException;
|
||||
|
||||
/**
|
||||
* This interface represents all methods related to API manipulation that's done as part of API-Management tasks.
|
||||
*
|
||||
* Note: Ideally, this has to come from the API-Management components. However, due to lack of clean APIs
|
||||
* (as OSGi declarative services, etc) provided for API publishing and related tasks, this was introduced at the device
|
||||
* management core implementation layer.
|
||||
*/
|
||||
public interface APIPublisherService {
|
||||
|
||||
@ -37,23 +31,8 @@ public interface APIPublisherService {
|
||||
* This method registers an API within the underlying API-Management infrastructure.
|
||||
*
|
||||
* @param api An instance of the bean that passes metadata related to the API being published
|
||||
* @throws APIManagementException Is thrown if some unexpected event occurs while publishing the API
|
||||
* @throws APIManagerPublisherException Is thrown if some unexpected event occurs while publishing the API
|
||||
*/
|
||||
void publishAPI(API api) throws APIManagementException, FaultGatewaysException;
|
||||
void publishAPI(APIConfig api) throws APIManagerPublisherException;
|
||||
|
||||
/**
|
||||
* This method removes an API that's already published within the underlying API-Management infrastructure.
|
||||
*
|
||||
* @param id An instance of the bean that carries API identification related metadata
|
||||
* @throws APIManagementException Is thrown if some unexpected event occurs while removing the API
|
||||
*/
|
||||
void removeAPI(APIIdentifier id) throws APIManagementException;
|
||||
|
||||
/**
|
||||
* This method registers a collection of APIs within the underlying API-Management infrastructure.
|
||||
*
|
||||
* @param apis A list of the beans that passes metadata related to the APIs being published
|
||||
* @throws APIManagementException Is thrown if some unexpected event occurs while publishing the APIs
|
||||
*/
|
||||
void publishAPIs(List<API> apis) throws APIManagementException, FaultGatewaysException;
|
||||
}
|
||||
|
||||
@ -18,28 +18,15 @@
|
||||
*/
|
||||
package org.wso2.carbon.apimgt.webapp.publisher;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.apimgt.api.APIManagementException;
|
||||
import org.wso2.carbon.apimgt.api.APIProvider;
|
||||
import org.wso2.carbon.apimgt.api.FaultGatewaysException;
|
||||
import org.wso2.carbon.apimgt.api.model.*;
|
||||
import org.wso2.carbon.apimgt.impl.APIManagerFactory;
|
||||
import feign.FeignException;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient;
|
||||
import org.wso2.carbon.apimgt.integration.client.publisher.model.*;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.config.WebappPublisherConfig;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.exception.APIManagerPublisherException;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.internal.APIPublisherDataHolder;
|
||||
import org.wso2.carbon.base.MultitenantConstants;
|
||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
import org.wso2.carbon.governance.lcm.util.CommonUtil;
|
||||
import org.wso2.carbon.registry.core.exceptions.RegistryException;
|
||||
import org.wso2.carbon.registry.core.service.RegistryService;
|
||||
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
||||
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@ -47,176 +34,122 @@ import java.util.*;
|
||||
* API publishing related operations.
|
||||
*/
|
||||
public class APIPublisherServiceImpl implements APIPublisherService {
|
||||
|
||||
private static final Log log = LogFactory.getLog(APIPublisherServiceImpl.class);
|
||||
private static final String UNLIMITED_TIER = "Unlimited";
|
||||
private static final String API_PUBLISH_ENVIRONMENT = "Production and Sandbox";
|
||||
private static final String CONTENT_TYPE = "application/json";
|
||||
private static final String PUBLISHED_STATUS = "PUBLISHED";
|
||||
private static final String CREATED_STATUS = "CREATED";
|
||||
private static final String PUBLISH_ACTION = "Publish";
|
||||
|
||||
@Override
|
||||
public void publishAPI(final API api) throws APIManagementException, FaultGatewaysException {
|
||||
String tenantDomain = MultitenantUtils.getTenantDomain(api.getApiOwner());
|
||||
public void publishAPI(APIConfig apiConfig) throws APIManagerPublisherException {
|
||||
String tenantDomain = MultitenantUtils.getTenantDomain(apiConfig.getOwner());
|
||||
PrivilegedCarbonContext.startTenantFlow();
|
||||
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true);
|
||||
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(apiConfig.getOwner());
|
||||
try {
|
||||
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
|
||||
// Below code snippet is added to load API Lifecycle in tenant mode.
|
||||
RegistryService registryService = APIPublisherDataHolder.getInstance().getRegistryService();
|
||||
CommonUtil.addDefaultLifecyclesIfNotAvailable(registryService.getConfigSystemRegistry(tenantId),
|
||||
CommonUtil.getRootSystemRegistry(tenantId));
|
||||
APIProvider provider = APIManagerFactory.getInstance().getAPIProvider(api.getApiOwner());
|
||||
MultitenantUtils.getTenantDomain(api.getApiOwner());
|
||||
processHttpVerbs(api);
|
||||
if (provider != null) {
|
||||
if (provider.isDuplicateContextTemplate(api.getContext())) {
|
||||
throw new APIManagementException(
|
||||
"Error occurred while adding the API. A duplicate API" +
|
||||
" context already exists for " + api.getContext());
|
||||
}
|
||||
if (!provider.isAPIAvailable(api.getId())) {
|
||||
provider.addAPI(api);
|
||||
provider.changeLifeCycleStatus(api.getId(), PUBLISH_ACTION);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Successfully published API '" + api.getId().getApiName() +
|
||||
"' with context '" + api.getContext() + "' and version '"
|
||||
+ api.getId().getVersion() + "'");
|
||||
PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService()
|
||||
.getPublisherClient();
|
||||
API api = getAPI(apiConfig);
|
||||
APIList apiList = publisherClient.getApi().apisGet(100, 0, "name:" + api.getName(), CONTENT_TYPE, null);
|
||||
|
||||
if (!isExist(api, apiList)) {
|
||||
api = publisherClient.getApi().apisPost(api, CONTENT_TYPE);
|
||||
if (CREATED_STATUS.equals(api.getStatus())) {
|
||||
publisherClient.getApi().apisChangeLifecyclePost(PUBLISH_ACTION, api.getId(), null, null, null);
|
||||
}
|
||||
} else {
|
||||
if (WebappPublisherConfig.getInstance().isEnabledUpdateApi()) {
|
||||
if (provider.getAPI(api.getId()).getStatus() == APIStatus.CREATED) {
|
||||
provider.changeLifeCycleStatus(api.getId(), PUBLISH_ACTION);
|
||||
for (APIInfo apiInfo : apiList.getList()) {
|
||||
if (api.getName().equals(apiInfo.getName()) && api.getVersion().equals(apiInfo.getVersion())) {
|
||||
api = publisherClient.getApi().apisApiIdPut(apiInfo.getId(), api, CONTENT_TYPE, null, null);
|
||||
if (CREATED_STATUS.equals(api.getStatus())) {
|
||||
publisherClient.getApi().apisChangeLifecyclePost(PUBLISH_ACTION, api.getId(), null, null,
|
||||
null);
|
||||
}
|
||||
api.setStatus(APIStatus.PUBLISHED);
|
||||
provider.updateAPI(api);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("An API already exists with the name '" + api.getId().getApiName() +
|
||||
"', context '" + api.getContext() + "' and version '"
|
||||
+ api.getId().getVersion() + "'. Thus, the API config is updated");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
provider.saveSwagger20Definition(api.getId(), createSwaggerDefinition(api));
|
||||
} else {
|
||||
throw new APIManagementException("API provider configured for the given API configuration " +
|
||||
"is null. Thus, the API is not published");
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new APIManagementException("Failed to retrieve life cycle file ", e);
|
||||
} catch (RegistryException e) {
|
||||
throw new APIManagementException("Failed to access the registry ", e);
|
||||
} catch (XMLStreamException e) {
|
||||
throw new APIManagementException("Failed parsing the lifecycle xml.", e);
|
||||
} catch (FeignException e) {
|
||||
throw new APIManagerPublisherException(e);
|
||||
} finally {
|
||||
PrivilegedCarbonContext.endTenantFlow();
|
||||
}
|
||||
}
|
||||
|
||||
private String createSwaggerDefinition(API api) {
|
||||
Map<String, JsonObject> httpVerbsMap = new HashMap<>();
|
||||
List<Scope> scopes = new ArrayList<>();
|
||||
|
||||
for (URITemplate uriTemplate : api.getUriTemplates()) {
|
||||
JsonObject response = new JsonObject();
|
||||
response.addProperty("200", "");
|
||||
|
||||
JsonObject responses = new JsonObject();
|
||||
responses.add("responses", response);
|
||||
JsonObject httpVerbs = httpVerbsMap.get(uriTemplate.getUriTemplate());
|
||||
if (httpVerbs == null) {
|
||||
httpVerbs = new JsonObject();
|
||||
private boolean isExist(API api, APIList apiList) {
|
||||
if (apiList == null || apiList.getList() == null || apiList.getList().size() == 0) {
|
||||
return false;
|
||||
}
|
||||
JsonObject httpVerb = new JsonObject();
|
||||
httpVerb.add("responses", response);
|
||||
|
||||
httpVerb.addProperty("x-auth-type", "Application%20%26%20Application%20User");
|
||||
httpVerb.addProperty("x-throttling-tier", "Unlimited");
|
||||
if (uriTemplate.getScope() != null) {
|
||||
httpVerb.addProperty("x-scope", uriTemplate.getScope().getName());
|
||||
scopes.add(uriTemplate.getScope());
|
||||
for (APIInfo existingApi : apiList.getList()) {
|
||||
if (existingApi.getName().equals(api.getName()) && existingApi.getVersion().equals(api.getVersion())) {
|
||||
return true;
|
||||
}
|
||||
httpVerbs.add(uriTemplate.getHTTPVerb().toLowerCase(), httpVerb);
|
||||
httpVerbsMap.put(uriTemplate.getUriTemplate(), httpVerbs);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Iterator it = httpVerbsMap.entrySet().iterator();
|
||||
JsonObject paths = new JsonObject();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, JsonObject> pair = (Map.Entry) it.next();
|
||||
paths.add(pair.getKey(), pair.getValue());
|
||||
it.remove();
|
||||
}
|
||||
private API getAPI(APIConfig config) {
|
||||
|
||||
JsonObject info = new JsonObject();
|
||||
info.addProperty("title", api.getId().getApiName());
|
||||
info.addProperty("version", api.getId().getVersion());
|
||||
API api = new API();
|
||||
api.setName(config.getName());
|
||||
api.setDescription("");
|
||||
|
||||
JsonObject swaggerDefinition = new JsonObject();
|
||||
swaggerDefinition.add("paths", paths);
|
||||
swaggerDefinition.addProperty("swagger", "2.0");
|
||||
swaggerDefinition.add("info", info);
|
||||
String context = config.getContext();
|
||||
context = context.startsWith("/") ? context : ("/" + context);
|
||||
api.setContext(context);
|
||||
api.setVersion(config.getVersion());
|
||||
api.setProvider(config.getOwner());
|
||||
api.setApiDefinition(APIPublisherUtil.getSwaggerDefinition(config));
|
||||
api.setWsdlUri(null);
|
||||
api.setStatus(PUBLISHED_STATUS);
|
||||
api.responseCaching("DISABLED");
|
||||
api.destinationStatsEnabled("false");
|
||||
api.isDefaultVersion(true);
|
||||
List<String> transport = new ArrayList<>();
|
||||
transport.add("https");
|
||||
transport.add("http");
|
||||
api.transport(transport);
|
||||
api.setTags(Arrays.asList(config.getTags()));
|
||||
api.addTiersItem(UNLIMITED_TIER);
|
||||
api.setGatewayEnvironments(API_PUBLISH_ENVIRONMENT);
|
||||
if (config.isSharedWithAllTenants()) {
|
||||
api.setSubscriptionAvailability(API.SubscriptionAvailabilityEnum.all_tenants);
|
||||
api.setVisibility(API.VisibilityEnum.PUBLIC);
|
||||
} else {
|
||||
api.setSubscriptionAvailability(API.SubscriptionAvailabilityEnum.current_tenant);
|
||||
api.setVisibility(API.VisibilityEnum.PRIVATE);
|
||||
}
|
||||
String endpointConfig = "{\"production_endpoints\":{\"url\":\"" + config.getEndpoint() +
|
||||
"\",\"config\":null},\"implementation_status\":\"managed\",\"endpoint_type\":\"http\"}";
|
||||
|
||||
// adding scopes to swagger definition
|
||||
if (!api.getScopes().isEmpty()) {
|
||||
Gson gson = new Gson();
|
||||
JsonElement element = gson.toJsonTree(api.getScopes(), new TypeToken<Set<Scope>>() {
|
||||
}.getType());
|
||||
if (element != null) {
|
||||
JsonArray apiScopes = element.getAsJsonArray();
|
||||
JsonObject apim = new JsonObject();
|
||||
apim.add("x-wso2-scopes", apiScopes);
|
||||
JsonObject wso2Security = new JsonObject();
|
||||
wso2Security.add("apim", apim);
|
||||
swaggerDefinition.add("x-wso2-security", wso2Security);
|
||||
}
|
||||
}
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("API swagger definition: " + swaggerDefinition.toString());
|
||||
}
|
||||
return swaggerDefinition.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sometimes the httpVerb string attribute is not existing in
|
||||
* the list of httpVerbs attribute of uriTemplate. In such cases when creating the api in the
|
||||
* synapse configuration, it doesn't have http methods correctly assigned for the resources.
|
||||
* Therefore this method takes care of such inconsistency issue.
|
||||
*
|
||||
* @param api The actual API model object
|
||||
*/
|
||||
private void processHttpVerbs(API api) {
|
||||
for (URITemplate uriTemplate : api.getUriTemplates()) {
|
||||
String httpVerbString = uriTemplate.getHTTPVerb();
|
||||
if (httpVerbString != null && !httpVerbString.isEmpty()) {
|
||||
uriTemplate.setHttpVerbs(httpVerbString);
|
||||
}
|
||||
}
|
||||
}
|
||||
api.setEndpointConfig(endpointConfig);
|
||||
APICorsConfiguration apiCorsConfiguration = new APICorsConfiguration();
|
||||
List<String> accessControlAllowOrigins = new ArrayList<>();
|
||||
accessControlAllowOrigins.add("*");
|
||||
apiCorsConfiguration.setAccessControlAllowOrigins(accessControlAllowOrigins);
|
||||
|
||||
@Override
|
||||
public void removeAPI(APIIdentifier id) throws APIManagementException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Removing API '" + id.getApiName() + "'");
|
||||
}
|
||||
APIProvider provider = APIManagerFactory.getInstance().getAPIProvider(id.getProviderName());
|
||||
provider.deleteAPI(id);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("API '" + id.getApiName() + "' has been successfully removed");
|
||||
}
|
||||
}
|
||||
List<String> accessControlAllowHeaders = new ArrayList<>();
|
||||
accessControlAllowHeaders.add("authorization");
|
||||
accessControlAllowHeaders.add("Access-Control-Allow-Origin");
|
||||
accessControlAllowHeaders.add("Content-Type");
|
||||
accessControlAllowHeaders.add("SOAPAction");
|
||||
apiCorsConfiguration.setAccessControlAllowHeaders(accessControlAllowHeaders);
|
||||
|
||||
@Override
|
||||
public void publishAPIs(List<API> apis) throws APIManagementException, FaultGatewaysException {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Publishing a batch of APIs");
|
||||
List<String> accessControlAllowMethods = new ArrayList<>();
|
||||
accessControlAllowMethods.add("GET");
|
||||
accessControlAllowMethods.add("PUT");
|
||||
accessControlAllowMethods.add("DELETE");
|
||||
accessControlAllowMethods.add("POST");
|
||||
accessControlAllowMethods.add("PATCH");
|
||||
accessControlAllowMethods.add("OPTIONS");
|
||||
apiCorsConfiguration.setAccessControlAllowMethods(accessControlAllowMethods);
|
||||
apiCorsConfiguration.setAccessControlAllowCredentials(false);
|
||||
apiCorsConfiguration.corsConfigurationEnabled(false);
|
||||
api.setCorsConfiguration(apiCorsConfiguration);
|
||||
return api;
|
||||
}
|
||||
for (API api : apis) {
|
||||
try {
|
||||
this.publishAPI(api);
|
||||
} catch (APIManagementException e) {
|
||||
log.error("Error occurred while publishing API '" + api.getId().getApiName() + "'", e);
|
||||
}
|
||||
}
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("End of publishing the batch of APIs");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ package org.wso2.carbon.apimgt.webapp.publisher;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.apimgt.api.model.API;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.exception.APIManagerPublisherException;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.internal.APIPublisherDataHolder;
|
||||
import org.wso2.carbon.core.ServerStartupObserver;
|
||||
|
||||
@ -33,8 +33,8 @@ public class APIPublisherStartupHandler implements ServerStartupObserver {
|
||||
private static int retryTime = 2000;
|
||||
private static final int CONNECTION_RETRY_FACTOR = 2;
|
||||
private static final int MAX_RETRY_COUNT = 5;
|
||||
private static Stack<API> failedAPIsStack = new Stack<>();
|
||||
private static Stack<API> currentAPIsStack;
|
||||
private static Stack<APIConfig> failedAPIsStack = new Stack<>();
|
||||
private static Stack<APIConfig> currentAPIsStack;
|
||||
|
||||
private APIPublisherService publisher;
|
||||
|
||||
@ -64,7 +64,7 @@ public class APIPublisherStartupHandler implements ServerStartupObserver {
|
||||
} catch (InterruptedException te) {
|
||||
//do nothing.
|
||||
}
|
||||
Stack<API> failedApis;
|
||||
Stack<APIConfig> failedApis;
|
||||
if (!APIPublisherDataHolder.getInstance().getUnpublishedApis().isEmpty()) {
|
||||
publishAPIs(currentAPIsStack, failedAPIsStack);
|
||||
failedApis = failedAPIsStack;
|
||||
@ -77,8 +77,8 @@ public class APIPublisherStartupHandler implements ServerStartupObserver {
|
||||
StringBuilder error = new StringBuilder();
|
||||
error.append("Error occurred while publishing API ['");
|
||||
while (!failedApis.isEmpty()) {
|
||||
API api = failedApis.pop();
|
||||
error.append(api.getId().getApiName() + ",");
|
||||
APIConfig api = failedApis.pop();
|
||||
error.append(api.getName() + ",");
|
||||
}
|
||||
error.append("']");
|
||||
log.error(error.toString());
|
||||
@ -90,12 +90,13 @@ public class APIPublisherStartupHandler implements ServerStartupObserver {
|
||||
t.start();
|
||||
}
|
||||
|
||||
private void publishAPIs(Stack<API> apis, Stack<API> failedStack) {
|
||||
private void publishAPIs(Stack<APIConfig> apis, Stack<APIConfig> failedStack) {
|
||||
while (!apis.isEmpty()) {
|
||||
API api = apis.pop();
|
||||
APIConfig api = apis.pop();
|
||||
try {
|
||||
publisher.publishAPI(api);
|
||||
} catch (Exception e) {
|
||||
} catch (APIManagerPublisherException e) {
|
||||
log.error("failed to publish api.", e);
|
||||
failedStack.push(api);
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,22 +18,24 @@
|
||||
|
||||
package org.wso2.carbon.apimgt.webapp.publisher;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.apimgt.api.APIManagementException;
|
||||
import org.wso2.carbon.apimgt.api.APIProvider;
|
||||
import org.wso2.carbon.apimgt.api.model.*;
|
||||
import org.wso2.carbon.apimgt.impl.APIConstants;
|
||||
import org.wso2.carbon.apimgt.impl.utils.APIUtil;
|
||||
import org.wso2.carbon.apimgt.annotations.api.Scope;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.config.APIResource;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.config.APIResourceConfiguration;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.config.WebappPublisherConfig;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiScope;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiUriTemplate;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.lifecycle.util.AnnotationProcessor;
|
||||
import org.wso2.carbon.base.MultitenantConstants;
|
||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
import org.wso2.carbon.core.util.Utils;
|
||||
import org.wso2.carbon.user.api.UserStoreException;
|
||||
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import java.util.*;
|
||||
@ -41,7 +43,6 @@ import java.util.*;
|
||||
public class APIPublisherUtil {
|
||||
|
||||
public static final String API_VERSION_PARAM = "{version}";
|
||||
public static final String API_PUBLISH_ENVIRONMENT = "Production and Sandbox";
|
||||
private static final Log log = LogFactory.getLog(APIPublisherUtil.class);
|
||||
private static final String DEFAULT_API_VERSION = "1.0.0";
|
||||
private static final String API_CONFIG_DEFAULT_VERSION = "1.0.0";
|
||||
@ -55,101 +56,6 @@ public class APIPublisherUtil {
|
||||
private static final String NON_SECURED_RESOURCES = "nonSecuredEndPoints";
|
||||
private static final String AUTH_TYPE_NON_SECURED = "None";
|
||||
|
||||
|
||||
public static API getAPI(APIConfig config) throws APIManagementException {
|
||||
|
||||
APIProvider provider = config.getProvider();
|
||||
String apiVersion = config.getVersion();
|
||||
APIIdentifier id = new APIIdentifier(replaceEmailDomain(config.getOwner()), config.getName(), apiVersion);
|
||||
API api = new API(id);
|
||||
|
||||
api.setApiOwner(config.getOwner());
|
||||
String context = config.getContext();
|
||||
context = context.startsWith("/") ? context : ("/" + context);
|
||||
String providerDomain = config.getTenantDomain();
|
||||
if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equalsIgnoreCase(providerDomain)) {
|
||||
//Create tenant aware context for API
|
||||
context = "/t/" + providerDomain + context;
|
||||
}
|
||||
|
||||
// This is to support the new Pluggable version strategy
|
||||
// if the context does not contain any {version} segment, we use the default version strategy.
|
||||
context = checkAndSetVersionParam(context);
|
||||
api.setContextTemplate(context);
|
||||
context = updateContextWithVersion(config.getVersion(), context);
|
||||
api.setContext(context);
|
||||
|
||||
api.setUrl(config.getEndpoint());
|
||||
api.addAvailableTiers(provider.getTiers());
|
||||
api.setEndpointSecured(false);
|
||||
api.setStatus(APIStatus.CREATED);
|
||||
api.setTransports(config.getTransports());
|
||||
api.setApiLevelPolicy(config.getPolicy());
|
||||
api.setContextTemplate(config.getContextTemplate());
|
||||
Set<String> environments = new HashSet<>();
|
||||
environments.add(API_PUBLISH_ENVIRONMENT);
|
||||
api.setEnvironments(environments);
|
||||
Set<Tier> tiers = new HashSet<>();
|
||||
|
||||
tiers.add(new Tier(APIConstants.UNLIMITED_TIER));
|
||||
api.addAvailableTiers(tiers);
|
||||
|
||||
if (config.isSharedWithAllTenants()) {
|
||||
api.setSubscriptionAvailability(APIConstants.SUBSCRIPTION_TO_ALL_TENANTS);
|
||||
api.setVisibility(APIConstants.API_GLOBAL_VISIBILITY);
|
||||
} else {
|
||||
api.setSubscriptionAvailability(APIConstants.SUBSCRIPTION_TO_CURRENT_TENANT);
|
||||
api.setVisibility(APIConstants.API_PRIVATE_VISIBILITY);
|
||||
}
|
||||
api.setResponseCache(APIConstants.DISABLED);
|
||||
|
||||
String endpointConfig = "{\"production_endpoints\":{\"url\":\"" + config.getEndpoint() +
|
||||
"\",\"config\":null},\"implementation_status\":\"managed\",\"endpoint_type\":\"http\"}";
|
||||
|
||||
api.setEndpointConfig(endpointConfig);
|
||||
|
||||
if ("".equals(id.getVersion()) || (DEFAULT_API_VERSION.equals(id.getVersion()))) {
|
||||
api.setAsDefaultVersion(Boolean.TRUE);
|
||||
api.setAsPublishedDefaultVersion(Boolean.TRUE);
|
||||
}
|
||||
if (config.getTags() != null && config.getTags().length > 0) {
|
||||
Set<String> tags = new HashSet<>(Arrays.asList(config.getTags()));
|
||||
api.addTags(tags);
|
||||
}
|
||||
|
||||
// adding scopes to the api
|
||||
Set<URITemplate> uriTemplates = config.getUriTemplates();
|
||||
Map<String, Scope> apiScopes = new HashMap<>();
|
||||
if (uriTemplates != null) {
|
||||
// this creates distinct scopes list
|
||||
for (URITemplate template : uriTemplates) {
|
||||
Scope scope = template.getScope();
|
||||
if (scope != null) {
|
||||
if (apiScopes.get(scope.getKey()) == null) {
|
||||
apiScopes.put(scope.getKey(), scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
Set<Scope> scopes = new HashSet<>(apiScopes.values());
|
||||
// set current scopes to API
|
||||
api.setScopes(scopes);
|
||||
|
||||
// this has to be done because of the use of pass by reference
|
||||
// where same object reference of scope should be available for both
|
||||
// api scope and uri template scope
|
||||
for (Scope scope : scopes) {
|
||||
for (URITemplate template : uriTemplates) {
|
||||
if (template.getScope() != null && scope.getKey().equals(template.getScope().getKey())) {
|
||||
template.setScope(scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
api.setUriTemplates(uriTemplates);
|
||||
}
|
||||
api.setCorsConfiguration(APIUtil.getDefaultCorsConfiguration());
|
||||
return api;
|
||||
}
|
||||
|
||||
public static String getServerBaseUrl() {
|
||||
WebappPublisherConfig webappPublisherConfig = WebappPublisherConfig.getInstance();
|
||||
return Utils.replaceSystemProperty(webappPublisherConfig.getHost());
|
||||
@ -159,39 +65,6 @@ public class APIPublisherUtil {
|
||||
return getServerBaseUrl() + context;
|
||||
}
|
||||
|
||||
/**
|
||||
* When an input is having '@',replace it with '-AT-'
|
||||
* [This is required to persist API data in registry,as registry paths don't allow '@' sign.]
|
||||
*
|
||||
* @param input inputString
|
||||
* @return String modifiedString
|
||||
*/
|
||||
private static String replaceEmailDomain(String input) {
|
||||
if (input != null && input.contains(APIConstants.EMAIL_DOMAIN_SEPARATOR)) {
|
||||
input = input.replace(APIConstants.EMAIL_DOMAIN_SEPARATOR, APIConstants.EMAIL_DOMAIN_SEPARATOR_REPLACEMENT);
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
private static String updateContextWithVersion(String version, String context) {
|
||||
// This condition should not be true for any occasion but we keep it so that there are no loopholes in
|
||||
// the flow.
|
||||
context = context.replace(API_VERSION_PARAM, version);
|
||||
return context;
|
||||
}
|
||||
|
||||
private static String checkAndSetVersionParam(String context) {
|
||||
// This is to support the new Pluggable version strategy
|
||||
// if the context does not contain any {version} segment, we use the default version strategy.
|
||||
if (!context.contains(API_VERSION_PARAM)) {
|
||||
if (!context.endsWith("/")) {
|
||||
context = context + "/";
|
||||
}
|
||||
context = context + API_VERSION_PARAM;
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the API Configuration to be passed to APIM, from a given list of URL templates
|
||||
*
|
||||
@ -245,11 +118,6 @@ public class APIPublisherUtil {
|
||||
tenantDomain = (tenantDomain != null && !tenantDomain.isEmpty()) ? tenantDomain :
|
||||
MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
|
||||
apiConfig.setTenantDomain(tenantDomain);
|
||||
String contextTemplate = context + "/" + APIConstants.VERSION_PLACEHOLDER;
|
||||
if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
|
||||
contextTemplate = context + "/t/" + tenantDomain + "/" + APIConstants.VERSION_PLACEHOLDER;
|
||||
}
|
||||
apiConfig.setContextTemplate(contextTemplate);
|
||||
|
||||
String endpoint = servletContext.getInitParameter(PARAM_MANAGED_API_ENDPOINT);
|
||||
if (endpoint == null || endpoint.isEmpty()) {
|
||||
@ -292,17 +160,33 @@ public class APIPublisherUtil {
|
||||
}
|
||||
apiConfig.setSharedWithAllTenants(isSharedWithAllTenants);
|
||||
|
||||
Set<URITemplate> uriTemplates = new LinkedHashSet<>();
|
||||
Set<ApiUriTemplate> uriTemplates = new LinkedHashSet<>();
|
||||
for (APIResource apiResource : apiDef.getResources()) {
|
||||
URITemplate template = new URITemplate();
|
||||
ApiUriTemplate template = new ApiUriTemplate();
|
||||
template.setAuthType(apiResource.getAuthType());
|
||||
template.setHTTPVerb(apiResource.getHttpVerb());
|
||||
template.setHttpVerb(apiResource.getHttpVerb());
|
||||
template.setResourceURI(apiResource.getUri());
|
||||
template.setUriTemplate(apiResource.getUriTemplate());
|
||||
template.setScope(apiResource.getScope());
|
||||
uriTemplates.add(template);
|
||||
}
|
||||
apiConfig.setUriTemplates(uriTemplates);
|
||||
// adding scopes to the api
|
||||
Map<String, ApiScope> apiScopes = new HashMap<>();
|
||||
if (uriTemplates != null) {
|
||||
// this creates distinct scopes list
|
||||
for (ApiUriTemplate template : uriTemplates) {
|
||||
ApiScope scope = template.getScope();
|
||||
if (scope != null) {
|
||||
if (apiScopes.get(scope.getKey()) == null) {
|
||||
apiScopes.put(scope.getKey(), scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
Set<ApiScope> scopes = new HashSet<>(apiScopes.values());
|
||||
// set current scopes to API
|
||||
apiConfig.setScopes(scopes);
|
||||
}
|
||||
|
||||
String policy = servletContext.getInitParameter(PARAM_MANAGED_API_POLICY);
|
||||
if (policy == null || policy.isEmpty()) {
|
||||
@ -317,6 +201,70 @@ public class APIPublisherUtil {
|
||||
return apiConfig;
|
||||
}
|
||||
|
||||
public static String getSwaggerDefinition(APIConfig apiConfig) {
|
||||
Map<String, JsonObject> httpVerbsMap = new HashMap<>();
|
||||
List<ApiScope> scopes = new ArrayList<>();
|
||||
|
||||
for (ApiUriTemplate uriTemplate : apiConfig.getUriTemplates()) {
|
||||
JsonObject response = new JsonObject();
|
||||
response.addProperty("200", "");
|
||||
|
||||
JsonObject responses = new JsonObject();
|
||||
responses.add("responses", response);
|
||||
JsonObject httpVerbs = httpVerbsMap.get(uriTemplate.getUriTemplate());
|
||||
if (httpVerbs == null) {
|
||||
httpVerbs = new JsonObject();
|
||||
}
|
||||
JsonObject httpVerb = new JsonObject();
|
||||
httpVerb.add("responses", response);
|
||||
|
||||
httpVerb.addProperty("x-auth-type", "Application%20%26%20Application%20User");
|
||||
httpVerb.addProperty("x-throttling-tier", "Unlimited");
|
||||
if (uriTemplate.getScope() != null) {
|
||||
httpVerb.addProperty("x-scope", uriTemplate.getScope().getKey());
|
||||
scopes.add(uriTemplate.getScope());
|
||||
}
|
||||
httpVerbs.add(uriTemplate.getHttpVerb().toLowerCase(), httpVerb);
|
||||
httpVerbsMap.put(uriTemplate.getUriTemplate(), httpVerbs);
|
||||
}
|
||||
|
||||
Iterator it = httpVerbsMap.entrySet().iterator();
|
||||
JsonObject paths = new JsonObject();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, JsonObject> pair = (Map.Entry) it.next();
|
||||
paths.add(pair.getKey(), pair.getValue());
|
||||
it.remove();
|
||||
}
|
||||
|
||||
JsonObject info = new JsonObject();
|
||||
info.addProperty("title", apiConfig.getName());
|
||||
info.addProperty("version", apiConfig.getVersion());
|
||||
|
||||
JsonObject swaggerDefinition = new JsonObject();
|
||||
swaggerDefinition.add("paths", paths);
|
||||
swaggerDefinition.addProperty("swagger", "2.0");
|
||||
swaggerDefinition.add("info", info);
|
||||
|
||||
// adding scopes to swagger definition
|
||||
if (!apiConfig.getScopes().isEmpty()) {
|
||||
Gson gson = new Gson();
|
||||
JsonElement element = gson.toJsonTree(apiConfig.getScopes(), new TypeToken<Set<Scope>>() {
|
||||
}.getType());
|
||||
if (element != null) {
|
||||
JsonArray apiScopes = element.getAsJsonArray();
|
||||
JsonObject apim = new JsonObject();
|
||||
apim.add("x-wso2-scopes", apiScopes);
|
||||
JsonObject wso2Security = new JsonObject();
|
||||
wso2Security.add("apim", apim);
|
||||
swaggerDefinition.add("x-wso2-security", wso2Security);
|
||||
}
|
||||
}
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("API swagger definition: " + swaggerDefinition.toString());
|
||||
}
|
||||
return swaggerDefinition.toString();
|
||||
}
|
||||
|
||||
|
||||
public static void setResourceAuthTypes(ServletContext servletContext, APIConfig apiConfig) {
|
||||
List<String> resourcesList = null;
|
||||
@ -324,9 +272,9 @@ public class APIPublisherUtil {
|
||||
if(null != nonSecuredResources){
|
||||
resourcesList = Arrays.asList(nonSecuredResources.split(","));
|
||||
}
|
||||
Set<URITemplate> templates = apiConfig.getUriTemplates();
|
||||
Set<ApiUriTemplate> templates = apiConfig.getUriTemplates();
|
||||
if(null != resourcesList) {
|
||||
for (URITemplate template : templates) {
|
||||
for (ApiUriTemplate template : templates) {
|
||||
String fullPaath = "";
|
||||
if( template.getUriTemplate() != AnnotationProcessor.WILD_CARD ) {
|
||||
fullPaath = apiConfig.getContext() + template.getUriTemplate();
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
package org.wso2.carbon.apimgt.webapp.publisher.config;
|
||||
|
||||
import org.wso2.carbon.apimgt.api.model.Scope;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiScope;
|
||||
|
||||
public class APIResource {
|
||||
|
||||
@ -28,7 +28,7 @@ public class APIResource {
|
||||
private String UriTemplate;
|
||||
private String consumes;
|
||||
private String produces;
|
||||
private Scope scope;
|
||||
private ApiScope scope;
|
||||
|
||||
public String getAuthType() {
|
||||
return AuthType;
|
||||
@ -78,11 +78,11 @@ public class APIResource {
|
||||
this.produces = produces;
|
||||
}
|
||||
|
||||
public Scope getScope() {
|
||||
public ApiScope getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public void setScope(Scope scope) {
|
||||
public void setScope(ApiScope scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.webapp.publisher.dto;
|
||||
|
||||
public class ApiScope {
|
||||
|
||||
String key;
|
||||
String name;
|
||||
String roles;
|
||||
String description;
|
||||
int id;
|
||||
|
||||
public ApiScope() {
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getRoles() {
|
||||
return this.roles;
|
||||
}
|
||||
|
||||
public void setRoles(String roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.webapp.publisher.dto;
|
||||
|
||||
/**
|
||||
* This hold the api uri template information.
|
||||
*/
|
||||
public class ApiUriTemplate {
|
||||
|
||||
private String authType;
|
||||
private String httpVerb;
|
||||
private String resourceURI;
|
||||
private String uriTemplate;
|
||||
private ApiScope scope;
|
||||
|
||||
public ApiUriTemplate() {}
|
||||
|
||||
public String getAuthType() {
|
||||
return authType;
|
||||
}
|
||||
|
||||
public void setAuthType(String authType) {
|
||||
this.authType = authType;
|
||||
}
|
||||
|
||||
public String getHttpVerb() {
|
||||
return httpVerb;
|
||||
}
|
||||
|
||||
public void setHttpVerb(String httpVerb) {
|
||||
this.httpVerb = httpVerb;
|
||||
}
|
||||
|
||||
public String getResourceURI() {
|
||||
return resourceURI;
|
||||
}
|
||||
|
||||
public void setResourceURI(String resourceURI) {
|
||||
this.resourceURI = resourceURI;
|
||||
}
|
||||
|
||||
public String getUriTemplate() {
|
||||
return uriTemplate;
|
||||
}
|
||||
|
||||
public void setUriTemplate(String uriTemplate) {
|
||||
this.uriTemplate = uriTemplate;
|
||||
}
|
||||
|
||||
public ApiScope getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public void setScope(ApiScope scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.wso2.carbon.apimgt.webapp.publisher.exception;
|
||||
|
||||
/**
|
||||
* Handles the exceptions related to API management.
|
||||
*/
|
||||
public class APIManagerPublisherException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = -8933142342423122660L;
|
||||
|
||||
public APIManagerPublisherException(String msg, Exception nestedEx) {
|
||||
super(msg, nestedEx);
|
||||
}
|
||||
|
||||
public APIManagerPublisherException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public APIManagerPublisherException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
public APIManagerPublisherException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public APIManagerPublisherException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
||||
@ -18,8 +18,8 @@
|
||||
*/
|
||||
package org.wso2.carbon.apimgt.webapp.publisher.internal;
|
||||
|
||||
|
||||
import org.wso2.carbon.apimgt.api.model.API;
|
||||
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.APIConfig;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService;
|
||||
import org.wso2.carbon.registry.core.service.RegistryService;
|
||||
import org.wso2.carbon.user.core.service.RealmService;
|
||||
@ -36,7 +36,8 @@ public class APIPublisherDataHolder {
|
||||
private TenantManager tenantManager;
|
||||
private RegistryService registryService;
|
||||
private boolean isServerStarted;
|
||||
private Stack<API> unpublishedApis = new Stack<>();
|
||||
private Stack<APIConfig> unpublishedApis = new Stack<>();
|
||||
private IntegrationClientService integrationClientService;
|
||||
|
||||
private static APIPublisherDataHolder thisInstance = new APIPublisherDataHolder();
|
||||
|
||||
@ -108,11 +109,20 @@ public class APIPublisherDataHolder {
|
||||
isServerStarted = serverStarted;
|
||||
}
|
||||
|
||||
public Stack<API> getUnpublishedApis() {
|
||||
public Stack<APIConfig> getUnpublishedApis() {
|
||||
return unpublishedApis;
|
||||
}
|
||||
|
||||
public void setUnpublishedApis(Stack<API> unpublishedApis) {
|
||||
public void setUnpublishedApis(Stack<APIConfig> unpublishedApis) {
|
||||
this.unpublishedApis = unpublishedApis;
|
||||
}
|
||||
|
||||
public IntegrationClientService getIntegrationClientService() {
|
||||
return integrationClientService;
|
||||
}
|
||||
|
||||
public void setIntegrationClientService(
|
||||
IntegrationClientService integrationClientService) {
|
||||
this.integrationClientService = integrationClientService;
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.wso2.carbon.apimgt.impl.APIManagerConfigurationService;
|
||||
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherServiceImpl;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler;
|
||||
@ -30,16 +30,9 @@ import org.wso2.carbon.apimgt.webapp.publisher.config.WebappPublisherConfig;
|
||||
import org.wso2.carbon.core.ServerStartupObserver;
|
||||
import org.wso2.carbon.registry.core.service.RegistryService;
|
||||
import org.wso2.carbon.user.core.service.RealmService;
|
||||
import org.wso2.carbon.utils.ConfigurationContextService;
|
||||
|
||||
/**
|
||||
* @scr.component name="org.wso2.carbon.apimgt.webapp.publisher" immediate="true"
|
||||
* @scr.reference name="config.context.service"
|
||||
* interface="org.wso2.carbon.utils.ConfigurationContextService"
|
||||
* cardinality="0..1"
|
||||
* policy="dynamic"
|
||||
* bind="setConfigurationContextService"
|
||||
* unbind="unsetConfigurationContextService"
|
||||
* @scr.reference name="user.realmservice.default"
|
||||
* interface="org.wso2.carbon.user.core.service.RealmService"
|
||||
* cardinality="1..1"
|
||||
@ -52,6 +45,11 @@ import org.wso2.carbon.utils.ConfigurationContextService;
|
||||
* policy="dynamic"
|
||||
* bind="setRegistryService"
|
||||
* unbind="unsetRegistryService"
|
||||
* interface="org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService"
|
||||
* cardinality="1..1"
|
||||
* policy="dynamic"
|
||||
* bind="setIntegrationClientService"
|
||||
* unbind="unsetIntegrationClientService"
|
||||
*/
|
||||
public class APIPublisherServiceComponent {
|
||||
|
||||
@ -97,28 +95,6 @@ public class APIPublisherServiceComponent {
|
||||
bundleContext.registerService(ServerStartupObserver.class, new APIPublisherStartupHandler(), null);
|
||||
}
|
||||
|
||||
protected void setAPIManagerConfigurationService(APIManagerConfigurationService service) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
protected void unsetAPIManagerConfigurationService(APIManagerConfigurationService service) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
protected void setConfigurationContextService(ConfigurationContextService configurationContextService) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Setting ConfigurationContextService");
|
||||
}
|
||||
APIPublisherDataHolder.getInstance().setConfigurationContextService(configurationContextService);
|
||||
}
|
||||
|
||||
protected void unsetConfigurationContextService(ConfigurationContextService configurationContextService) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Un-setting ConfigurationContextService");
|
||||
}
|
||||
APIPublisherDataHolder.getInstance().setConfigurationContextService(null);
|
||||
}
|
||||
|
||||
protected void setRealmService(RealmService realmService) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Setting Realm Service");
|
||||
@ -143,4 +119,15 @@ public class APIPublisherServiceComponent {
|
||||
protected void unsetRegistryService(RegistryService registryService) {
|
||||
APIPublisherDataHolder.getInstance().setRegistryService(null);
|
||||
}
|
||||
|
||||
protected void setIntegrationClientService(IntegrationClientService integrationClientService) {
|
||||
if (integrationClientService != null && log.isDebugEnabled()) {
|
||||
log.debug("integrationClientService initialized");
|
||||
}
|
||||
APIPublisherDataHolder.getInstance().setIntegrationClientService(integrationClientService);
|
||||
}
|
||||
|
||||
protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) {
|
||||
APIPublisherDataHolder.getInstance().setIntegrationClientService(null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,6 @@ import org.apache.catalina.LifecycleListener;
|
||||
import org.apache.catalina.core.StandardContext;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.apimgt.api.model.API;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.APIConfig;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherUtil;
|
||||
@ -77,8 +76,6 @@ public class APIPublisherLifecycleListener implements LifecycleListener {
|
||||
boolean isTenantActive = APIPublisherDataHolder.getInstance().
|
||||
getTenantManager().isTenantActive(tenantId);
|
||||
if (isTenantActive) {
|
||||
apiConfig.init();
|
||||
API api = APIPublisherUtil.getAPI(apiConfig);
|
||||
boolean isServerStarted = APIPublisherDataHolder.getInstance().isServerStarted();
|
||||
if (isServerStarted) {
|
||||
APIPublisherService apiPublisherService =
|
||||
@ -87,13 +84,13 @@ public class APIPublisherLifecycleListener implements LifecycleListener {
|
||||
throw new IllegalStateException(
|
||||
"API Publisher service is not initialized properly");
|
||||
}
|
||||
apiPublisherService.publishAPI(api);
|
||||
apiPublisherService.publishAPI(apiConfig);
|
||||
} else {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Server has not started yet. Hence adding API '" +
|
||||
api.getId().getApiName() + "' to the queue");
|
||||
apiConfig.getName() + "' to the queue");
|
||||
}
|
||||
APIPublisherDataHolder.getInstance().getUnpublishedApis().push(api);
|
||||
APIPublisherDataHolder.getInstance().getUnpublishedApis().push(apiConfig);
|
||||
}
|
||||
} else {
|
||||
log.error("No tenant [" + apiConfig.getTenantDomain() + "] " +
|
||||
|
||||
@ -21,10 +21,10 @@ import io.swagger.annotations.SwaggerDefinition;
|
||||
import org.apache.catalina.core.StandardContext;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.apimgt.api.model.Scope;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherUtil;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.config.APIResource;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.config.APIResourceConfiguration;
|
||||
import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiScope;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.ws.rs.Consumes;
|
||||
@ -96,7 +96,7 @@ public class AnnotationProcessor {
|
||||
private Class<io.swagger.annotations.ApiOperation> apiOperation;
|
||||
private Class<org.wso2.carbon.apimgt.annotations.api.Scope> scopeClass;
|
||||
private Class<org.wso2.carbon.apimgt.annotations.api.Scopes> scopesClass;
|
||||
private Map<String, Scope> apiScopes;
|
||||
private Map<String, ApiScope> apiScopes;
|
||||
|
||||
public AnnotationProcessor(final StandardContext context) {
|
||||
servletContext = context.getServletContext();
|
||||
@ -206,20 +206,20 @@ public class AnnotationProcessor {
|
||||
return apiResourceConfigs;
|
||||
}
|
||||
|
||||
private Map<String,Scope> processAPIScopes(Annotation annotation) throws Throwable {
|
||||
Map<String, Scope> scopes = new HashMap<>();
|
||||
private Map<String,ApiScope> processAPIScopes(Annotation annotation) throws Throwable {
|
||||
Map<String, ApiScope> scopes = new HashMap<>();
|
||||
|
||||
InvocationHandler methodHandler = Proxy.getInvocationHandler(annotation);
|
||||
Annotation[] annotatedScopes = (Annotation[]) methodHandler.invoke(annotation, scopesClass
|
||||
.getMethod(ANNOTATIONS_SCOPES, null), null);
|
||||
|
||||
Scope scope;
|
||||
ApiScope scope;
|
||||
String permissions[];
|
||||
StringBuilder aggregatedPermissions;
|
||||
for(int i=0; i<annotatedScopes.length; i++){
|
||||
aggregatedPermissions = new StringBuilder();
|
||||
methodHandler = Proxy.getInvocationHandler(annotatedScopes[i]);
|
||||
scope = new Scope();
|
||||
scope = new ApiScope();
|
||||
scope.setName(invokeMethod(scopeClass
|
||||
.getMethod(SWAGGER_ANNOTATIONS_PROPERTIES_NAME), annotatedScopes[i], STRING));
|
||||
scope.setDescription(invokeMethod(scopeClass
|
||||
@ -277,13 +277,13 @@ public class AnnotationProcessor {
|
||||
resource.setProduces(invokeMethod(producesClassMethods[0], producesAnno, STRING_ARR));
|
||||
}
|
||||
if (annotations[i].annotationType().getName().equals(ApiOperation.class.getName())) {
|
||||
Scope scope = this.getScope(annotations[i]);
|
||||
ApiScope scope = this.getScope(annotations[i]);
|
||||
if (scope != null) {
|
||||
resource.setScope(scope);
|
||||
} else {
|
||||
log.warn("Scope is not defined for '" + makeContextURLReady(resourceRootContext) +
|
||||
makeContextURLReady(subCtx) + "' endpoint, hence assigning the default scope");
|
||||
scope = new Scope();
|
||||
scope = new ApiScope();
|
||||
scope.setName(DEFAULT_SCOPE_NAME);
|
||||
scope.setDescription(DEFAULT_SCOPE_NAME);
|
||||
scope.setKey(DEFAULT_SCOPE_KEY);
|
||||
@ -456,7 +456,7 @@ public class AnnotationProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
private Scope getScope(Annotation currentMethod) throws Throwable {
|
||||
private ApiScope getScope(Annotation currentMethod) throws Throwable {
|
||||
InvocationHandler methodHandler = Proxy.getInvocationHandler(currentMethod);
|
||||
Annotation[] extensions = (Annotation[]) methodHandler.invoke(currentMethod,
|
||||
apiOperation.getMethod(SWAGGER_ANNOTATIONS_EXTENSIONS, null), null);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user