public class ApiDefinition {

	private String location;
	private String key;

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

} public class CreateApiDefinitionResponse {

	private String key;
	private String status;
	private String action;

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}
	
} public class CreateOAuthClientResponse {

	@SerializedName(value="client_id")
	private String clientId;
	
	private String secret;
	
	@SerializedName(value="redirect_uri")
	private String redirectUri;
	
	public String getClientId() {
		return clientId;
	}
	
	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	public String getRedirectUri() {
		return redirectUri;
	}

	public void setRedirectUri(String redirectUri) {
		this.redirectUri = redirectUri;
	}

} public class CreateOrganizationKeyRequest {

	private int allowance;	
	private int rate;
	private int per;
	private int expires;
	
	@SerializedName("quota_max")
	private int quotaMax;
	
	private int quotaRenews;
	
	@SerializedName("quota_remaining")
	private int quotaRemaining;
	
	@SerializedName("quota_renewal_rate")
	private int quotaRenewalRate;
	
	@SerializedName("access_rights")
	private AccessRights accessRights;
	
	@SerializedName("org_id")
	private String orgId;

	public int getAllowance() {
		return allowance;
	}

	public void setAllowance(int allowance) {
		this.allowance = allowance;
	}

	public int getRate() {
		return rate;
	}

	public void setRate(int rate) {
		this.rate = rate;
	}

	public int getPer() {
		return per;
	}

	public void setPer(int per) {
		this.per = per;
	}

	public int getExpires() {
		return expires;
	}

	public void setExpires(int expires) {
		this.expires = expires;
	}

	public int getQuotaMax() {
		return quotaMax;
	}

	public void setQuotaMax(int quotaMax) {
		this.quotaMax = quotaMax;
	}

	public int getQuotaRenews() {
		return quotaRenews;
	}

	public void setQuotaRenews(int quotaRenews) {
		this.quotaRenews = quotaRenews;
	}

	public int getQuotaRemaining() {
		return quotaRemaining;
	}

	public void setQuotaRemaining(int quotaRemaining) {
		this.quotaRemaining = quotaRemaining;
	}

	public int getQuotaRenewalRate() {
		return quotaRenewalRate;
	}

	public void setQuotaRenewalRate(int quotaRenewalRate) {
		this.quotaRenewalRate = quotaRenewalRate;
	}

	public AccessRights getAccessRights() {
		return accessRights;
	}

	public void setAccessRights(AccessRights accessRights) {
		this.accessRights = accessRights;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

} public class CreateOrganizationKeyResponse {

	@SerializedName(value="key")
	private String apiKey;
	
	private String status;
	private String action;
	
	@SerializedName(value="is_inactive")
	private boolean inactive;
	
	public String getApiKey() {
		return apiKey;
	}
	
	public void setApiKey(String apiKey) {
		this.apiKey = apiKey;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public boolean isInactive() {
		return inactive;
	}

	public void setInactive(boolean inactive) {
		this.inactive = inactive;
	}
	
} public class DeleteApiDefinitionResponse {

	private String key;
	private String status;
	private String action;

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}
	
} public class DeleteOAuthClientResponse {

	private String key;
	private String status;
	private String action;

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}
	
} public class DeleteOrganizationKeyResponse {

	private String key;
	private String status;
	private String action;
	
	public String getKey() {
		return key;
	}
	
	public void setKey(String key) {
		this.key = key;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

} public class GetKeysResponse {

	private List<String> keys;

	public List<String> getKeys() {
		return keys;
	}

	public void setKeys(List<String> keys) {
		this.keys = keys;
	}
	
} public class GetOAuthClientsResponse {

	private List<OAuthClient> oauthClients;

	public GetOAuthClientsResponse() {
		oauthClients = new ArrayList<OAuthClient>();
	}
	
	public List<OAuthClient> getOauthClients() {
		return oauthClients;
	}

	public void setOauthClients(List<OAuthClient> oauthClients) {
		this.oauthClients = oauthClients;
	}
	
} public class HealthCheckResponse {

	@SerializedName(value="throttle_requests_per_second")
	private int throttleRequestsPerSecond;
	
	@SerializedName(value="quota_violations_per_second")
	private int quotaViolationsPerSecond;
	
	@SerializedName(value="key_failures_per_second")
	private int keyFailuresPerSecond;
	
	@SerializedName(value="average_upstream_latency")	
	private int averageUpstreamLatency;
	
	@SerializedName(value="average_requests_per_second")
	private int averageRequestsPerSecond;
	
	public int getThrottleRequestsPerSecond() {
		return throttleRequestsPerSecond;
	}
	
	public void setThrottleRequestsPerSecond(int throttleRequestsPerSecond) {
		this.throttleRequestsPerSecond = throttleRequestsPerSecond;
	}

	public int getQuotaViolationsPerSecond() {
		return quotaViolationsPerSecond;
	}

	public void setQuotaViolationsPerSecond(int quotaViolationsPerSecond) {
		this.quotaViolationsPerSecond = quotaViolationsPerSecond;
	}

	public int getKeyFailuresPerSecond() {
		return keyFailuresPerSecond;
	}

	public void setKeyFailuresPerSecond(int keyFailuresPerSecond) {
		this.keyFailuresPerSecond = keyFailuresPerSecond;
	}

	public int getAverageUpstreamLatency() {
		return averageUpstreamLatency;
	}

	public void setAverageUpstreamLatency(int averageUpstreamLatency) {
		this.averageUpstreamLatency = averageUpstreamLatency;
	}

	public int getAverageRequestsPerSecond() {
		return averageRequestsPerSecond;
	}

	public void setAverageRequestsPerSecond(int averageRequestsPerSecond) {
		this.averageRequestsPerSecond = averageRequestsPerSecond;
	}

} public class HotReloadResponse {

	private String status;
	private String error;
	
	public String getStatus() {
		return status;
	}
	
	public void setStatus(String status) {
		this.status = status;
	}

	public String getError() {
		return error;
	}

	public void setError(String error) {
		this.error = error;
	}
	
} public class CreateKeyRequest {

	private int allowance;
	private int rate;
	private int per;
	private int expires;
	
	@SerializedName(value="quota_renews")
	private int quotaRenews;
	
	@SerializedName(value="quota_remaining")
	private int quotaRemaining;
	
	@SerializedName(value="quota_renewalrate")
	private int quotaRenewalRate;
	
	@SerializedName(value="access_rights")
	private AccessRights accessRights;
	
	@SerializedName(value="org_id")
	private String orgId;

	public int getAllowance() {
		return allowance;
	}

	public void setAllowance(int allowance) {
		this.allowance = allowance;
	}

	public int getRate() {
		return rate;
	}

	public void setRate(int rate) {
		this.rate = rate;
	}

	public int getPer() {
		return per;
	}

	public void setPer(int per) {
		this.per = per;
	}

	public int getExpires() {
		return expires;
	}

	public void setExpires(int expires) {
		this.expires = expires;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}
	
} public class CreateKeyResponse {

	private String key;
	private String status;
	private String action;
	
	public String getKey() {
		return key;
	}
	
	public void setKey(String key) {
		this.key = key;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}
	
} public class CreateOAuthClientRequest {

	@SerializedName(value="app_id")
	private String appId;
	
	@SerializedName(value="redirect_uri")
	private String redirectUri;

	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getRedirectUri() {
		return redirectUri;
	}

	public void setRedirectUri(String redirectUri) {
		this.redirectUri = redirectUri;
	}
	

} public class DeleteKeyResponse {

	private String key;
	private String status;
	private String action;
	
	public String getKey() {
		return key;
	}
	
	public void setKey(String key) {
		this.key = key;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}
	
} public class OAuthAuthorizationFlowResponse {

	private String code;
	
	@SerializedName(value="access_token")
	private String accessToken;
	
	@SerializedName(value="expires_in")
	private int expiresIn;
	
	@SerializedName(value="redirect_to")
	private String redirectTo;
	
	@SerializedName(value="token_type")
	private String tokenType;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}

	public int getExpiresIn() {
		return expiresIn;
	}

	public void setExpiresIn(int expiresIn) {
		this.expiresIn = expiresIn;
	}

	public String getRedirectTo() {
		return redirectTo;
	}

	public void setRedirectTo(String redirectTo) {
		this.redirectTo = redirectTo;
	}

	public String getTokenType() {
		return tokenType;
	}

	public void setTokenType(String tokenType) {
		this.tokenType = tokenType;
	}
	
} public class UpdateApiDefinitionResponse {

	private String key;
	private String status;
	private String action;

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}
	
} public class UpdateOrganizationKeyRequest {

	@SerializedName(value="quota_max")
	private int quotaMax;
	
	@SerializedName(value="quota_renews")
	private int quotaRenews;
	
	@SerializedName(value="quota_remaining")
	private int quotaRemaining;
	
	@SerializedName(value="quota_renewal_rate")
	private int quotaRenewalRate;
	
	@SerializedName(value="org_id")
	private String organizationId;
	
	@SerializedName(value="is_inactive")
	private boolean inactive;
	
	public int getQuotaMax() {
		return quotaMax;
	}
	
	public void setQuotaMax(int quotaMax) {
		this.quotaMax = quotaMax;
	}

	public int getQuotaRenews() {
		return quotaRenews;
	}

	public void setQuotaRenews(int quotaRenews) {
		this.quotaRenews = quotaRenews;
	}

	public int getQuotaRemaining() {
		return quotaRemaining;
	}

	public void setQuotaRemaining(int quotaRemaining) {
		this.quotaRemaining = quotaRemaining;
	}

	public int getQuotaRenewalRate() {
		return quotaRenewalRate;
	}

	public void setQuotaRenewalRate(int quotaRenewalRate) {
		this.quotaRenewalRate = quotaRenewalRate;
	}

	public String getOrganizationId() {
		return organizationId;
	}

	public void setOrganizationId(String organizationId) {
		this.organizationId = organizationId;
	}

	public boolean isInactive() {
		return inactive;
	}

	public void setInactive(boolean inactive) {
		this.inactive = inactive;
	}

} public class UpdateOrganizationKeyResponse {

	private String key;
	private String status;
	private String action;
	
	public String getKey() {
		return key;
	}
	
	public void setKey(String key) {
		this.key = key;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

}
import com.mtnfog.tyk.model.ApiDefinition;
import com.mtnfog.tyk.model.CreateApiDefinitionResponse;
import com.mtnfog.tyk.model.CreateOAuthClientResponse;
import com.mtnfog.tyk.model.CreateOrganizationKeyRequest;
import com.mtnfog.tyk.model.CreateOrganizationKeyResponse;
import com.mtnfog.tyk.model.DeleteApiDefinitionResponse;
import com.mtnfog.tyk.model.DeleteOAuthClientResponse;
import com.mtnfog.tyk.model.DeleteOrganizationKeyResponse;
import com.mtnfog.tyk.model.GetKeysResponse;
import com.mtnfog.tyk.model.GetOAuthClientsResponse;
import com.mtnfog.tyk.model.HealthCheckResponse;
import com.mtnfog.tyk.model.HotReloadResponse;
import com.mtnfog.tyk.model.CreateKeyRequest;
import com.mtnfog.tyk.model.CreateKeyResponse;
import com.mtnfog.tyk.model.CreateOAuthClientRequest;
import com.mtnfog.tyk.model.DeleteKeyResponse;
import com.mtnfog.tyk.model.OAuthAuthorizationFlowResponse;
import com.mtnfog.tyk.model.UpdateApiDefinitionResponse;
import com.mtnfog.tyk.model.UpdateOrganizationKeyRequest;
import com.mtnfog.tyk.model.UpdateOrganizationKeyResponse;
import retrofit.http.Body;
import retrofit.http.DELETE;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.GET;
import retrofit.http.Header;
import retrofit.http.POST;
import retrofit.http.PUT;
import retrofit.http.Path;
import retrofit.http.Query;
package com.mtnfog.tyk;



/**
 * The Tyk REST API interface.
 * 
 * @author Mountain Fog, Inc.
 *
 */
public interface TykService {

	// Api Key Management
	
	/**
	 * Creates a new Tyk API key. The created API key will be randomly generated.
	 * @param request A {@link CreateKeyRequest request} containing the details for the new key.
	 * @param tykAuthKey The Tyk authentication key.
	 * @return A {@link CreateKeyResponse response} containing the new API key.
	 */
	@POST("/tyk/keys/create/")
	CreateKeyResponse createApiKey(@Body CreateKeyRequest request, @Header("x-tyk-authorization") String tykAuthKey);
	
	/**
	 * Creates a new Tyk API key.
	 * @param apiKey The API key to create.
	 * @param request A {@link CreateKeyRequest request} containing the details for the new key.
	 * @param tykAuthKey The Tyk authentication key.
	 * @return A {@link CreateKeyResponse response}.
	 */
	@POST("/tyk/keys/{apiKey}/")
	CreateKeyResponse createApiKey(@Path("apiKey") String apiKey, @Body CreateKeyRequest request, @Header("x-tyk-authorization") String tykAuthKey);
	
	/**
	 * Deletes an API key from Tyk.
	 * @param apiKey The API key to delete.
	 * @param tykAuthKey The Tyk authentication key.
	 * @return A link {@link DeleteKeyResponse response}.
	 */
	@DELETE("/tyk/keys/{apiKey}/")
	DeleteKeyResponse deleteApiKey(@Path("apiKey") String apiKey, @Header("x-tyk-authorization") String tykAuthKey);