Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.tinypass.client.publisher.api.PublisherLicensingContractDomainApi Maven / Gradle / Ivy
package com.tinypass.client.publisher.api;
import com.tinypass.client.common.*;
import com.tinypass.client.publisher.model.ContractDomain;
import java.util.*;
import java.math.*;
import java.io.*;
public class PublisherLicensingContractDomainApi {
private String basePath = "https://api.piano.io/api/v3";
private String token;
private ApiInvoker apiInvoker = null;
private Map headerParams = new LinkedHashMap();
public PublisherLicensingContractDomainApi(String basePath, String token) {
this.basePath = basePath;
this.token = token;
}
public PublisherLicensingContractDomainApi(String basePath, String token, ApiInvoker invoker, Map headerParams) {
this(basePath, token);
this.apiInvoker = invoker;
this.headerParams = headerParams;
}
public ApiInvoker getInvoker() {
if(apiInvoker == null) apiInvoker = ApiInvoker.getInstance();
return apiInvoker;
}
public void setApiToken(String token){
this.token = token;
}
public void setBasePath(String basePath) {
this.basePath = basePath;
}
public String getBasePath() {
return basePath;
}
public String toQueryParam(Object arg) {
if(arg == null)
return null;
if (arg instanceof Date) {
Date date = (Date) arg;
long epochTime = date.getTime() / 1000;
return String.valueOf(epochTime);
} else {
return String.valueOf(arg);
}
}
public void setQueryParam(Map> params, String paramName, Object value) {
List currentValues = params.computeIfAbsent(paramName, k -> new ArrayList<>());
if (value instanceof List) {
List values = (List) value;
values.forEach(o -> addQueryParam(currentValues, o));
} else {
addQueryParam(currentValues, value);
}
}
private void addQueryParam(List currentValues, Object value) {
String v = toQueryParam(value);
if (v != null)
currentValues.add(v);
}
/**
* API Request for createContractDomain
*/
public class createContractDomainRequest implements ApiRequest {
Map headerParams;
Map> queryParams = new HashMap<>();
Map> formParams = new HashMap<>();
Object body = null;
public createContractDomainRequest(Map headerParams) {
this.headerParams = headerParams;
}
public Map> getPreparedFormParams() {
return Collections.unmodifiableMap(formParams);
}
public createContractDomainRequest aid(String aid) {
setQueryParam(this.formParams, "aid", aid);
return this;
}
public createContractDomainRequest contractId(String contractId) {
setQueryParam(this.formParams, "contract_id", contractId);
return this;
}
public createContractDomainRequest contractDomainValue(String contractDomainValue) {
setQueryParam(this.formParams, "contract_domain_value", contractDomainValue);
return this;
}
public ContractDomain execute() throws ApiException{
String path = "/publisher/licensing/contractDomain/create".replaceAll("\\{format\\}","json");
return getInvoker().invokeAPI(basePath, path, "POST", token,
queryParams, null,
headerParams,
formParams,
"",
ContractDomain.class);
}
}
/**
* Helper method to create a new request.
*/
public createContractDomainRequest createContractDomainRequest(){
return new createContractDomainRequest(headerParams);
}
/**
* API Request for getContractDomainList
*/
public class getContractDomainListRequest implements ApiRequest {
Map headerParams;
Map> queryParams = new HashMap<>();
Map> formParams = new HashMap<>();
Object body = null;
public getContractDomainListRequest(Map headerParams) {
this.headerParams = headerParams;
}
public Map> getPreparedFormParams() {
return Collections.unmodifiableMap(formParams);
}
public getContractDomainListRequest aid(String aid) {
setQueryParam(this.queryParams, "aid", aid);
return this;
}
public getContractDomainListRequest contractId(String contractId) {
setQueryParam(this.queryParams, "contract_id", contractId);
return this;
}
public getContractDomainListRequest orderBy(String orderBy) {
setQueryParam(this.queryParams, "order_by", orderBy);
return this;
}
public getContractDomainListRequest orderDirection(String orderDirection) {
setQueryParam(this.queryParams, "order_direction", orderDirection);
return this;
}
public getContractDomainListRequest q(String q) {
setQueryParam(this.queryParams, "q", q);
return this;
}
public getContractDomainListRequest offset(Integer offset) {
setQueryParam(this.queryParams, "offset", offset);
return this;
}
public getContractDomainListRequest limit(Integer limit) {
setQueryParam(this.queryParams, "limit", limit);
return this;
}
public PageList execute() throws ApiException{
String path = "/publisher/licensing/contractDomain/list".replaceAll("\\{format\\}","json");
return getInvoker().invokeAPI(basePath, path, "GET", token,
queryParams, null,
headerParams,
formParams,
"array",
ContractDomain.class);
}
}
/**
* Helper method to create a new request.
*/
public getContractDomainListRequest getContractDomainListRequest(){
return new getContractDomainListRequest(headerParams);
}
/**
* API Request for removeAndRevokeContractDomain
*/
public class removeAndRevokeContractDomainRequest implements ApiRequest {
Map headerParams;
Map> queryParams = new HashMap<>();
Map> formParams = new HashMap<>();
Object body = null;
public removeAndRevokeContractDomainRequest(Map headerParams) {
this.headerParams = headerParams;
}
public Map> getPreparedFormParams() {
return Collections.unmodifiableMap(formParams);
}
public removeAndRevokeContractDomainRequest aid(String aid) {
setQueryParam(this.formParams, "aid", aid);
return this;
}
public removeAndRevokeContractDomainRequest contractId(String contractId) {
setQueryParam(this.formParams, "contract_id", contractId);
return this;
}
public removeAndRevokeContractDomainRequest contractDomainId(String contractDomainId) {
setQueryParam(this.formParams, "contract_domain_id", contractDomainId);
return this;
}
public removeAndRevokeContractDomainRequest contractUserSessionId(String contractUserSessionId) {
setQueryParam(this.formParams, "contract_user_session_id", contractUserSessionId);
return this;
}
public void execute() throws ApiException{
String path = "/publisher/licensing/contractDomain/removeAndRevoke".replaceAll("\\{format\\}","json");
getInvoker().invokeAPI(basePath, path, "POST", token,
queryParams, null,
headerParams,
formParams,
null,
null);
}
}
/**
* Helper method to create a new request.
*/
public removeAndRevokeContractDomainRequest removeAndRevokeContractDomainRequest(){
return new removeAndRevokeContractDomainRequest(headerParams);
}
/**
* API Request for removeContractDomain
*/
public class removeContractDomainRequest implements ApiRequest {
Map headerParams;
Map> queryParams = new HashMap<>();
Map> formParams = new HashMap<>();
Object body = null;
public removeContractDomainRequest(Map headerParams) {
this.headerParams = headerParams;
}
public Map> getPreparedFormParams() {
return Collections.unmodifiableMap(formParams);
}
public removeContractDomainRequest aid(String aid) {
setQueryParam(this.formParams, "aid", aid);
return this;
}
public removeContractDomainRequest contractId(String contractId) {
setQueryParam(this.formParams, "contract_id", contractId);
return this;
}
public removeContractDomainRequest contractDomainId(String contractDomainId) {
setQueryParam(this.formParams, "contract_domain_id", contractDomainId);
return this;
}
public removeContractDomainRequest contractUserSessionId(String contractUserSessionId) {
setQueryParam(this.formParams, "contract_user_session_id", contractUserSessionId);
return this;
}
public void execute() throws ApiException{
String path = "/publisher/licensing/contractDomain/remove".replaceAll("\\{format\\}","json");
getInvoker().invokeAPI(basePath, path, "POST", token,
queryParams, null,
headerParams,
formParams,
null,
null);
}
}
/**
* Helper method to create a new request.
*/
public removeContractDomainRequest removeContractDomainRequest(){
return new removeContractDomainRequest(headerParams);
}
/**
* API Request for updateContractDomain
*/
public class updateContractDomainRequest implements ApiRequest {
Map headerParams;
Map> queryParams = new HashMap<>();
Map> formParams = new HashMap<>();
Object body = null;
public updateContractDomainRequest(Map headerParams) {
this.headerParams = headerParams;
}
public Map> getPreparedFormParams() {
return Collections.unmodifiableMap(formParams);
}
public updateContractDomainRequest aid(String aid) {
setQueryParam(this.formParams, "aid", aid);
return this;
}
public updateContractDomainRequest contractId(String contractId) {
setQueryParam(this.formParams, "contract_id", contractId);
return this;
}
public updateContractDomainRequest contractDomainId(String contractDomainId) {
setQueryParam(this.formParams, "contract_domain_id", contractDomainId);
return this;
}
public updateContractDomainRequest contractDomainValue(String contractDomainValue) {
setQueryParam(this.formParams, "contract_domain_value", contractDomainValue);
return this;
}
public ContractDomain execute() throws ApiException{
String path = "/publisher/licensing/contractDomain/update".replaceAll("\\{format\\}","json");
return getInvoker().invokeAPI(basePath, path, "POST", token,
queryParams, null,
headerParams,
formParams,
"",
ContractDomain.class);
}
}
/**
* Helper method to create a new request.
*/
public updateContractDomainRequest updateContractDomainRequest(){
return new updateContractDomainRequest(headerParams);
}
}